This is a port of the Mathematica script to python3.
assert alpha([1,1,1,2])==Rational(1,6)
Having all the functions available we can compare the reductions due to the Lyndon indices in comparison to the Hall Basis.
avec=[*symarray('a',3)]
bvec=[*symarray('b',3)]
print("Equations in the Lyndon Basis")
print(CreateConditions(3,avec,bvec))
print("=========================")
print("Equations in the Hall Basis")
print(CreateConditions(3,avec,bvec,CreateMuVectors))