schubmult
2.0.2 was recently released. Ongoing development on the repo below. This has integration with the CAS SageMath (sage
).
https://github.com/matthematics/schubmult
Can run
pip install schubmult --upgrade
or
sage -m pip install schubmult
Basic sage example
sage: from schubmult.sage_integration import FastSchubertPolynomial, FastDoubleSchubertPolynomialRing, FastQuantumSchubertPolynomial, FastQuantumDoubleSchubertPolynomialRing sage: SingleRing = FastSchubertPolynomialRing(ZZ, 100, "x") sage: SingleRing([3,4,1,2]) Sx[3, 4, 1, 2] sage: SingleRing([3,4,1,2]) * SingleRing([5,1,4,2,3]) Sx[7, 3, 4, 1, 2, 5, 6] + Sx[7, 4, 2, 1, 3, 5, 6] + Sx[7, 5, 1, 2, 3, 4, 6]
Mixed variable (Molev-Sagan) type products
sage: DoubleRing = FastDoubleSchubertPolynomialRing(ZZ, 100, "x", ("y", "z")) sage: DoubleRing([3,4,1,2])*DoubleRing([1,4,2,3]) (y1*y2-y1*y4-y2*y4+y4^2)*Sx([3, 4, 1, 2], 'y') + (-y1-y2+y4+y5)*Sx([3, 5, 1, 2, 4], 'y') + Sx([3, 6, 1, 2, 4, 5], 'y') sage: DoubleRing([3,4,1,2]) * DoubleRing([1,4,2,3],"z") (y3^2+y3*y4+y4^2-y3*z1-y4*z1-y3*z2-y4*z2+z1*z2-y3*z3-y4*z3+z1*z3+z2*z3)*Sx([3, 4, 1, 2], 'y') + (y3+y4+y5-z1-z2-z3)*Sx([3, 5, 1, 2, 4], 'y') + Sx([3, 6, 1, 2, 4, 5], 'y')
expand()
sage: SingleRingQ = FastQuantumSchubertPolynomialRing(ZZ, 100, "x") sage: SingleRingQ([2,3,1,4]).expand() x1*x2 + q_1
Coercion
Coercion was implemented as widely as possible.
sage: DoubleRing([1,4,2,3],"z") * SingleRing([3,4,1,2]) z1^2*z4^2*Sx([1, 4, 2, 3], 'z') + (z1^2*z4+z1^2*z5)*Sx([1, 5, 2, 3, 4], 'z') + z1^2*Sx([1, 6, 2, 3, 4, 5], 'z') + (z1*z4^2+z2*z4^2)*Sx([2, 4, 1, 3], 'z') + (z1*z4+z2*z4+z1*z5+z2*z5)*Sx([2, 5, 1, 3, 4], 'z') + (z1+z2)*Sx([2, 6, 1, 3, 4, 5], 'z') + z4^2*Sx([3, 4, 1, 2], 'z') + (z4+z5)*Sx([3, 5, 1, 2, 4], 'z') + Sx([3, 6, 1, 2, 4, 5], 'z') sage: SingleRingQ([2,3,1,4]) * SingleRing([4,1,3,2]) (-2*q_1^2*q_2+q_1*q_2*q_3)*QSx[1] + q_1*q_2*QSx[1, 3, 4, 2] + (-q_1^2)*QSx[2, 3, 1] + q_1*QSx[2, 4, 3, 1] + (-q_1*q_2)*QSx[3, 1, 2] + q_1*QSx[3, 2, 4, 1] + q_1*QSx[3, 4, 1, 2] + (-q_1)*QSx[4, 2, 1, 3] + QSx[5, 2, 3, 1, 4] + QSx[5, 3, 1, 2, 4] sage: R.<x1, x2> = PolynomialRing(ZZ, 2) sage: SingleRing([1,3,2]) - x1 - x2 == 0 True
Coproducts
FastSchubertPolynomialRing and FastDoubleSchubertPolynomialRings are bialgebras and each element implements the coproduct()
member function. set_coproduct_indices()
on the base ring will determine the variables to partition on.
sage: DoubleRing.set_coproduct_indices((1,3)) sage: DoubleRing([4,1,5,2,3], "z").coproduct() (y1^2-y1*z2-y1*z3+z2*z3)*S([4, 1, 2, 3], 'z') # S([1], 'y') + (y1+y2-z2-z3)*S([4, 1, 2, 3], 'z') # S([2, 1], 'y') + S([4, 1, 2, 3], 'z') # S([3, 1, 2], 'y') + (y1-z3)*S([4, 2, 1, 3], 'z') # S([1], 'y') + S([4, 2, 1, 3], 'z') # S([2, 1], 'y') + S([4, 3, 1, 2], 'z') # S([1], 'y')