diff --git a/src/doc/de/tutorial/tour_advanced.rst b/src/doc/de/tutorial/tour_advanced.rst index 56523ae5650..59d9661c040 100644 --- a/src/doc/de/tutorial/tour_advanced.rst +++ b/src/doc/de/tutorial/tour_advanced.rst @@ -35,11 +35,11 @@ wir diese schneiden und dann die irreduziblen Komponenten berechnen. sage: V = C2.intersection(C3) sage: V.irreducible_components() [Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - y, - x - 1, - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: y - 1, x, + Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: + y, + x - 1, Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: x + y + 2, 2*y^2 + 4*y + 3] diff --git a/src/doc/en/tutorial/tour_advanced.rst b/src/doc/en/tutorial/tour_advanced.rst index da3dd7fc4c5..9a93145e972 100644 --- a/src/doc/en/tutorial/tour_advanced.rst +++ b/src/doc/en/tutorial/tour_advanced.rst @@ -35,11 +35,11 @@ intersecting them and computing the irreducible components. sage: V = C2.intersection(C3) sage: V.irreducible_components() [Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - y, - x - 1, - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: y - 1, x, + Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: + y, + x - 1, Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: x + y + 2, 2*y^2 + 4*y + 3] diff --git a/src/doc/fr/tutorial/tour_advanced.rst b/src/doc/fr/tutorial/tour_advanced.rst index 70ece3bc944..add83373629 100644 --- a/src/doc/fr/tutorial/tour_advanced.rst +++ b/src/doc/fr/tutorial/tour_advanced.rst @@ -36,11 +36,11 @@ irréductibles. sage: V = C2.intersection(C3) sage: V.irreducible_components() [Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - y, - x - 1, - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: y - 1, x, + Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: + y, + x - 1, Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: x + y + 2, 2*y^2 + 4*y + 3] diff --git a/src/doc/ja/tutorial/tour_advanced.rst b/src/doc/ja/tutorial/tour_advanced.rst index 6b8ed96904a..f8681a86f93 100644 --- a/src/doc/ja/tutorial/tour_advanced.rst +++ b/src/doc/ja/tutorial/tour_advanced.rst @@ -35,11 +35,11 @@ Sageでは,任意の代数多様体を定義することができるが,そ sage: V = C2.intersection(C3) sage: V.irreducible_components() [Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - y, - x - 1, - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: y - 1, x, + Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: + y, + x - 1, Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: x + y + 2, 2*y^2 + 4*y + 3] diff --git a/src/doc/pt/tutorial/tour_advanced.rst b/src/doc/pt/tutorial/tour_advanced.rst index 5a8fdd04de9..96eb07f0a4c 100644 --- a/src/doc/pt/tutorial/tour_advanced.rst +++ b/src/doc/pt/tutorial/tour_advanced.rst @@ -36,11 +36,11 @@ irredutíveis. sage: V = C2.intersection(C3) sage: V.irreducible_components() [Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - y, - x - 1, - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: y - 1, x, + Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: + y, + x - 1, Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: x + y + 2, 2*y^2 + 4*y + 3] diff --git a/src/doc/ru/tutorial/tour_advanced.rst b/src/doc/ru/tutorial/tour_advanced.rst index 1420053e93b..f09db1d2d3f 100644 --- a/src/doc/ru/tutorial/tour_advanced.rst +++ b/src/doc/ru/tutorial/tour_advanced.rst @@ -33,11 +33,11 @@ Sage позволяет создавать любые алгебраически sage: V = C2.intersection(C3) sage: V.irreducible_components() [Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - y, - x - 1, - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: y - 1, x, + Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: + y, + x - 1, Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: x + y + 2, 2*y^2 + 4*y + 3] diff --git a/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py b/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py index e6368ea8389..2e6cba1e965 100644 --- a/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py +++ b/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py @@ -212,14 +212,14 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation): sage: T1 * L1 * T2 * L3 * T1 * T2 -(q-q^2)*L2*L3*T[2] + q*L1*L2*T[2,1] - (1-q)*L1*L2*T[2,1,2] sage: L1^3 - u0*u1*u2 + ((-u0*u1-u0*u2-u1*u2))*L1 + ((u0+u1+u2))*L1^2 + u0*u1*u2 - ((u0*u1+u0*u2+u1*u2))*L1 + ((u0+u1+u2))*L1^2 sage: L3 * L2 * L1 L1*L2*L3 sage: u = LT.u() sage: q = LT.q() sage: (q + 2*u[0]) * (T1 * T2) * L3 - (-2*u0+(2*u0-1)*q+q^2)*L3*T[1] + (-2*u0+(2*u0-1)*q+q^2)*L2*T[2] - + (2*u0+q)*L1*T[1,2] + -(2*u0+(-2*u0+1)*q-q^2)*L3*T[1] - (2*u0+(-2*u0+1)*q-q^2)*L2*T[2] + + (2*u0+q)*L1*T[1,2] We check the defining relations:: @@ -789,11 +789,11 @@ def L(self, i=None): sage: LT = algebras.ArikiKoike(1, 3).LT() sage: LT.L(2) - u + (-u*q^-1+u)*T[1] + u - (u*q^-1-u)*T[1] sage: LT.L() [u, - u + (-u*q^-1+u)*T[1], - u + (-u*q^-1+u)*T[2] + (-u*q^-2+u*q^-1)*T[2,1,2]] + u - (u*q^-1-u)*T[1], + u - (u*q^-1-u)*T[2] - (u*q^-2-u*q^-1)*T[2,1,2]] """ G = self.algebra_generators() if i is None: @@ -824,18 +824,18 @@ def product_on_basis(self, m1, m2): sage: L1^2 * T1 * L1^2 * T1 q*L1^2*L2^2 + (1-q)*L1^3*L2*T[1] sage: L1^3 * T1 * L1^2 * T1 - (-u0*u1*u2*u3+u0*u1*u2*u3*q)*L2*T[1] - + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3)+(-u0*u1*u2-u0*u1*u3-u0*u2*u3-u1*u2*u3)*q)*L1*L2*T[1] - + ((-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3)+(u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3)*q)*L1^2*L2*T[1] - + ((u0+u1+u2+u3)+(-u0-u1-u2-u3)*q)*L1^3*L2*T[1] + q*L1^3*L2^2 + -(u0*u1*u2*u3-u0*u1*u2*u3*q)*L2*T[1] + + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3)+(-u0*u1*u2-u0*u1*u3-u0*u2*u3-u1*u2*u3)*q)*L1*L2*T[1] + - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3)+(-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3)*q)*L1^2*L2*T[1] + + ((u0+u1+u2+u3)+(-u0-u1-u2-u3)*q)*L1^3*L2*T[1] + q*L1^3*L2^2 sage: L1^2 * T1 * L1^3 * T1 - (-u0*u1*u2*u3+u0*u1*u2*u3*q)*L2*T[1] - + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3)+(-u0*u1*u2-u0*u1*u3-u0*u2*u3-u1*u2*u3)*q)*L1*L2*T[1] - + ((-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3)+(u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3)*q)*L1^2*L2*T[1] - + q*L1^2*L2^3 - + ((u0+u1+u2+u3)+(-u0-u1-u2-u3)*q)*L1^3*L2*T[1] - + (1-q)*L1^3*L2^2*T[1] + -(u0*u1*u2*u3-u0*u1*u2*u3*q)*L2*T[1] + + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3)+(-u0*u1*u2-u0*u1*u3-u0*u2*u3-u1*u2*u3)*q)*L1*L2*T[1] + - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3)+(-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3)*q)*L1^2*L2*T[1] + + q*L1^2*L2^3 + + ((u0+u1+u2+u3)+(-u0-u1-u2-u3)*q)*L1^3*L2*T[1] + + (1-q)*L1^3*L2^2*T[1] sage: L1^2 * T1*T2*T1 * L2 * L3 * T2 (q-2*q^2+q^3)*L1^2*L2*L3 - (1-2*q+2*q^2-q^3)*L1^2*L2*L3*T[2] @@ -1061,7 +1061,7 @@ def _Li_power(self, i, m): sage: H = algebras.ArikiKoike(3, 2).LT() sage: L2 = H.L(2) sage: H._Li_power(2, 4) - ((u0^2*u1*u2+u0*u1^2*u2+u0*u1*u2^2)) + ... + ((u0^2*u1*u2+u0*u1^2*u2+u0*u1*u2^2)) ... - (q^-1-1)*L1*L2^3*T[1] ... - (q^-1-1)*L1^3*L2*T[1] sage: H._Li_power(2, 4) == L2^4 @@ -1078,20 +1078,20 @@ def _Li_power(self, i, m): L_1^0 = 1 L_1^1 = L1 L_1^2 = L1^2 - L_1^3 = u0*u1*u2 + ((-u0*u1-u0*u2-u1*u2))*L1 + ((u0+u1+u2))*L1^2 + L_1^3 = u0*u1*u2 - ((u0*u1+u0*u2+u1*u2))*L1 + ((u0+u1+u2))*L1^2 L_2^0 = 1 L_2^1 = L2 L_2^2 = L2^2 - L_2^3 = u0*u1*u2 + (-u0*u1*u2*q^-1+u0*u1*u2)*T[1] - + ((-u0*u1-u0*u2-u1*u2))*L2 + ((u0+u1+u2))*L2^2 + L_2^3 = u0*u1*u2 - (u0*u1*u2*q^-1-u0*u1*u2)*T[1] + - ((u0*u1+u0*u2+u1*u2))*L2 + ((u0+u1+u2))*L2^2 + ((u0+u1+u2)*q^-1+(-u0-u1-u2))*L1*L2*T[1] - (q^-1-1)*L1*L2^2*T[1] - (q^-1-1)*L1^2*L2*T[1] L_3^0 = 1 L_3^1 = L3 L_3^2 = L3^2 - L_3^3 = u0*u1*u2 + (-u0*u1*u2*q^-1+u0*u1*u2)*T[2] - + (-u0*u1*u2*q^-2+u0*u1*u2*q^-1)*T[2,1,2] - + ((-u0*u1-u0*u2-u1*u2))*L3 + ((u0+u1+u2))*L3^2 + L_3^3 = u0*u1*u2 - (u0*u1*u2*q^-1-u0*u1*u2)*T[2] + - (u0*u1*u2*q^-2-u0*u1*u2*q^-1)*T[2,1,2] + - ((u0*u1+u0*u2+u1*u2))*L3 + ((u0+u1+u2))*L3^2 + ((u0+u1+u2)*q^-1+(-u0-u1-u2))*L2*L3*T[2] - (q^-1-1)*L2*L3^2*T[2] - (q^-1-1)*L2^2*L3*T[2] + ((u0+u1+u2)*q^-2+(-2*u0-2*u1-2*u2)*q^-1+(u0+u1+u2))*L1*L3*T[1,2] @@ -1376,11 +1376,11 @@ def L(self, i=None): sage: T = algebras.ArikiKoike(1, 3).T() sage: T.L(2) - u + (-u*q^-1+u)*T[1] + u - (u*q^-1-u)*T[1] sage: T.L() [u, - u + (-u*q^-1+u)*T[1], - u + (-u*q^-1+u)*T[2] + (-u*q^-2+u*q^-1)*T[2,1,2]] + u - (u*q^-1-u)*T[1], + u - (u*q^-1-u)*T[2] - (u*q^-2-u*q^-1)*T[2,1,2]] TESTS: @@ -1432,10 +1432,10 @@ def product_on_basis(self, m1, m2): sage: T2 * (T2 * T1 * T0) -(1-q)*T[2,1,0] + q*T[1,0] sage: (T1 * T0 * T1 * T0) * T0 - (-u0*u1)*T[1,0,1] + ((u0+u1))*T[0,1,0,1] + -u0*u1*T[1,0,1] + ((u0+u1))*T[0,1,0,1] sage: (T0 * T1 * T0 * T1) * (T0 * T1) - (-u0*u1*q)*T[1,0] + (u0*u1-u0*u1*q)*T[1,0,1] - + ((u0+u1)*q)*T[0,1,0] + ((-u0-u1)+(u0+u1)*q)*T[0,1,0,1] + -u0*u1*q*T[1,0] + (u0*u1-u0*u1*q)*T[1,0,1] + + ((u0+u1)*q)*T[0,1,0] - ((u0+u1)+(-u0-u1)*q)*T[0,1,0,1] sage: T1 * (T0 * T2 * T1 * T0) T[1,0,2,1,0] sage: (T1 * T2) * (T2 * T1 * T0) @@ -1462,7 +1462,7 @@ def product_on_basis(self, m1, m2): sage: T = algebras.ArikiKoike(2, 3).T() sage: T0, T1, T2 = T.T() sage: (T1 * T0 * T1) * (T0 * T0) - (-u0*u1)*T[1,0,1] + ((u0+u1))*T[0,1,0,1] + -u0*u1*T[1,0,1] + ((u0+u1))*T[0,1,0,1] sage: T1 * T.L(3) * T2 * T1 * T0 - T1 * (T.L(3) * T2 * T1 * T0) 0 @@ -1674,19 +1674,19 @@ def _product_TT(self, kp, a, k, b): sage: T._product_TT(1, 2, 0, 1) T[1,0,0,0] sage: T._product_TT(1, 3, 0, 1) - (-u0*u1*u2*u3)*T[1] + -u0*u1*u2*u3*T[1] + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3))*T[1,0] - + ((-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3))*T[1,0,0] + - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3))*T[1,0,0] + ((u0+u1+u2+u3))*T[1,0,0,0] sage: T._product_TT(1, 2, 0, 2) - (-u0*u1*u2*u3)*T[1] + -u0*u1*u2*u3*T[1] + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3))*T[1,0] - + ((-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3))*T[1,0,0] + - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3))*T[1,0,0] + ((u0+u1+u2+u3))*T[1,0,0,0] sage: T._product_TT(2, 1, 0, 3) - (-u0*u1*u2*u3)*T[2,1] + -u0*u1*u2*u3*T[2,1] + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3))*T[2,1,0] - + ((-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3))*T[2,1,0,0] + - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3))*T[2,1,0,0] + ((u0+u1+u2+u3))*T[2,1,0,0,0] TESTS:: @@ -1694,22 +1694,19 @@ def _product_TT(self, kp, a, k, b): sage: H = algebras.ArikiKoike(3, 4) sage: T = H.T() sage: T._product_TT(1, 2, 1, 2) - (-u0*u1*u2+u0*u1*u2*q)*T[1,0] - + (u0*u1*u2-u0*u1*u2*q)*T[0,1] + -(u0*u1*u2-u0*u1*u2*q)*T[1,0] + (u0*u1*u2-u0*u1*u2*q)*T[0,1] + ((u0+u1+u2)+(-u0-u1-u2)*q)*T[0,1,0,0] - + ((-u0-u1-u2)+(u0+u1+u2)*q)*T[0,0,1,0] - + T[0,0,1,0,0,1] + - ((u0+u1+u2)+(-u0-u1-u2)*q)*T[0,0,1,0] + T[0,0,1,0,0,1] sage: T._product_TT(2,2,2,2) - (-u0*u1*u2+u0*u1*u2*q)*T[2,1,0,2] + -(u0*u1*u2-u0*u1*u2*q)*T[2,1,0,2] + (u0*u1*u2-u0*u1*u2*q)*T[1,0,2,1] + ((u0+u1+u2)+(-u0-u1-u2)*q)*T[1,0,2,1,0,0] - + ((-u0-u1-u2)+(u0+u1+u2)*q)*T[1,0,0,2,1,0] - + T[1,0,0,2,1,0,0,1] + - ((u0+u1+u2)+(-u0-u1-u2)*q)*T[1,0,0,2,1,0] + T[1,0,0,2,1,0,0,1] sage: T._product_TT(3,2,3,2) - (-u0*u1*u2+u0*u1*u2*q)*T[3,2,1,0,3,2] + -(u0*u1*u2-u0*u1*u2*q)*T[3,2,1,0,3,2] + (u0*u1*u2-u0*u1*u2*q)*T[2,1,0,3,2,1] + ((u0+u1+u2)+(-u0-u1-u2)*q)*T[2,1,0,3,2,1,0,0] - + ((-u0-u1-u2)+(u0+u1+u2)*q)*T[2,1,0,0,3,2,1,0] + - ((u0+u1+u2)+(-u0-u1-u2)*q)*T[2,1,0,0,3,2,1,0] + T[2,1,0,0,3,2,1,0,0,1] """ # Quadratic relation: S_i^2 - (q - 1) S_i - q == 0 diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py b/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py index 514d9b035d7..ac5d9b945f7 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py @@ -30,9 +30,9 @@ sage: braid = BG3((1,2,-1,2,2,-1)); braid c0*c1*c0^-1*c1^2*c0^-1 sage: braid_image = CHA3(braid); braid_image - u*c1*c0^-1*c1 + u*v*c0*c1^-1*c0^-1 + (-u^2)*c0^-1*c1 + u*c1*c0^-1*c1 + u*v*c0*c1^-1*c0^-1 - u^2*c0^-1*c1 + ((u^2*v-v^2)/w)*c0*c1*c0^-1 + ((u^2-v)/w)*c0*c1*c0 - + ((-u^3+u*v)/w)*c0*c1 + (-u*v+w)*c1^-1 + - ((u^3-u*v)/w)*c0*c1 - (u*v-w)*c1^-1 If the ring elements `u, v, w` (which will be called the *cubic equation parameters* in the sequel) are taken to be `u = v = 0, w = 1` the cubic Hecke @@ -73,7 +73,7 @@ sage: CHA3 = algebras.CubicHecke(3) sage: c1, c2 = CHA3.gens() sage: b = c1^2*c2 - c2*c1^2 - c1*c2^2 + c2^2*c1; b - w*c0^-1*c1 + (-w)*c0*c1^-1 + (-w)*c1*c0^-1 + w*c1^-1*c0 + w*c0^-1*c1 - w*c0*c1^-1 - w*c1*c0^-1 + w*c1^-1*c0 sage: b2 = b*b sage: b3 = b2*b sage: BR = CHA3.base_ring() @@ -151,10 +151,10 @@ class CubicHeckeElement(CombinatorialFreeModule.Element): EXAMPLES:: sage: CHA3s = algebras.CubicHecke('s1, s2'); CHA3s.an_element() - (-w)*s1*s2^-1 + v*s1 + u*s2 + ((-v*w+u)/w) + -w*s1*s2^-1 + v*s1 + u*s2 - ((v*w-u)/w) sage: CHA3. = algebras.CubicHecke(3) sage: c1**3*~c2 - u*w*c1^-1*c2^-1 + (u^2-v)*c1*c2^-1 + (-u*v+w)*c2^-1 + u*w*c1^-1*c2^-1 + (u^2-v)*c1*c2^-1 - (u*v-w)*c2^-1 """ # -------------------------------------------------------------------------- # Overloading inherited methods @@ -173,11 +173,11 @@ def __invert__(self): sage: CHA2 = algebras.CubicHecke(2) sage: x = CHA2.an_element(); x - v*c + ((-v*w+u)/w) + v*c - ((v*w-u)/w) sage: ~x Traceback (most recent call last): ... - ValueError: cannot invert self (= v*c + ((-v*w+u)/w)) + ValueError: cannot invert self (= v*c - ((v*w-u)/w)) """ self_Tietze = self.Tietze() @@ -206,7 +206,7 @@ def Tietze(self): sage: CHA3 = algebras.CubicHecke(3) sage: ele = CHA3.an_element(); ele - (-w)*c0*c1^-1 + v*c0 + u*c1 + ((-v*w+u)/w) + -w*c0*c1^-1 + v*c0 + u*c1 - ((v*w-u)/w) sage: ele.Tietze() is None True sage: [CHA3(sp).Tietze() for sp in ele.support()] @@ -228,7 +228,7 @@ def max_len(self): sage: CHA3 = algebras.CubicHecke(3) sage: ele = CHA3.an_element(); ele - (-w)*c0*c1^-1 + v*c0 + u*c1 + ((-v*w+u)/w) + -w*c0*c1^-1 + v*c0 + u*c1 - ((v*w-u)/w) sage: ele.max_len() 2 """ @@ -248,9 +248,9 @@ def braid_group_algebra_pre_image(self): sage: CHA3 = algebras.CubicHecke(3) sage: ele = CHA3.an_element(); ele - (-w)*c0*c1^-1 + v*c0 + u*c1 + ((-v*w+u)/w) + -w*c0*c1^-1 + v*c0 + u*c1 - ((v*w-u)/w) sage: b_ele = ele.braid_group_algebra_pre_image(); b_ele - ((-v*w+u)/w) + v*c0 + u*c1 + (-w)*c0*c1^-1 + -((v*w-u)/w) + v*c0 + u*c1 - w*c0*c1^-1 sage: ele in CHA3 True sage: b_ele in CHA3 @@ -281,9 +281,9 @@ def cubic_braid_group_algebra_pre_image(self): sage: CHA3 = algebras.CubicHecke(3) sage: ele = CHA3.an_element(); ele - (-w)*c0*c1^-1 + v*c0 + u*c1 + ((-v*w+u)/w) + -w*c0*c1^-1 + v*c0 + u*c1 - ((v*w-u)/w) sage: cb_ele = ele.cubic_braid_group_algebra_pre_image(); cb_ele - (-w)*c0*c1^-1 + v*c0 + u*c1 + ((-v*w+u)/w) + -w*c0*c1^-1 + v*c0 + u*c1 - ((v*w-u)/w) sage: ele in CHA3 True sage: cb_ele in CHA3 @@ -455,7 +455,7 @@ def revert_orientation(self): sage: CHA3. = algebras.CubicHecke(3) sage: e = CHA3.an_element() sage: e.revert_orientation() - (-w)*c2^-1*c1 + v*c1 + u*c2 + ((-v*w+u)/w) + -w*c2^-1*c1 + v*c1 + u*c2 - ((v*w-u)/w) sage: _.revert_orientation() == e True """ @@ -518,7 +518,7 @@ def formal_markov_trace(self, extended=False, field_embedding=False): sage: K3_1 = KnotInfo.K3_1 sage: b3_1 = CHA2(K3_1.braid()) sage: mt3_1 = b3_1.formal_markov_trace(); mt3_1 - ((u^2*s^2-v*s^2+u*w)/s)*B[U1] + (-u*v+w)*B[U2] + ((u^2*s^2-v*s^2+u*w)/s)*B[U1] - (u*v-w)*B[U2] sage: mt3_1.parent() Free module generated by {U1, U2} over Multivariate Polynomial Ring in u, v, w, s @@ -534,7 +534,7 @@ def formal_markov_trace(self, extended=False, field_embedding=False): sage: f = b3_1.formal_markov_trace(extended=True, field_embedding=True); f ((a^2*b*c+a*b^2*c+a*b*c^2+a^2*s^2+a*b*s^2+b^2*s^2+a*c*s^2+b*c*s^2+c^2*s^2)/s)*B[U1] - + (-a^2*b-a*b^2-a^2*c-2*a*b*c-b^2*c-a*c^2-b*c^2)*B[U2] + - (a^2*b+a*b^2+a^2*c+2*a*b*c+b^2*c+a*c^2+b*c^2)*B[U2] sage: f.parent().base_ring() Fraction Field of Multivariate Polynomial Ring in a, b, c, s over Cyclotomic Field of order 3 and degree 2 @@ -699,19 +699,19 @@ class CubicHeckeAlgebra(CombinatorialFreeModule): Element construction:: sage: ele = CHA3.an_element(); ele - (-w)*s1*s2^-1 + v*s1 + u*s2 + ((-v*w+u)/w) + -w*s1*s2^-1 + v*s1 + u*s2 - ((v*w-u)/w) sage: ele2 = ele**2; ele2 - w^2*(s1^-1*s2)^2 + (-u*w^2)*s1^-1*s2*s1^-1 + (-v*w)*s2*s1^-1*s2 - + (-v*w^2)*s1^-1*s2^-1 + u*w*s1*s2*s1^-1*s2 + (-u*w)*s1^-1*s2*s1 - + (-u*v*w+2*v*w-2*u)*s1*s2^-1 + u*v*w*s2*s1^-1 + u*v*s2*s1 + v^2*w*s1^-1 - + (-u^2*w)*s1*s2*s1^-1 + ((u*v^2*w-2*v^2*w-u*w^2+2*u*v)/w)*s1 - + u*v*s1*s2 + (u^2*w+v^2*w)*s2^-1 + ((u^3*w-2*u*v*w+2*u^2)/w)*s2 - + ((-u^2*v*w^2-v^3*w^2+v^2*w^2-2*u*v*w+u^2)/w^2) + w^2*(s1^-1*s2)^2 - u*w^2*s1^-1*s2*s1^-1 - v*w*s2*s1^-1*s2 + - v*w^2*s1^-1*s2^-1 + u*w*s1*s2*s1^-1*s2 - u*w*s1^-1*s2*s1 + - (u*v*w-2*v*w+2*u)*s1*s2^-1 + u*v*w*s2*s1^-1 + u*v*s2*s1 + v^2*w*s1^-1 + - u^2*w*s1*s2*s1^-1 + ((u*v^2*w-2*v^2*w-u*w^2+2*u*v)/w)*s1 + u*v*s1*s2 + + (u^2*w+v^2*w)*s2^-1 + ((u^3*w-2*u*v*w+2*u^2)/w)*s2 + - ((u^2*v*w^2+v^3*w^2-v^2*w^2+2*u*v*w-u^2)/w^2) sage: B3 = CHA3.braid_group() sage: braid = B3((2,-1, 2, 1)); braid s2*s1^-1*s2*s1 sage: ele3 = CHA3(braid); ele3 - s1*s2*s1^-1*s2 + u*s1^-1*s2*s1 + (-v)*s1*s2^-1 + v*s2^-1*s1 + (-u)*s1*s2*s1^-1 + s1*s2*s1^-1*s2 + u*s1^-1*s2*s1 - v*s1*s2^-1 + v*s2^-1*s1 - u*s1*s2*s1^-1 sage: ele3t = CHA3((2,-1, 2, 1)) sage: ele3 == ele3t True @@ -1185,7 +1185,7 @@ def _element_constructor_(self, x): sage: cb2 = cb**2 sage: CHA2 = algebras.CubicHecke(2) sage: CHA2(b2) - w*c^-1 + u*c + (-v) + w*c^-1 + u*c - v sage: CHA2(cb2) c^-1 sage: CHA3 = algebras.CubicHecke(3) @@ -1195,10 +1195,10 @@ def _element_constructor_(self, x): sage: braid = B3((1,2,2,-1,2,1,1,-1)); braid c0*c1^2*c0^-1*c1*c0 sage: img_braid = CHA3(braid); img_braid - u*w*(c0^-1*c1)^2 + u*v*c0*c1^-1*c0 + (-u^2*w)*c0^-1*c1*c0^-1 - + (-u*v)*c1*c0^-1*c1 + (-u*v*w+w^2)*c0^-1*c1^-1 + u^2*c0*c1*c0^-1*c1 - + (-u^2*v+u*w)*c0*c1^-1 + u^2*v*c1*c0^-1 + (u^2-v)*c1*c0 - + (-u^3)*c0*c1*c0^-1 + (u*v^2-v*w)*c1^-1 + u*w*(c0^-1*c1)^2 + u*v*c0*c1^-1*c0 - u^2*w*c0^-1*c1*c0^-1 + - u*v*c1*c0^-1*c1 - (u*v*w-w^2)*c0^-1*c1^-1 + u^2*c0*c1*c0^-1*c1 + - (u^2*v-u*w)*c0*c1^-1 + u^2*v*c1*c0^-1 + (u^2-v)*c1*c0 + - u^3*c0*c1*c0^-1 + (u*v^2-v*w)*c1^-1 sage: cbraid = CB3(braid); cbraid c0*c1^2*c0^-1*c1*c0 sage: img_cbraid = CHA3(cbraid); img_cbraid @@ -1461,7 +1461,7 @@ def _an_element_(self): sage: CHA2 = algebras.CubicHecke(2) sage: CHA2.an_element() # indirect doctest - v*c + ((-v*w+u)/w) + v*c - ((v*w-u)/w) """ n = self.ngens() + 1 base_ring = self.base_ring() @@ -1535,7 +1535,7 @@ def product_on_basis(self, g1, g2): sage: CHA3.product_on_basis(g, ~g) 1 sage: CHA3.product_on_basis(g, g) - w*c0^-1*c1*c0 + (-v)*c1*c0 + u*c0*c1*c0 + w*c0^-1*c1*c0 - v*c1*c0 + u*c0*c1*c0 """ # ---------------------------------------------------------------------- # short way for multiplications with one @@ -1912,12 +1912,12 @@ def _braid_image_from_filecache(self, braid): sage: CHA3 = algebras.CubicHecke(3) sage: b1, b2 = CHA3.braid_group().gens(); br = ~b2*b1*~b2 sage: CHA3._braid_image_from_filecache(br) - 1/w*c0*c1*c0^-1*c1 + v/w*c1^-1*c0 + ((-u)/w)*c0*c1*c0^-1 + 1/w*c0*c1*c0^-1*c1 + v/w*c1^-1*c0 - u/w*c0*c1*c0^-1 sage: F = CHA3.base_ring().fraction_field() sage: par = tuple([F(p) for p in CHA3.cubic_equation_parameters()]) sage: CHA3F = algebras.CubicHecke(3, cubic_equation_parameters=par) sage: CHA3F._braid_image_from_filecache(br) - 1/w*c0*c1*c0^-1*c1 + v/w*c1^-1*c0 + ((-u)/w)*c0*c1*c0^-1 + 1/w*c0*c1*c0^-1*c1 + v/w*c1^-1*c0 - u/w*c0*c1*c0^-1 sage: section = CHA3.filecache_section().braid_images sage: CHA3.reset_filecache(section) sage: CHA3._braid_image_from_filecache(br) @@ -1954,7 +1954,7 @@ def _braid_image_to_filecache(self, braid_tietze, braid_image_vect): True sage: CHA2._braid_image_to_filecache(br2.Tietze(), CHA2(br2).to_vector()) sage: CHA2._braid_image_from_filecache(br2) - w*c^-1 + u*c + (-v) + w*c^-1 + u*c - v sage: CHA2.reset_filecache(CHA2.filecache_section().braid_images) sage: CHA2._braid_image_from_filecache(br2) == None True @@ -1986,7 +1986,7 @@ def _braid_image(self, braid): sage: CHA2 = algebras.CubicHecke(2) sage: br, = CHA2.braid_group().gens(); br2 = br**2 sage: CHA2._braid_image(br2) - w*c^-1 + u*c + (-v) + w*c^-1 + u*c - v """ # ---------------------------------------------------------------------- # first use the cubic equation to express the braid as a linear @@ -2029,7 +2029,7 @@ def _braid_image_from_reduced_powers(self, braid_tietze): sage: CHA3._braid_image_from_reduced_powers((1, -2, 1)) c0*c1^-1*c0 sage: CHA3._braid_image_from_reduced_powers((1, -2, 1, 2)) - w*c0^-1*c1*c0^-1 + (-v)*c1*c0^-1 + u*c0*c1*c0^-1 + w*c0^-1*c1*c0^-1 - v*c1*c0^-1 + u*c0*c1*c0^-1 """ n = self.ngens() braid_list = list(braid_tietze) @@ -2853,7 +2853,7 @@ def garside_involution(self, element): sage: CHA3 = algebras.CubicHecke(3) sage: ele = CHA3.an_element() sage: ele_gar = CHA3.garside_involution(ele); ele_gar - (-w)*c1*c0^-1 + u*c0 + v*c1 + ((-v*w+u)/w) + -w*c1*c0^-1 + u*c0 + v*c1 - ((v*w-u)/w) sage: ele == CHA3.garside_involution(ele_gar) True """ @@ -2891,7 +2891,7 @@ def orientation_antiinvolution(self, element): sage: CHA3 = algebras.CubicHecke(3) sage: ele = CHA3.an_element() sage: ele_ori = CHA3.orientation_antiinvolution(ele); ele_ori - (-w)*c1^-1*c0 + v*c0 + u*c1 + ((-v*w+u)/w) + -w*c1^-1*c0 + v*c0 + u*c1 - ((v*w-u)/w) sage: ele == CHA3.orientation_antiinvolution(ele_ori) True """ diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py b/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py index 1b011c68c61..ff997d29cde 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py @@ -1334,7 +1334,7 @@ def specialize_homfly(self): From: Multivariate Polynomial Ring in u, v, w, s over Integer Ring localized at (s, w, v, u) To: Multivariate Polynomial Ring in L, M - over Integer Ring localized at (M, M - 1, L) + over Integer Ring localized at (M - 1, M, L) Defn: u |--> -M + 1 v |--> -M + 1 w |--> 1 @@ -1342,7 +1342,7 @@ def specialize_homfly(self): then Conversion map: From: Multivariate Polynomial Ring in L, M - over Integer Ring localized at (M, M - 1, L) + over Integer Ring localized at (M - 1, M, L) To: Multivariate Laurent Polynomial Ring in L, M over Integer Ring sage: sup = mt.support() diff --git a/src/sage/algebras/iwahori_hecke_algebra.py b/src/sage/algebras/iwahori_hecke_algebra.py index ecc6788979b..8162873a651 100644 --- a/src/sage/algebras/iwahori_hecke_algebra.py +++ b/src/sage/algebras/iwahori_hecke_algebra.py @@ -1703,12 +1703,12 @@ class Element(CombinatorialFreeModule.Element): sage: R. = QQ[] sage: H = IwahoriHeckeAlgebra("A2", q1, q2=q2).T(prefix='x') sage: sum(H.algebra_generators())^2 - x[2,1] + x[1,2] + (q1+q2)*x[1] + (q1+q2)*x[2] + (-2*q1*q2) + x[2,1] + x[1,2] + (q1+q2)*x[1] + (q1+q2)*x[2] - 2*q1*q2 sage: H = IwahoriHeckeAlgebra("A2", q1, q2=q2).T(prefix='t') sage: t1,t2 = H.algebra_generators() sage: (t1-t2)^3 - (q1^2-q1*q2+q2^2)*t[1] + (-q1^2+q1*q2-q2^2)*t[2] + (q1^2-q1*q2+q2^2)*t[1] - (q1^2-q1*q2+q2^2)*t[2] sage: R. = QQ[] sage: H = IwahoriHeckeAlgebra("G2", q).T() diff --git a/src/sage/algebras/lie_algebras/examples.py b/src/sage/algebras/lie_algebras/examples.py index f2db23d445b..dc9c76ce605 100644 --- a/src/sage/algebras/lie_algebras/examples.py +++ b/src/sage/algebras/lie_algebras/examples.py @@ -85,7 +85,7 @@ def three_dimensional(R, a, b, c, d, names=['X', 'Y', 'Z']): sage: Q. = PolynomialRing(QQ) sage: L = lie_algebras.three_dimensional(Q, a, b, c, d) sage: L.structure_coefficients() - Finite family {('X', 'Y'): d*Y + a*Z, ('X', 'Z'): (-c)*Y + (-d)*Z, ('Y', 'Z'): b*X} + Finite family {('X', 'Y'): d*Y + a*Z, ('X', 'Z'): -c*Y - d*Z, ('Y', 'Z'): b*X} sage: TestSuite(L).run() """ if isinstance(names, str): diff --git a/src/sage/calculus/wester.py b/src/sage/calculus/wester.py index 21c6865d0cb..65c270da5a3 100644 --- a/src/sage/calculus/wester.py +++ b/src/sage/calculus/wester.py @@ -477,7 +477,7 @@ sage: d a^3*b^2*c - a^2*b^3*c - a^3*b*c^2 + a*b^3*c^2 + a^2*b*c^3 - a*b^2*c^3 - a^3*b^2*d + a^2*b^3*d + a^3*c^2*d - b^3*c^2*d - a^2*c^3*d + b^2*c^3*d + a^3*b*d^2 - a*b^3*d^2 - a^3*c*d^2 + b^3*c*d^2 + a*c^3*d^2 - b*c^3*d^2 - a^2*b*d^3 + a*b^2*d^3 + a^2*c*d^3 - b^2*c*d^3 - a*c^2*d^3 + b*c^2*d^3 sage: d.factor() - (-1) * (c - d) * (-b + c) * (b - d) * (-a + c) * (-a + b) * (a - d) + (-1) * (-a + c) * (-a + b) * (-b + c) * (c - d) * (b - d) * (a - d) :: diff --git a/src/sage/categories/coxeter_group_algebras.py b/src/sage/categories/coxeter_group_algebras.py index 32fe0292bb5..312dfd564c6 100644 --- a/src/sage/categories/coxeter_group_algebras.py +++ b/src/sage/categories/coxeter_group_algebras.py @@ -36,13 +36,13 @@ def demazure_lusztig_operator_on_basis(self, w, i, q1, q2, sage: KW = W.algebra(K) sage: w = W.an_element() sage: KW.demazure_lusztig_operator_on_basis(w, 0, q1, q2) - (-q2)*323123 + (q1+q2)*123 + -q2*323123 + (q1+q2)*123 sage: KW.demazure_lusztig_operator_on_basis(w, 1, q1, q2) q1*1231 sage: KW.demazure_lusztig_operator_on_basis(w, 2, q1, q2) q1*1232 sage: KW.demazure_lusztig_operator_on_basis(w, 3, q1, q2) - (q1+q2)*123 + (-q2)*12 + (q1+q2)*123 - q2*12 At `q_1=1` and `q_2=0` we recover the action of the isobaric divided differences `\pi_i`:: @@ -112,13 +112,13 @@ def demazure_lusztig_operators(self, q1, q2, side='right', affine=True): sage: x = KW.monomial(W.an_element()); x 123 sage: T[0](x) - (-q2)*323123 + (q1+q2)*123 + -q2*323123 + (q1+q2)*123 sage: T[1](x) q1*1231 sage: T[2](x) q1*1232 sage: T[3](x) - (q1+q2)*123 + (-q2)*12 + (q1+q2)*123 - q2*12 sage: T._test_relations() @@ -174,7 +174,7 @@ def demazure_lusztig_eigenvectors(self, q1, q2): Weyl Group of type ['B', 2] (as a matrix group acting on the ambient space) sage: w = W.an_element() sage: E[w] # needs sage.rings.number_field - (q2/(-q1+q2))*2121 + ((-q2)/(-q1+q2))*121 - 212 + 12 + (q2/(-q1+q2))*2121 - (q2/(-q1+q2))*121 - 212 + 12 """ W = self.basis().keys() if not W.cartan_type().is_finite(): diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py index a2a5d4421dc..5d87a3dfa8d 100644 --- a/src/sage/combinat/root_system/hecke_algebra_representation.py +++ b/src/sage/combinat/root_system/hecke_algebra_representation.py @@ -378,7 +378,7 @@ def Tw(self, word, signs=None, scalar=None): sage: phi = T.Tw((1,2), (-1,1), 3) sage: phi(KW.one()) - ((-3*q1)/q2)*12 + ((3*q1+3*q2)/q2)*2 + -3*q1/q2*12 + ((3*q1+3*q2)/q2)*2 sage: phi(T[1](x)) == 3*T[2](x) True @@ -429,8 +429,8 @@ def Tw_inverse(self, word): sage: x = KW.monomial(W.an_element()); x 123 sage: rho.Tw_inverse(word)(x) - 1/q2^2*12321 + ((-q1-q2)/(q1*q2^2))*1231 + ((-q1-q2)/(q1*q2^2))*1232 - + ((q1^2+2*q1*q2+q2^2)/(q1^2*q2^2))*123 + 1/q2^2*12321 - ((q1+q2)/(q1*q2^2))*1231 - ((q1+q2)/(q1*q2^2))*1232 + + ((q1^2+2*q1*q2+q2^2)/(q1^2*q2^2))*123 sage: rho.Tw(word)(_) 123 """ @@ -549,16 +549,17 @@ def Y_lambdacheck(self, lambdacheck): sage: x = KW.monomial(W.an_element()); x 12 sage: Y1(x) - ((-q1^2-2*q1*q2-q2^2)/(-q2^2))*2121 - + ((q1^3+q1^2*q2+q1*q2^2+q2^3)/(-q1*q2^2))*121 - + ((q1^2+q1*q2)/(-q2^2))*212 + ((-q1^2)/(-q2^2))*12 + -((q1^2+2*q1*q2+q2^2)/(-q2^2))*2121 + + ((q1^3+q1^2*q2+q1*q2^2+q2^3)/(-q1*q2^2))*121 + + ((q1^2+q1*q2)/(-q2^2))*212 - (q1^2/(-q2^2))*12 sage: Y2(x) - ((-q1^4-q1^3*q2-q1*q2^3-q2^4)/(-q1^3*q2))*2121 - + ((q1^3+q1^2*q2+q1*q2^2+q2^3)/(-q1^2*q2))*121 + (q2^3/(-q1^3))*12 + -((q1^4+q1^3*q2+q1*q2^3+q2^4)/(-q1^3*q2))*2121 + + ((q1^3+q1^2*q2+q1*q2^2+q2^3)/(-q1^2*q2))*121 + + (q2^3/(-q1^3))*12 sage: Y1(Y2(x)) - ((q1*q2+q2^2)/q1^2)*212 + ((-q2)/q1)*12 + ((q1*q2+q2^2)/q1^2)*212 - q2/q1*12 sage: Y2(Y1(x)) - ((q1*q2+q2^2)/q1^2)*212 + ((-q2)/q1)*12 + ((q1*q2+q2^2)/q1^2)*212 - q2/q1*12 The `Y` operators commute:: @@ -754,13 +755,12 @@ def Y_eigenvectors(self): sage: [E[w] for w in W] [2121 - 121 - 212 + 12 + 21 - 1 - 2 + , -2121 + 212, - (q2/(q1-q2))*2121 + (q2/(-q1+q2))*121 - + (q2/(-q1+q2))*212 - 12 + ((-q2)/(-q1+q2))*21 + 2, - ((-q2^2)/(-q1^2+q1*q2-q2^2))*2121 - 121 + (q2^2/(-q1^2+q1*q2-q2^2))*212 + 21, - ((-q1^2-q2^2)/(q1^2-q1*q2+q2^2))*2121 + ((-q1^2-q2^2)/(-q1^2+q1*q2-q2^2))*121 - + ((-q2^2)/(-q1^2+q1*q2-q2^2))*212 + (q2^2/(-q1^2+q1*q2-q2^2))*12 - 21 + 1, + (q2/(q1-q2))*2121 + (q2/(-q1+q2))*121 + (q2/(-q1+q2))*212 - 12 - (q2/(-q1+q2))*21 + 2, + -(q2^2/(-q1^2+q1*q2-q2^2))*2121 - 121 + (q2^2/(-q1^2+q1*q2-q2^2))*212 + 21, + -((q1^2+q2^2)/(q1^2-q1*q2+q2^2))*2121 - ((q1^2+q2^2)/(-q1^2+q1*q2-q2^2))*121 + - (q2^2/(-q1^2+q1*q2-q2^2))*212 + (q2^2/(-q1^2+q1*q2-q2^2))*12 - 21 + 1, 2121, - (q2/(-q1+q2))*2121 + ((-q2)/(-q1+q2))*121 - 212 + 12, + (q2/(-q1+q2))*2121 - (q2/(-q1+q2))*121 - 212 + 12, -2121 + 121] """ if not self.cartan_type().is_affine(): diff --git a/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py b/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py index 90482002c92..62ab2116e12 100644 --- a/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +++ b/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py @@ -74,8 +74,8 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): `[2,0,1]`:: sage: E[L0([2,0,1])] # needs sage.libs.gap - ((-q*q1-q*q2)/(-q*q1-q2))*B[(1, 1, 1)] - + ((-q1-q2)/(-q*q1-q2))*B[(2, 1, 0)] + B[(2, 0, 1)] + -((q*q1+q*q2)/(-q*q1-q2))*B[(1, 1, 1)] + - ((q1+q2)/(-q*q1-q2))*B[(2, 1, 0)] + B[(2, 0, 1)] It can be seen as a polynomial (or in general a Laurent polynomial) by interpreting each term as an exponent vector. The @@ -106,8 +106,8 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: L0 = E.keys() sage: omega = L0.fundamental_weights() sage: E[omega[2] - omega[1]] - ((-q*q1^3*q2-q*q1^2*q2^2)/(q*q1^4-q2^4))*B[(0, 0, 0)] - + B[(1, -1, 0)] + ((-q1*q2^3-q2^4)/(q*q1^4-q2^4))*B[(1, 0, -1)] + -((q*q1^3*q2+q*q1^2*q2^2)/(q*q1^4-q2^4))*B[(0, 0, 0)] + B[(1, -1, 0)] + - ((q1*q2^3+q2^4)/(q*q1^4-q2^4))*B[(1, 0, -1)] Many more examples are given after the background section. @@ -228,11 +228,11 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: Y1 = Y[alphacheck[1]] sage: Y1(x) ((q1^2+2*q1*q2+q2^2)/(-q1*q2))*B[e[0] + e['deltacheck']] - + ((-q1^2-2*q1*q2-q2^2)/(-q2^2))*B[-e[1] + e['deltacheck']] - + ((-q1^2-q1*q2)/(-q2^2))*B[2*e[0] - e[1] - e['delta'] - + e['deltacheck']] + ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - e['delta'] - + e['deltacheck']] + ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - 2*e[1] - e['delta'] - + e['deltacheck']] + ((q1+q2)/(-q2))*B[e[1] + e['deltacheck']] + - ((q1^2+2*q1*q2+q2^2)/(-q2^2))*B[-e[1] + e['deltacheck']] + - ((q1^2+q1*q2)/(-q2^2))*B[2*e[0] - e[1] - e['delta'] + e['deltacheck']] + + ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - e['delta'] + e['deltacheck']] + + ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - 2*e[1] - e['delta'] + e['deltacheck']] + + ((q1+q2)/(-q2))*B[e[1] + e['deltacheck']] + ((q1^3+2*q1^2*q2+q1*q2^2)/(-q2^3))*B[-e[1] - e['delta'] + e['deltacheck']] + ((q1^3+q1^2*q2)/(-q2^3))*B[2*e[0] - e[1] - 2*e['delta'] + e['deltacheck']] + ((q1^3+2*q1^2*q2+q1*q2^2)/(-q2^3))*B[-e[0] - e['delta'] + e['deltacheck']] @@ -273,7 +273,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: omega = L0.fundamental_weights() sage: x = KL0.monomial(omega[1]) sage: T[0](x) - (-q*q2)*B[(-1, 0)] + -q*q2*B[(-1, 0)] For classical nodes these are the usual Demazure-Lusztig operators:: @@ -377,16 +377,16 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E = NonSymmetricMacdonaldPolynomials(['D',3,1], q, u, -1/u) sage: omega = E.keys().fundamental_weights() sage: E[omega[1]+omega[3]] - ((-q*u^2+q)/(-q*u^4+1))*B[(1/2, -1/2, 1/2)] - + ((-q*u^2+q)/(-q*u^4+1))*B[(1/2, 1/2, -1/2)] + B[(3/2, 1/2, 1/2)] + -((q*u^2-q)/(-q*u^4+1))*B[(1/2, -1/2, 1/2)] + - ((q*u^2-q)/(-q*u^4+1))*B[(1/2, 1/2, -1/2)] + B[(3/2, 1/2, 1/2)] sage: KL = RootSystem(["D",3,1]).ambient_space().algebra(K) sage: P = NonSymmetricMacdonaldPolynomials(KL, q, u, -1/u) sage: E[omega[1]+omega[3]] == P[omega[1]+omega[3]] True sage: E[E.keys()((0,1,-1))] - ((-q*u^2+q)/(-q*u^2+1))*B[(0, 0, 0)] + ((-u^2+1)/(-q*u^2+1))*B[(1, 1, 0)] - + ((-u^2+1)/(-q*u^2+1))*B[(1, 0, -1)] + B[(0, 1, -1)] + -((q*u^2-q)/(-q*u^2+1))*B[(0, 0, 0)] - ((u^2-1)/(-q*u^2+1))*B[(1, 1, 0)] + - ((u^2-1)/(-q*u^2+1))*B[(1, 0, -1)] + B[(0, 1, -1)] In type `A`, there is also a combinatorial implementation of the nonsymmetric Macdonald polynomials in terms of augmented diagram @@ -457,11 +457,11 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): The same, directly in the ambient lattice with several shifts:: sage: E[L0([2,0])] # needs sage.combinat - ((-q*t+q)/(-q*t+1))*B[(1, 1)] + B[(2, 0)] + -((q*t-q)/(-q*t+1))*B[(1, 1)] + B[(2, 0)] sage: E[L0([1,-1])] # needs sage.combinat - ((-q*t+q)/(-q*t+1))*B[(0, 0)] + B[(1, -1)] + -((q*t-q)/(-q*t+1))*B[(0, 0)] + B[(1, -1)] sage: E[L0([0,-2])] # needs sage.combinat - ((-q*t+q)/(-q*t+1))*B[(-1, -1)] + B[(0, -2)] + -((q*t-q)/(-q*t+1))*B[(-1, -1)] + B[(0, -2)] Systematic checks with Sage's implementation of [HHL06]_:: @@ -478,31 +478,29 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: L0 = E.keys() sage: E[L0.fundamental_weight(1).weyl_action([2,4,3,2,1])] - ((-u^2+1)/(-q*u^16+1))*B[-Lambda[1] + Lambda[3]] - + ((-u^2+1)/(-q*u^16+1))*B[Lambda[1]] - + B[-Lambda[2] + Lambda[5]] - + ((-u^2+1)/(-q*u^16+1))*B[Lambda[2] - Lambda[4] + Lambda[5]] - + ((-u^2+1)/(-q*u^16+1))*B[-Lambda[3] + Lambda[4]] + -((u^2-1)/(-q*u^16+1))*B[-Lambda[1] + Lambda[3]] + - ((u^2-1)/(-q*u^16+1))*B[Lambda[1]] + B[-Lambda[2] + Lambda[5]] + - ((u^2-1)/(-q*u^16+1))*B[Lambda[2] + - Lambda[4] + Lambda[5]] - ((u^2-1)/(-q*u^16+1))*B[-Lambda[3] + Lambda[4]] sage: E[L0.fundamental_weight(2).weyl_action([2,5,3,4,2])] # long time (6s) - ((-q^2*u^20+q^2*u^18+q*u^2-q)/(-q^2*u^32+2*q*u^16-1))*B[0] + -((q^2*u^20-q^2*u^18-q*u^2+q)/(-q^2*u^32+2*q*u^16-1))*B[0] + B[Lambda[1] - Lambda[3] + Lambda[4] - Lambda[5] + Lambda[6]] - + ((-u^2+1)/(-q*u^16+1))*B[Lambda[1] - Lambda[3] + Lambda[5]] - + ((-q*u^20+q*u^18+u^2-1)/(-q^2*u^32+2*q*u^16-1))*B[-Lambda[2] + Lambda[4]] - + ((-q*u^20+q*u^18+u^2-1)/(-q^2*u^32+2*q*u^16-1))*B[Lambda[2]] + - ((u^2-1)/(-q*u^16+1))*B[Lambda[1] - Lambda[3] + Lambda[5]] + - ((q*u^20-q*u^18-u^2+1)/(-q^2*u^32+2*q*u^16-1))*B[-Lambda[2] + Lambda[4]] + - ((q*u^20-q*u^18-u^2+1)/(-q^2*u^32+2*q*u^16-1))*B[Lambda[2]] + ((u^4-2*u^2+1)/(q^2*u^32-2*q*u^16+1))*B[Lambda[3] - Lambda[4] + Lambda[5]] - + ((-u^2+1)/(-q*u^16+1))*B[Lambda[3] - Lambda[5] + Lambda[6]] + - ((u^2-1)/(-q*u^16+1))*B[Lambda[3] - Lambda[5] + Lambda[6]] sage: E[L0.fundamental_weight(1)+L0.fundamental_weight(6)] # long time (13s) ((q^2*u^10-q^2*u^8-q^2*u^2+q^2)/(q^2*u^26-q*u^16-q*u^10+1))*B[0] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] - Lambda[2] + Lambda[6]] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] + Lambda[2] - Lambda[4] + Lambda[6]] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] - Lambda[3] + Lambda[4] - Lambda[5] + Lambda[6]] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] - Lambda[3] + Lambda[5]] - + B[Lambda[1] + Lambda[6]] - + ((-q*u^2+q)/(-q*u^10+1))*B[-Lambda[2] + Lambda[4]] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[2]] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[3] - Lambda[4] + Lambda[5]] - + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[3] - Lambda[5] + Lambda[6]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[1] - Lambda[2] + Lambda[6]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[1] + Lambda[2] - Lambda[4] + Lambda[6]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[1] - Lambda[3] + Lambda[4] - Lambda[5] + Lambda[6]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[1] - Lambda[3] + Lambda[5]] + B[Lambda[1] + Lambda[6]] + - ((q*u^2-q)/(-q*u^10+1))*B[-Lambda[2] + Lambda[4]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[2]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[3] - Lambda[4] + Lambda[5]] + - ((q*u^2-q)/(-q*u^10+1))*B[Lambda[3] - Lambda[5] + Lambda[6]] We test various other types:: @@ -512,51 +510,50 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E = NonSymmetricMacdonaldPolynomials(KL, q, u, -1/u) sage: L0 = E.keys() sage: E[L0.fundamental_weight(2)] - ((-q*u^2+q)/(-q*u^8+1))*B[(0, 0, 0)] + B[(1, 1, 0)] + -((q*u^2-q)/(-q*u^8+1))*B[(0, 0, 0)] + B[(1, 1, 0)] sage: E[L0((0,-1,1))] # long time (1.5s) - ((-q^2*u^10+q^2*u^8-q*u^6+q*u^4+q*u^2+u^2-q-1)/(-q^3*u^12+q^2*u^8+q*u^4-1))*B[(0, 0, 0)] - + ((-u^2+1)/(-q*u^4+1))*B[(1, -1, 0)] + -((q^2*u^10-q^2*u^8+q*u^6-q*u^4-q*u^2-u^2+q+1)/(-q^3*u^12+q^2*u^8+q*u^4-1))*B[(0, 0, 0)] + - ((u^2-1)/(-q*u^4+1))*B[(1, -1, 0)] + ((u^6-u^4-u^2+1)/(q^3*u^12-q^2*u^8-q*u^4+1))*B[(1, 1, 0)] + ((u^4-2*u^2+1)/(q^3*u^12-q^2*u^8-q*u^4+1))*B[(1, 0, -1)] + ((q^2*u^12-q^2*u^10-u^2+1)/(q^3*u^12-q^2*u^8-q*u^4+1))*B[(1, 0, 1)] + B[(0, -1, 1)] - + ((-u^2+1)/(-q^2*u^8+1))*B[(0, 1, -1)] + ((-u^2+1)/(-q^2*u^8+1))*B[(0, 1, 1)] + - ((u^2-1)/(-q^2*u^8+1))*B[(0, 1, -1)] - ((u^2-1)/(-q^2*u^8+1))*B[(0, 1, 1)] sage: K = QQ['q,u'].fraction_field() sage: q, u = K.gens() sage: KL = RootSystem(["E",6,2]).ambient_space().algebra(K) sage: E = NonSymmetricMacdonaldPolynomials(KL,q,u,-1/u) sage: L0 = E.keys() sage: E[L0.fundamental_weight(4)] # long time (5s) - ((-q^3*u^20+q^3*u^18+q^2*u^2-q^2)/(-q^3*u^28+q^2*u^22+q*u^6-1))*B[(0, 0, 0, 0)] - + ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, -1/2, -1/2)] - + ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, -1/2, 1/2)] - + ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, 1/2, -1/2)] - + ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, 1/2, 1/2)] - + ((q*u^2-q)/(q*u^6-1))*B[(1, 0, 0, 0)] - + B[(1, 1, 0, 0)] - + ((-q*u^2+q)/(-q*u^6+1))*B[(0, 1, 0, 0)] + -((q^3*u^20-q^3*u^18-q^2*u^2+q^2)/(-q^3*u^28+q^2*u^22+q*u^6-1))*B[(0, 0, 0, 0)] + - ((q*u^2-q)/(-q*u^6+1))*B[(1/2, 1/2, -1/2, -1/2)] + - ((q*u^2-q)/(-q*u^6+1))*B[(1/2, 1/2, -1/2, 1/2)] + - ((q*u^2-q)/(-q*u^6+1))*B[(1/2, 1/2, 1/2, -1/2)] + - ((q*u^2-q)/(-q*u^6+1))*B[(1/2, 1/2, 1/2, 1/2)] + + ((q*u^2-q)/(q*u^6-1))*B[(1, 0, 0, 0)] + B[(1, 1, 0, 0)] + - ((q*u^2-q)/(-q*u^6+1))*B[(0, 1, 0, 0)] sage: E[L0((1,-1,0,0))] # long time (23s) ((q^3*u^18-q^3*u^16+q*u^4-q^2*u^2-2*q*u^2+q^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(0, 0, 0, 0)] - + ((-q^3*u^18+q^3*u^16+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, -1/2, -1/2, -1/2)] - + ((-q^3*u^18+q^3*u^16+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, -1/2, -1/2, 1/2)] + - ((q^3*u^18-q^3*u^16-q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, -1/2, -1/2, -1/2)] + - ((q^3*u^18-q^3*u^16-q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, -1/2, -1/2, 1/2)] + ((q^3*u^18-q^3*u^16-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, -1/2, 1/2, -1/2)] + ((q^3*u^18-q^3*u^16-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, -1/2, 1/2, 1/2)] + ((q*u^8-q*u^6-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, 1/2, -1/2, -1/2)] + ((q*u^8-q*u^6-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, 1/2, -1/2, 1/2)] - + ((-q*u^8+q*u^6+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, 1/2, 1/2, -1/2)] - + ((-q*u^8+q*u^6+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, 1/2, 1/2, 1/2)] - + ((-q^2*u^18+q^2*u^16-q*u^8+q*u^6+q*u^2+u^2-q-1)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1, 0, 0, 0)] - + B[(1, -1, 0, 0)] + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 1, 0, 0)] - + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 0, -1, 0)] + - ((q*u^8-q*u^6-q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, 1/2, 1/2, -1/2)] + - ((q*u^8-q*u^6-q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, 1/2, 1/2, 1/2)] + - ((q^2*u^18-q^2*u^16+q*u^8-q*u^6-q*u^2-u^2+q+1)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1, 0, 0, 0)] + + B[(1, -1, 0, 0)] - ((u^2-1)/(-q^2*u^12+1))*B[(1, 1, 0, 0)] + - ((u^2-1)/(-q^2*u^12+1))*B[(1, 0, -1, 0)] + ((u^2-1)/(q^2*u^12-1))*B[(1, 0, 1, 0)] - + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 0, 0, -1)] - + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 0, 0, 1)] - + ((-q*u^2+q)/(-q*u^6+1))*B[(0, -1, 0, 0)] - + ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 1, 0, 0)] - + ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, -1, 0)] - + ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 1, 0)] - + ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 0, -1)] - + ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 0, 1)] + - ((u^2-1)/(-q^2*u^12+1))*B[(1, 0, 0, -1)] + - ((u^2-1)/(-q^2*u^12+1))*B[(1, 0, 0, 1)] + - ((q*u^2-q)/(-q*u^6+1))*B[(0, -1, 0, 0)] + - ((q*u^4-2*q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 1, 0, 0)] + - ((q*u^4-2*q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, -1, 0)] + - ((q*u^4-2*q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 1, 0)] + - ((q*u^4-2*q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 0, -1)] + - ((q*u^4-2*q*u^2+q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 0, 1)] Next we test a twisted type (checked against Maple computation by Bogdan Ion for `q_1=t^2` and `q_2=-1`):: @@ -574,13 +571,13 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): + ((q1+q2)/(q*q1+q2))*B[(0, 0, -1)] + ((q1+q2)/(q*q1+q2))*B[(0, 0, 1)] sage: E[omega[2]] - ((-q1*q2^3-q2^4)/(q*q1^4-q2^4))*B[(1, 0, 0)] + B[(0, 1, 0)] + -((q1*q2^3+q2^4)/(q*q1^4-q2^4))*B[(1, 0, 0)] + B[(0, 1, 0)] sage: E[-omega[2]] ((q^2*q1^7+q^2*q1^6*q2-q1*q2^6-q2^7)/(q^3*q1^7-q^2*q1^5*q2^2+q*q1^2*q2^5-q2^7))*B[(1, 0, 0)] + B[(0, -1, 0)] + ((q*q1^5*q2^2+q*q1^4*q2^3-q1*q2^6-q2^7)/(q^3*q1^7-q^2*q1^5*q2^2+q*q1^2*q2^5-q2^7))*B[(0, 1, 0)] - + ((-q1*q2-q2^2)/(q*q1^2-q2^2))*B[(0, 0, -1)] + - ((q1*q2+q2^2)/(q*q1^2-q2^2))*B[(0, 0, -1)] + ((q1*q2+q2^2)/(-q*q1^2+q2^2))*B[(0, 0, 1)] sage: E[-omega[1]-omega[2]] @@ -588,7 +585,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): + B[(-1, -1, 0)] + ((q*q1^4+q*q1^3*q2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(-1, 1, 0)] + ((q1+q2)/(q*q1+q2))*B[(-1, 0, -1)] - + ((-q1-q2)/(-q*q1-q2))*B[(-1, 0, 1)] + - ((q1+q2)/(-q*q1-q2))*B[(-1, 0, 1)] + ((q*q1^4+q*q1^3*q2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(1, -1, 0)] + ((q^2*q1^6+q^2*q1^5*q2+q*q1^5*q2-q*q1^3*q2^3-q1^5*q2-q1^4*q2^2+q1^3*q2^3+q1^2*q2^4-q1*q2^5-q2^6)/(q^4*q1^6+q^3*q1^5*q2-q^3*q1^4*q2^2+q*q1^2*q2^4-q*q1*q2^5-q2^6))*B[(1, 1, 0)] + ((q*q1^4+2*q*q1^3*q2+q*q1^2*q2^2-q1^3*q2-q1^2*q2^2+q1*q2^3+q2^4)/(q^3*q1^4+q^2*q1^3*q2+q*q1*q2^3+q2^4))*B[(1, 0, -1)] @@ -602,17 +599,17 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): ((q^3*q1^7+q^3*q1^6*q2-q*q1*q2^6-q*q2^7)/(q^3*q1^7-q^2*q1^5*q2^2+q*q1^2*q2^5-q2^7))*B[(0, 0, 0)] + B[(1, -1, 0)] + ((q*q1^5*q2^2+q*q1^4*q2^3-q1*q2^6-q2^7)/(q^3*q1^7-q^2*q1^5*q2^2+q*q1^2*q2^5-q2^7))*B[(1, 1, 0)] - + ((-q1*q2-q2^2)/(q*q1^2-q2^2))*B[(1, 0, -1)] + - ((q1*q2+q2^2)/(q*q1^2-q2^2))*B[(1, 0, -1)] + ((q1*q2+q2^2)/(-q*q1^2+q2^2))*B[(1, 0, 1)] sage: E[omega[3]] - ((-q1*q2^2-q2^3)/(-q*q1^3-q2^3))*B[(1, 0, 0)] - + ((-q1*q2^2-q2^3)/(-q*q1^3-q2^3))*B[(0, 1, 0)] + B[(0, 0, 1)] + -((q1*q2^2+q2^3)/(-q*q1^3-q2^3))*B[(1, 0, 0)] + - ((q1*q2^2+q2^3)/(-q*q1^3-q2^3))*B[(0, 1, 0)] + B[(0, 0, 1)] sage: E[-omega[3]] ((q*q1^4*q2+q*q1^3*q2^2-q1*q2^4-q2^5)/(-q^2*q1^5-q2^5))*B[(1, 0, 0)] + ((q*q1^4*q2+q*q1^3*q2^2-q1*q2^4-q2^5)/(-q^2*q1^5-q2^5))*B[(0, 1, 0)] - + B[(0, 0, -1)] + ((-q1*q2^4-q2^5)/(-q^2*q1^5-q2^5))*B[(0, 0, 1)] + + B[(0, 0, -1)] - ((q1*q2^4+q2^5)/(-q^2*q1^5-q2^5))*B[(0, 0, 1)] .. RUBRIC:: Comparison with the energy function of crystals @@ -776,18 +773,18 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: omega = L0.fundamental_weights() sage: E[omega[1]] - ((-q*t^4+q*t^2)/(-q*t^6+1))*B[(0, 0)] + B[(1, 0)] + -((q*t^4-q*t^2)/(-q*t^6+1))*B[(0, 0)] + B[(1, 0)] sage: E[omega[2]] B[(1/2, 1/2)] sage: E[-omega[1]] - ((-q^2*t^8+q^2*t^6-q*t^6+2*q*t^4-q*t^2+t^2-1)/(-q^3*t^8+q^2*t^6+q*t^2-1))*B[(0, 0)] - + B[(-1, 0)] + ((-q*t^8+q*t^6+t^2-1)/(-q^3*t^8+q^2*t^6+q*t^2-1))*B[(1, 0)] - + ((-t^2+1)/(-q*t^2+1))*B[(0, -1)] + ((t^2-1)/(q*t^2-1))*B[(0, 1)] + -((q^2*t^8-q^2*t^6+q*t^6-2*q*t^4+q*t^2-t^2+1)/(-q^3*t^8+q^2*t^6+q*t^2-1))*B[(0, 0)] + + B[(-1, 0)] - ((q*t^8-q*t^6-t^2+1)/(-q^3*t^8+q^2*t^6+q*t^2-1))*B[(1, 0)] + - ((t^2-1)/(-q*t^2+1))*B[(0, -1)] + ((t^2-1)/(q*t^2-1))*B[(0, 1)] sage: E[L0([0,1])] - ((-q*t^4+q*t^2)/(-q*t^4+1))*B[(0, 0)] + ((-t^2+1)/(-q*t^4+1))*B[(1, 0)] + B[(0, 1)] + -((q*t^4-q*t^2)/(-q*t^4+1))*B[(0, 0)] - ((t^2-1)/(-q*t^4+1))*B[(1, 0)] + B[(0, 1)] sage: E[L0([1,1])] - ((q*t^2-q)/(q*t^2-1))*B[(0, 0)] + ((-q*t^2+q)/(-q*t^2+1))*B[(1, 0)] - + B[(1, 1)] + ((-q*t^2+q)/(-q*t^2+1))*B[(0, 1)] + ((q*t^2-q)/(q*t^2-1))*B[(0, 0)] - ((q*t^2-q)/(-q*t^2+1))*B[(1, 0)] + + B[(1, 1)] - ((q*t^2-q)/(-q*t^2+1))*B[(0, 1)] sage: E = NonSymmetricMacdonaldPolynomials(["A",2,1], q=q,q1=t,q2=-1/t) sage: L0 = E.keys() @@ -809,7 +806,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E._T_Y[0] ( KL0.monomial(L0.zero()) ) t*B[(0)] sage: E._T_Y[0] ( KL0.monomial(-e[0])) - ((-t^2+1)/(q*t))*B[(0)] + 1/(q^2*t)*B[(1)] + -((t^2-1)/(q*t))*B[(0)] + 1/(q^2*t)*B[(1)] sage: Y = E.Y() sage: alphacheck = Y.keys().simple_roots() @@ -856,20 +853,21 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E[0*omega[1]] B[(0, 0)] sage: E[omega[1]] - ((-q*q1*q2^3-q*q2^4)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] + -((q*q1*q2^3+q*q2^4)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] sage: E[2*omega[2]] # not checked against Bogdan's notes, but a good self-consistency test # long time - ((-q^12*q1^6-q^12*q1^5*q2+2*q^10*q1^5*q2+5*q^10*q1^4*q2^2+3*q^10*q1^3*q2^3+2*q^8*q1^5*q2+4*q^8*q1^4*q2^2+q^8*q1^3*q2^3-q^8*q1^2*q2^4+q^8*q1*q2^5+q^8*q2^6-q^6*q1^3*q2^3+q^6*q1^2*q2^4+4*q^6*q1*q2^5+2*q^6*q2^6+q^4*q1^3*q2^3+3*q^4*q1^2*q2^4+4*q^4*q1*q2^5+2*q^4*q2^6)/(-q^12*q1^6-q^10*q1^5*q2-q^8*q1^3*q2^3+q^6*q1^4*q2^2-q^6*q1^2*q2^4+q^4*q1^3*q2^3+q^2*q1*q2^5+q2^6))*B[(0, 0)] + -((q^12*q1^6+q^12*q1^5*q2-2*q^10*q1^5*q2-5*q^10*q1^4*q2^2-3*q^10*q1^3*q2^3-2*q^8*q1^5*q2-4*q^8*q1^4*q2^2-q^8*q1^3*q2^3+q^8*q1^2*q2^4-q^8*q1*q2^5-q^8*q2^6+q^6*q1^3*q2^3-q^6*q1^2*q2^4-4*q^6*q1*q2^5-2*q^6*q2^6-q^4*q1^3*q2^3-3*q^4*q1^2*q2^4-4*q^4*q1*q2^5-2*q^4*q2^6)/(-q^12*q1^6-q^10*q1^5*q2-q^8*q1^3*q2^3+q^6*q1^4*q2^2-q^6*q1^2*q2^4+q^4*q1^3*q2^3+q^2*q1*q2^5+q2^6))*B[(0, 0)] + ((q^7*q1^2*q2+2*q^7*q1*q2^2+q^7*q2^3+q^5*q1^2*q2+2*q^5*q1*q2^2+q^5*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(-1, 0)] - + ((-q^6*q1*q2-q^6*q2^2)/(q^6*q1^2-q2^2))*B[(-1, -1)] + - ((q^6*q1*q2+q^6*q2^2)/(q^6*q1^2-q2^2))*B[(-1, -1)] + ((q^6*q1^2*q2+2*q^6*q1*q2^2+q^6*q2^3+q^4*q1^2*q2+2*q^4*q1*q2^2+q^4*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(-1, 1)] - + ((-q^3*q1*q2-q^3*q2^2)/(q^6*q1^2-q2^2))*B[(-1, 2)] - + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, 0)] + ((q^6*q1^2*q2+2*q^6*q1*q2^2+q^6*q2^3+q^4*q1^2*q2+2*q^4*q1*q2^2+q^4*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(1, -1)] + - ((q^3*q1*q2+q^3*q2^2)/(q^6*q1^2-q2^2))*B[(-1, 2)] + + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, 0)] + + ((q^6*q1^2*q2+2*q^6*q1*q2^2+q^6*q2^3+q^4*q1^2*q2+2*q^4*q1*q2^2+q^4*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(1, -1)] + ((q^8*q1^3+q^8*q1^2*q2+q^6*q1^3+q^6*q1^2*q2-q^6*q1*q2^2-q^6*q2^3-2*q^4*q1^2*q2-4*q^4*q1*q2^2-2*q^4*q2^3-q^2*q1^2*q2-3*q^2*q1*q2^2-2*q^2*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(1, 1)] + ((q^5*q1^2+q^5*q1*q2-q^3*q1*q2-q^3*q2^2-q*q1*q2-q*q2^2)/(q^6*q1^2-q2^2))*B[(1, 2)] - + ((-q^6*q1^2-q^6*q1*q2+q^4*q1*q2+q^4*q2^2+q^2*q1*q2+q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 0)] - + ((-q^3*q1*q2-q^3*q2^2)/(q^6*q1^2-q2^2))*B[(2, -1)] - + ((-q^5*q1^2-q^5*q1*q2+q^3*q1*q2+q^3*q2^2+q*q1*q2+q*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 1)] + - ((q^6*q1^2+q^6*q1*q2-q^4*q1*q2-q^4*q2^2-q^2*q1*q2-q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 0)] + - ((q^3*q1*q2+q^3*q2^2)/(q^6*q1^2-q2^2))*B[(2, -1)] + - ((q^5*q1^2+q^5*q1*q2-q^3*q1*q2-q^3*q2^2-q*q1*q2-q*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 1)] + B[(2, 2)] + ((q^7*q1^2*q2+2*q^7*q1*q2^2+q^7*q2^3+q^5*q1^2*q2+2*q^5*q1*q2^2+q^5*q2^3)/(-q^8*q1^3-q^6*q1^2*q2+q^2*q1*q2^2+q2^3))*B[(0, -1)] + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(0, 1)] @@ -891,11 +889,11 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: Ye1(KL0.one()) q1^2/q2^2*B[(0, 0)] sage: Ye2(KL0.one()) - ((-q1)/q2)*B[(0, 0)] + -q1/q2*B[(0, 0)] sage: Yalpha0(KL0.one()) q2^2/(q*q1^2)*B[(0, 0)] sage: Yalpha1(KL0.one()) - ((-q1)/q2)*B[(0, 0)] + -q1/q2*B[(0, 0)] sage: Yalpha2(KL0.one()) q1^2/q2^2*B[(0, 0)] @@ -952,11 +950,11 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: T0check_on_basis.j # what to match it with? 2 sage: T0check_on_basis(KL0.basis().keys().zero()) - ((-q1^2)/q2)*B[(1, 0)] + -q1^2/q2*B[(1, 0)] sage: T0check = E._T[0] sage: T0check(KL0.one()) - ((-q1^2)/q2)*B[(1, 0)] + -q1^2/q2*B[(1, 0)] Systematic tests of nonsymmetric Macdonald polynomials in type @@ -983,24 +981,24 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E.eigenvalues(_) [t, 1/(q*t)] sage: E[2*omega[1]] - ((-q*t+q)/(-q*t+1))*B[0] + B[2*Lambda[1]] + -((q*t-q)/(-q*t+1))*B[0] + B[2*Lambda[1]] sage: E.eigenvalues(_) [q*t, 1/(q^2*t)] sage: E[3*omega[1]] - ((-q^2*t+q^2)/(-q^2*t+1))*B[-Lambda[1]] - + ((-q^2*t+q^2-q*t+q)/(-q^2*t+1))*B[Lambda[1]] + B[3*Lambda[1]] + -((q^2*t-q^2)/(-q^2*t+1))*B[-Lambda[1]] + - ((q^2*t-q^2+q*t-q)/(-q^2*t+1))*B[Lambda[1]] + B[3*Lambda[1]] sage: E.eigenvalues(_) [q^2*t, 1/(q^3*t)] sage: E[4*omega[1]] ((q^5*t^2-q^5*t+q^4*t^2-2*q^4*t+q^3*t^2+q^4-2*q^3*t+q^3-q^2*t+q^2)/(q^5*t^2-q^3*t-q^2*t+1))*B[0] - + ((-q^3*t+q^3)/(-q^3*t+1))*B[-2*Lambda[1]] - + ((-q^3*t+q^3-q^2*t+q^2-q*t+q)/(-q^3*t+1))*B[2*Lambda[1]] + - ((q^3*t-q^3)/(-q^3*t+1))*B[-2*Lambda[1]] + - ((q^3*t-q^3+q^2*t-q^2+q*t-q)/(-q^3*t+1))*B[2*Lambda[1]] + B[4*Lambda[1]] sage: E.eigenvalues(_) [q^3*t, 1/(q^4*t)] sage: E[6*omega[1]] - ((-q^12*t^3+q^12*t^2-q^11*t^3+2*q^11*t^2-2*q^10*t^3-q^11*t+4*q^10*t^2-2*q^9*t^3-2*q^10*t+5*q^9*t^2-2*q^8*t^3-4*q^9*t+6*q^8*t^2-q^7*t^3+q^9-5*q^8*t+5*q^7*t^2-q^6*t^3+q^8-6*q^7*t+4*q^6*t^2+2*q^7-5*q^6*t+2*q^5*t^2+2*q^6-4*q^5*t+q^4*t^2+2*q^5-2*q^4*t+q^4-q^3*t+q^3)/(-q^12*t^3+q^9*t^2+q^8*t^2+q^7*t^2-q^5*t-q^4*t-q^3*t+1))*B[0] - + ((-q^5*t+q^5)/(-q^5*t+1))*B[-4*Lambda[1]] + -((q^12*t^3-q^12*t^2+q^11*t^3-2*q^11*t^2+2*q^10*t^3+q^11*t-4*q^10*t^2+2*q^9*t^3+2*q^10*t-5*q^9*t^2+2*q^8*t^3+4*q^9*t-6*q^8*t^2+q^7*t^3-q^9+5*q^8*t-5*q^7*t^2+q^6*t^3-q^8+6*q^7*t-4*q^6*t^2-2*q^7+5*q^6*t-2*q^5*t^2-2*q^6+4*q^5*t-q^4*t^2-2*q^5+2*q^4*t-q^4+q^3*t-q^3)/(-q^12*t^3+q^9*t^2+q^8*t^2+q^7*t^2-q^5*t-q^4*t-q^3*t+1))*B[0] + - ((q^5*t-q^5)/(-q^5*t+1))*B[-4*Lambda[1]] + ((q^9*t^2-q^9*t+q^8*t^2-2*q^8*t+q^7*t^2+q^8-2*q^7*t+q^6*t^2+q^7-2*q^6*t+q^5*t^2+q^6-2*q^5*t+q^5-q^4*t+q^4)/(q^9*t^2-q^5*t-q^4*t+1))*B[-2*Lambda[1]] + ((q^9*t^2-q^9*t+q^8*t^2-2*q^8*t+2*q^7*t^2+q^8-3*q^7*t+2*q^6*t^2+q^7-4*q^6*t+2*q^5*t^2+2*q^6-4*q^5*t+q^4*t^2+2*q^5-3*q^4*t+q^3*t^2+2*q^4-2*q^3*t+q^3-q^2*t+q^2)/(q^9*t^2-q^5*t-q^4*t+1))*B[2*Lambda[1]] + ((q^5*t-q^5+q^4*t-q^4+q^3*t-q^3+q^2*t-q^2+q*t-q)/(q^5*t-1))*B[4*Lambda[1]] @@ -1008,7 +1006,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E.eigenvalues(_) [q^5*t, 1/(q^6*t)] sage: E[-omega[1]] - B[-Lambda[1]] + ((-t+1)/(-q*t+1))*B[Lambda[1]] + B[-Lambda[1]] - ((t-1)/(-q*t+1))*B[Lambda[1]] sage: E.eigenvalues(_) [(-1)/(-q^2*t), q*t] @@ -1070,7 +1068,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: L0 = E.keys() sage: omega = L0.fundamental_weights() sage: E[2*omega[2]] - ((-q*q1-q*q2)/(-q*q1-q2))*B[(1, 2, 1)] + ((-q*q1-q*q2)/(-q*q1-q2))*B[(2, 1, 1)] + B[(2, 2, 0)] + -((q*q1+q*q2)/(-q*q1-q2))*B[(1, 2, 1)] - ((q*q1+q*q2)/(-q*q1-q2))*B[(2, 1, 1)] + B[(2, 2, 0)] sage: for d in range(4): # long time (9s) ....: for weight in IntegerVectors(d,3).map(list).map(L0): ....: eigenvalues = E.eigenvalues(E[L0(weight)]) @@ -1093,35 +1091,35 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): [t, 1/(q*t^3), t] sage: E[-omega[1]] # consistent with before refactoring - B[(-1, 0)] + ((-t+1)/(-q*t+1))*B[(1, 0)] - + ((-t+1)/(-q*t+1))*B[(0, -1)] + ((t-1)/(q*t-1))*B[(0, 1)] + B[(-1, 0)] - ((t-1)/(-q*t+1))*B[(1, 0)] - ((t-1)/(-q*t+1))*B[(0, -1)] + + ((t-1)/(q*t-1))*B[(0, 1)] sage: E.eigenvalues(_) # not checked [(-1)/(-q^2*t^3), q*t, t] sage: E[-omega[1]+omega[2]] # consistent with before refactoring - ((-t+1)/(-q*t^3+1))*B[(1, 0)] + B[(0, 1)] + -((t-1)/(-q*t^3+1))*B[(1, 0)] + B[(0, 1)] sage: E.eigenvalues(_) # not checked [t, q*t^3, (-1)/(-q*t^2)] sage: E[omega[1]-omega[2]] # consistent with before refactoring - ((-t+1)/(-q*t^2+1))*B[(1, 0)] + B[(0, -1)] + ((-t+1)/(-q*t^2+1))*B[(0, 1)] + -((t-1)/(-q*t^2+1))*B[(1, 0)] + B[(0, -1)] - ((t-1)/(-q*t^2+1))*B[(0, 1)] sage: E.eigenvalues(_) # not checked [1/(q^2*t^3), 1/(q*t), q*t^2] sage: E[-omega[2]] - ((-q^2*t^4+q^2*t^3-q*t^3+2*q*t^2-q*t+t-1)/(-q^3*t^4+q^2*t^3+q*t-1))*B[(0, 0)] - + B[(-1, -1)] + ((-t+1)/(-q*t+1))*B[(-1, 1)] + ((t-1)/(q*t-1))*B[(1, -1)] - + ((-q*t^4+q*t^3+t-1)/(-q^3*t^4+q^2*t^3+q*t-1))*B[(1, 1)] + -((q^2*t^4-q^2*t^3+q*t^3-2*q*t^2+q*t-t+1)/(-q^3*t^4+q^2*t^3+q*t-1))*B[(0, 0)] + + B[(-1, -1)] - ((t-1)/(-q*t+1))*B[(-1, 1)] + ((t-1)/(q*t-1))*B[(1, -1)] + - ((q*t^4-q*t^3-t+1)/(-q^3*t^4+q^2*t^3+q*t-1))*B[(1, 1)] sage: E.eigenvalues(_) # not checked # long time (1s) [1/(q^3*t^3), t, q*t] sage: E[-omega[2]].map_coefficients(lambda c: c.subs(t=0)) # checking against crystals B[(0, 0)] + B[(-1, -1)] + B[(-1, 1)] + B[(1, -1)] + B[(1, 1)] sage: E[2*omega[2]] - ((-q^6*t^7+q^6*t^6-q^5*t^6+2*q^5*t^5-q^4*t^5-q^5*t^3+3*q^4*t^4-3*q^4*t^3+q^3*t^4+q^4*t^2-2*q^3*t^2+q^3*t-q^2*t+q^2)/(-q^6*t^7+q^5*t^6+q^4*t^4+q^3*t^4-q^3*t^3-q^2*t^3-q*t+1))*B[(0, 0)] - + ((-q^3*t^2+q^3*t)/(-q^3*t^3+1))*B[(-1, -1)] - + ((-q^3*t^3+2*q^3*t^2-q^3*t)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(-1, 1)] - + ((-q^3*t^3+2*q^3*t^2-q^3*t)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(1, -1)] - + ((-q^4*t^4+q^4*t^3-q^3*t^3+2*q^3*t^2-q^2*t^3-q^3*t+2*q^2*t^2-q^2*t+q*t-q)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(1, 1)] - + ((q*t-q)/(q*t-1))*B[(2, 0)] + B[(2, 2)] + ((-q*t+q)/(-q*t+1))*B[(0, 2)] + -((q^6*t^7-q^6*t^6+q^5*t^6-2*q^5*t^5+q^4*t^5+q^5*t^3-3*q^4*t^4+3*q^4*t^3-q^3*t^4-q^4*t^2+2*q^3*t^2-q^3*t+q^2*t-q^2)/(-q^6*t^7+q^5*t^6+q^4*t^4+q^3*t^4-q^3*t^3-q^2*t^3-q*t+1))*B[(0, 0)] + - ((q^3*t^2-q^3*t)/(-q^3*t^3+1))*B[(-1, -1)] + - ((q^3*t^3-2*q^3*t^2+q^3*t)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(-1, 1)] + - ((q^3*t^3-2*q^3*t^2+q^3*t)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(1, -1)] + - ((q^4*t^4-q^4*t^3+q^3*t^3-2*q^3*t^2+q^2*t^3+q^3*t-2*q^2*t^2+q^2*t-q*t+q)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(1, 1)] + + ((q*t-q)/(q*t-1))*B[(2, 0)] + B[(2, 2)] - ((q*t-q)/(-q*t+1))*B[(0, 2)] sage: E.eigenvalues(_) # not checked [q^3*t^3, t, (-1)/(-q^2*t^2)] @@ -1154,22 +1152,22 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E.eigenvalues(_) [1/(q*t^2), t, t] sage: E[omega[1]] - ((-q*t+q)/(-q*t^2+1))*B[(0, 0)] + B[(1, 0)] + -((q*t-q)/(-q*t^2+1))*B[(0, 0)] + B[(1, 0)] sage: E.eigenvalues(_) [q*t^2, 1/(q^2*t^3), t] sage: E[-omega[1]] - ((-q*t+q-t+1)/(-q^2*t+1))*B[(0, 0)] + B[(-1, 0)] + ((-t+1)/(-q^2*t+1))*B[(1, 0)] - + ((-t+1)/(-q^2*t+1))*B[(0, -1)] + ((t-1)/(q^2*t-1))*B[(0, 1)] + -((q*t-q+t-1)/(-q^2*t+1))*B[(0, 0)] + B[(-1, 0)] - ((t-1)/(-q^2*t+1))*B[(1, 0)] + - ((t-1)/(-q^2*t+1))*B[(0, -1)] + ((t-1)/(q^2*t-1))*B[(0, 1)] sage: E.eigenvalues(_) [(-1)/(-q^3*t^2), q^2*t, t] sage: E[-omega[1]+omega[2]] - B[(-1/2, 1/2)] + ((-t+1)/(-q^2*t^3+1))*B[(1/2, -1/2)] - + ((-q*t^3+q*t^2-t+1)/(-q^2*t^3+1))*B[(1/2, 1/2)] + B[(-1/2, 1/2)] - ((t-1)/(-q^2*t^3+1))*B[(1/2, -1/2)] + - ((q*t^3-q*t^2+t-1)/(-q^2*t^3+1))*B[(1/2, 1/2)] sage: E.eigenvalues(_) [(-1)/(-q^2*t^2), q^2*t^3, (-1)/(-q*t)] sage: E[omega[1]-omega[2]] - B[(1/2, -1/2)] + ((-t+1)/(-q*t^2+1))*B[(1/2, 1/2)] + B[(1/2, -1/2)] - ((t-1)/(-q*t^2+1))*B[(1/2, 1/2)] sage: E.eigenvalues(_) [t, 1/(q^2*t^3), q*t^2] @@ -1234,7 +1232,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): sage: E[0*omega[1]] B[(0, 0)] sage: E[omega[1]] - ((-q^2*q1^3*q2-q^2*q1^2*q2^2)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] + -((q^2*q1^3*q2+q^2*q1^2*q2^2)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] sage: Eomega1 = (KL.one() * (q^2*(-q1/q2)^2*(1-(-q1/q2))) / (1-q^2*(-q1/q2)^4) ....: + KL.monomial(omega[1])) sage: E[omega[1]] == Eomega1 @@ -1272,7 +1270,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): ....: assert Tinv2(T[2](x)) == x and T[2](Tinv2(x)) == x sage: start = E[omega[1]]; start - ((-q^2*q1^3*q2-q^2*q1^2*q2^2)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] + -((q^2*q1^3*q2+q^2*q1^2*q2^2)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] sage: Tinv1(Tinv2(Tinv1(Tinv0(Tinv1(Tinv2(Tinv1(Tinv0(start)))))))) * (q1*q2)^4/q^2 == Y0(start) True sage: Y0(start) == q^2*q1^4/q2^4 * start @@ -1684,8 +1682,8 @@ def __getitem__(self, mu): of the affine weight lattice sage: E[2*omega[2]] # needs sage.libs.gap ((q^2*q1^2+q^2*q1*q2)/(q^2*q1^2-q2^2))*B[(0, 0)] - + ((-q^2*q1^2-q^2*q1*q2)/(-q^2*q1^2+q2^2))*B[(1, 0)] + B[(1, 1)] - + ((-q^2*q1^2-q^2*q1*q2)/(-q^2*q1^2+q2^2))*B[(0, 1)] + - ((q^2*q1^2+q^2*q1*q2)/(-q^2*q1^2+q2^2))*B[(1, 0)] + B[(1, 1)] + - ((q^2*q1^2+q^2*q1*q2)/(-q^2*q1^2+q2^2))*B[(0, 1)] """ muaff = self._L.embed_at_level(mu, 0) if not all(muaff.scalar(coroot) in ZZ for coroot in self._L.simple_coroots()): @@ -1908,14 +1906,44 @@ def symmetric_macdonald_polynomial(self, mu): sage: E = NonSymmetricMacdonaldPolynomials(['C',3,1], q, v, -1/v) sage: om = E.L0().fundamental_weights() sage: E.symmetric_macdonald_polynomial(om[1]+om[2]) - B[(-2, -1, 0)] + B[(-2, 1, 0)] + B[(-2, 0, -1)] + B[(-2, 0, 1)] + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(-1, 0, 0)] + B[(-1, -2, 0)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, -1, -1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, -1, 1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, 1, -1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, 1, 1)] + B[(-1, 2, 0)] + B[(-1, 0, -2)] + B[(-1, 0, 2)] + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(1, 0, 0)] + B[(1, -2, 0)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, -1, -1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, -1, 1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, 1, -1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, 1, 1)] + B[(1, 2, 0)] + B[(1, 0, -2)] + B[(1, 0, 2)] + B[(2, -1, 0)] + B[(2, 1, 0)] + B[(2, 0, -1)] + B[(2, 0, 1)] + B[(0, -2, -1)] + B[(0, -2, 1)] + ((-4*q^3*v^14-2*q^2*v^14+2*q^3*v^12-2*q^2*v^12+2*q^3*v^10-q*v^12+5*q^2*v^10+5*q*v^4-q^2*v^2+2*v^4-2*q*v^2+2*v^2-2*q-4)/(-q^3*v^14+q^2*v^10+q*v^4-1))*B[(0, -1, 0)] + B[(0, -1, -2)] + B[(0, -1, 2)] + ((-4*q^3*v^14-2*q^2*v^14+2*q^3*v^12-2*q^2*v^12+2*q^3*v^10-q*v^12+5*q^2*v^10+5*q*v^4-q^2*v^2+2*v^4-2*q*v^2+2*v^2-2*q-4)/(-q^3*v^14+q^2*v^10+q*v^4-1))*B[(0, 1, 0)] + B[(0, 1, -2)] + B[(0, 1, 2)] + B[(0, 2, -1)] + B[(0, 2, 1)] + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(0, 0, -1)] + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(0, 0, 1)] + B[(-2, -1, 0)] + B[(-2, 1, 0)] + B[(-2, 0, -1)] + B[(-2, 0, 1)] + + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(-1, 0, 0)] + + B[(-1, -2, 0)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, -1, -1)] + + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, -1, 1)] + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, 1, -1)] + + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(-1, 1, 1)] + B[(-1, 2, 0)] + B[(-1, 0, -2)] + B[(-1, 0, 2)] + + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(1, 0, 0)] + B[(1, -2, 0)] + + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, -1, -1)] + + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, -1, 1)] + + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, 1, -1)] + + ((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, 1, 1)] + B[(1, 2, 0)] + B[(1, 0, -2)] + B[(1, 0, 2)] + + B[(2, -1, 0)] + B[(2, 1, 0)] + B[(2, 0, -1)] + B[(2, 0, 1)] + B[(0, -2, -1)] + B[(0, -2, 1)] + - ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(-q^3*v^14+q^2*v^10+q*v^4-1))*B[(0, -1, 0)] + + B[(0, -1, -2)] + + B[(0, -1, 2)] + - ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(-q^3*v^14+q^2*v^10+q*v^4-1))*B[(0, 1, 0)] + + B[(0, 1, -2)] + B[(0, 1, 2)] + B[(0, 2, -1)] + B[(0, 2, 1)] + + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(0, 0, -1)] + + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(0, 0, 1)] An example for type `G`:: sage: E = NonSymmetricMacdonaldPolynomials(['G',2,1], q, v, -1/v) sage: om = E.L0().fundamental_weights() sage: E.symmetric_macdonald_polynomial(2*om[1]) - ((3*q^6*v^22+3*q^5*v^22-3*q^6*v^20+q^4*v^22-4*q^5*v^20+q^4*v^18-q^5*v^16+q^3*v^18-2*q^4*v^16+q^5*v^14-q^3*v^16+q^4*v^14-4*q^4*v^12+q^2*v^14+q^5*v^10-8*q^3*v^12+4*q^4*v^10-4*q^2*v^12+8*q^3*v^10-q*v^12-q^4*v^8+4*q^2*v^10-q^2*v^8+q^3*v^6-q*v^8+2*q^2*v^6-q^3*v^4+q*v^6-q^2*v^4+4*q*v^2-q^2+3*v^2-3*q-3)/(q^6*v^22-q^5*v^20-q^4*v^12-q^3*v^12+q^3*v^10+q^2*v^10+q*v^2-1))*B[(0, 0, 0)] + ((q*v^2+v^2-q-1)/(q*v^2-1))*B[(-2, 1, 1)] + B[(-2, 2, 0)] + B[(-2, 0, 2)] + ((-q*v^2-v^2+q+1)/(-q*v^2+1))*B[(-1, -1, 2)] + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(-1, 1, 0)] + ((-q*v^2-v^2+q+1)/(-q*v^2+1))*B[(-1, 2, -1)] + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(-1, 0, 1)] + ((-q*v^2-v^2+q+1)/(-q*v^2+1))*B[(1, -2, 1)] + ((-2*q^4*v^12-2*q^3*v^12+2*q^4*v^10+2*q^3*v^10-q^2*v^8+q^3*v^6-q*v^8+2*q^2*v^6-q^3*v^4+q*v^6-q^2*v^4+2*q*v^2+2*v^2-2*q-2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(1, -1, 0)] + ((-q*v^2-v^2+q+1)/(-q*v^2+1))*B[(1, 1, -2)] + ((-2*q^4*v^12-2*q^3*v^12+2*q^4*v^10+2*q^3*v^10-q^2*v^8+q^3*v^6-q*v^8+2*q^2*v^6-q^3*v^4+q*v^6-q^2*v^4+2*q*v^2+2*v^2-2*q-2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(1, 0, -1)] + B[(2, -2, 0)] + ((q*v^2+v^2-q-1)/(q*v^2-1))*B[(2, -1, -1)] + B[(2, 0, -2)] + B[(0, -2, 2)] + ((-2*q^4*v^12-2*q^3*v^12+2*q^4*v^10+2*q^3*v^10-q^2*v^8+q^3*v^6-q*v^8+2*q^2*v^6-q^3*v^4+q*v^6-q^2*v^4+2*q*v^2+2*v^2-2*q-2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(0, -1, 1)] + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(0, 1, -1)] + B[(0, 2, -2)] + ((3*q^6*v^22+3*q^5*v^22-3*q^6*v^20+q^4*v^22-4*q^5*v^20+q^4*v^18-q^5*v^16+q^3*v^18-2*q^4*v^16+q^5*v^14-q^3*v^16+q^4*v^14-4*q^4*v^12+q^2*v^14+q^5*v^10-8*q^3*v^12+4*q^4*v^10-4*q^2*v^12+8*q^3*v^10-q*v^12-q^4*v^8+4*q^2*v^10-q^2*v^8+q^3*v^6-q*v^8+2*q^2*v^6-q^3*v^4+q*v^6-q^2*v^4+4*q*v^2-q^2+3*v^2-3*q-3)/(q^6*v^22-q^5*v^20-q^4*v^12-q^3*v^12+q^3*v^10+q^2*v^10+q*v^2-1))*B[(0, 0, 0)] + + ((q*v^2+v^2-q-1)/(q*v^2-1))*B[(-2, 1, 1)] + B[(-2, 2, 0)] + B[(-2, 0, 2)] + - ((q*v^2+v^2-q-1)/(-q*v^2+1))*B[(-1, -1, 2)] + + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(-1, 1, 0)] + - ((q*v^2+v^2-q-1)/(-q*v^2+1))*B[(-1, 2, -1)] + + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(-1, 0, 1)] + - ((q*v^2+v^2-q-1)/(-q*v^2+1))*B[(1, -2, 1)] + - ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(1, -1, 0)] + - ((q*v^2+v^2-q-1)/(-q*v^2+1))*B[(1, 1, -2)] + - ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(1, 0, -1)] + + B[(2, -2, 0)] + ((q*v^2+v^2-q-1)/(q*v^2-1))*B[(2, -1, -1)] + B[(2, 0, -2)] + B[(0, -2, 2)] + - ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(0, -1, 1)] + + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(0, 1, -1)] + + B[(0, 2, -2)] """ if self.cartan_type().classical() != mu.parent().cartan_type() or not mu.is_dominant(): raise ValueError("%s must be a dominant weight for the classical subrootsystem of %s" % (mu, self.cartan_type())) diff --git a/src/sage/combinat/root_system/root_lattice_realization_algebras.py b/src/sage/combinat/root_system/root_lattice_realization_algebras.py index 970f134ba90..b93504cf82e 100644 --- a/src/sage/combinat/root_system/root_lattice_realization_algebras.py +++ b/src/sage/combinat/root_system/root_lattice_realization_algebras.py @@ -349,7 +349,7 @@ def demazure_lusztig_operator_on_basis(self, weight, i, q1, q2, convention='anti sage: KL.demazure_lusztig_operator_on_basis(L((3,0)), 1, q1, q2) (q1+q2)*B[(1, 2)] + (q1+q2)*B[(2, 1)] + (q1+q2)*B[(3, 0)] + q1*B[(0, 3)] sage: KL.demazure_lusztig_operator_on_basis(L((0,3)), 1, q1, q2) - (-q1-q2)*B[(1, 2)] + (-q1-q2)*B[(2, 1)] + (-q2)*B[(3, 0)] + -(q1+q2)*B[(1, 2)] - (q1+q2)*B[(2, 1)] - q2*B[(3, 0)] At `q_1=1` and `q_2=0` we recover the action of the isobaric divided differences `\pi_i`:: @@ -455,14 +455,14 @@ def demazure_lusztig_operators(self, q1, q2, convention='antidominant'): sage: T[1](x) (q1+q2)*B[(1, 2)] + (q1+q2)*B[(2, 1)] + (q1+q2)*B[(3, 0)] + q1*B[(0, 3)] sage: Tbar[1](x) - (-q1-q2)*B[(1, 2)] + (-q1-q2)*B[(2, 1)] + (-q1-2*q2)*B[(0, 3)] + -(q1+q2)*B[(1, 2)] - (q1+q2)*B[(2, 1)] - (q1+2*q2)*B[(0, 3)] sage: Tbar[1](x) + T[1](x) - (q1+q2)*B[(3, 0)] + (-2*q2)*B[(0, 3)] + (q1+q2)*B[(3, 0)] - 2*q2*B[(0, 3)] sage: Tdominant[1](x) - (-q1-q2)*B[(1, 2)] + (-q1-q2)*B[(2, 1)] + (-q2)*B[(0, 3)] + -(q1+q2)*B[(1, 2)] - (q1+q2)*B[(2, 1)] - q2*B[(0, 3)] sage: Tdominant.Tw_inverse(1)(KL.monomial(-L.simple_root(1))) - ((-q1-q2)/(q1*q2))*B[(0, 0)] - 1/q2*B[(1, -1)] + -((q1+q2)/(q1*q2))*B[(0, 0)] - 1/q2*B[(1, -1)] We repeat similar computation in the affine setting:: @@ -480,14 +480,13 @@ def demazure_lusztig_operators(self, q1, q2, convention='antidominant'): (q1+q2)*B[e[0] + 2*e[1]] + (q1+q2)*B[2*e[0] + e[1]] + (q1+q2)*B[3*e[0]] + q1*B[3*e[1]] sage: Tbar[1](x) - (-q1-q2)*B[e[0] + 2*e[1]] + (-q1-q2)*B[2*e[0] + e[1]] - + (-q1-2*q2)*B[3*e[1]] + -(q1+q2)*B[e[0] + 2*e[1]] - (q1+q2)*B[2*e[0] + e[1]] - (q1+2*q2)*B[3*e[1]] sage: Tbar[1](x) + T[1](x) - (q1+q2)*B[3*e[0]] + (-2*q2)*B[3*e[1]] + (q1+q2)*B[3*e[0]] - 2*q2*B[3*e[1]] sage: Tdominant[1](x) - (-q1-q2)*B[e[0] + 2*e[1]] + (-q1-q2)*B[2*e[0] + e[1]] + (-q2)*B[3*e[1]] + -(q1+q2)*B[e[0] + 2*e[1]] - (q1+q2)*B[2*e[0] + e[1]] - q2*B[3*e[1]] sage: Tdominant.Tw_inverse(1)(KL.monomial(-L.simple_root(1))) - ((-q1-q2)/(q1*q2))*B[0] - 1/q2*B[e[0] - e[1]] + -((q1+q2)/(q1*q2))*B[0] - 1/q2*B[e[0] - e[1]] One can obtain iterated operators by passing a reduced word or an element of the Weyl group:: @@ -544,19 +543,19 @@ def demazure_lusztig_operators(self, q1, q2, convention='antidominant'): sage: Y[alphacheck[0]](KL.one()) q2^2/q1^2*B[0] sage: Y[alphacheck[1]](x) - ((-q2^2)/(-q1^2))*B[e[0] - e['delta']] + -(q2^2/(-q1^2))*B[e[0] - e['delta']] sage: Y[alphacheck[2]](x) (q1/(-q2))*B[e[0]] sage: KL.q_project(Y[alphacheck[1]](x),q) - ((-q2^2)/(-q*q1^2))*B[(1, 0, 0)] + -(q2^2/(-q*q1^2))*B[(1, 0, 0)] sage: # needs sage.graphs sage: KL.q_project(x, q) B[(1, 0, 0)] sage: KL.q_project(Y[alphacheck[0]](x),q) - ((-q*q1)/q2)*B[(1, 0, 0)] + -q*q1/q2*B[(1, 0, 0)] sage: KL.q_project(Y[alphacheck[1]](x),q) - ((-q2^2)/(-q*q1^2))*B[(1, 0, 0)] + -(q2^2/(-q*q1^2))*B[(1, 0, 0)] sage: KL.q_project(Y[alphacheck[2]](x),q) (q1/(-q2))*B[(1, 0, 0)] @@ -646,7 +645,7 @@ def demazure_lusztig_operator_on_classical_on_basis(self, weight, i, q, q1, q2, q1*B[(2, 2)] sage: KL.demazure_lusztig_operator_on_classical_on_basis(L0((3,0)), # needs sage.graphs ....: 0, q, q1, q2) - (-q^2*q1-q^2*q2)*B[(1, 2)] + (-q*q1-q*q2)*B[(2, 1)] + (-q^3*q2)*B[(0, 3)] + -(q^2*q1+q^2*q2)*B[(1, 2)] - (q*q1+q*q2)*B[(2, 1)] - q^3*q2*B[(0, 3)] """ L = self.basis().keys() weight = L.embed_at_level(weight, 0) @@ -695,7 +694,7 @@ def demazure_lusztig_operators_on_classical(self, q, q1, q2, convention='antidom is mapped to `q`:: sage: T[0](x) # needs sage.graphs - (-q^2*q1-q^2*q2)*B[(1, 2)] + (-q*q1-q*q2)*B[(2, 1)] + (-q^3*q2)*B[(0, 3)] + -(q^2*q1+q^2*q2)*B[(1, 2)] - (q*q1+q*q2)*B[(2, 1)] - q^3*q2*B[(0, 3)] Note that there is no translation part, and in particular 1 is an eigenvector for all `T_i`'s:: @@ -708,7 +707,7 @@ def demazure_lusztig_operators_on_classical(self, q, q1, q2, convention='antidom sage: Y = T.Y() sage: alphacheck = Y.keys().simple_roots() sage: Y[alphacheck[0]](KL0.one()) - ((-q2)/(q*q1))*B[(0, 0)] + -q2/(q*q1)*B[(0, 0)] Matching with Ion Bogdan's hand calculations from 3/15/2013:: @@ -746,7 +745,7 @@ def demazure_lusztig_operators_on_classical(self, q, q1, q2, convention='antidom sage: T0(KL0.monomial(-omega[1])) 1/(q*u)*B[Lambda[1]] sage: T0(KL0.monomial(-2*omega[1])) - ((-u^2+1)/(q*u))*B[0] + 1/(q^2*u)*B[2*Lambda[1]] + -((u^2-1)/(q*u))*B[0] + 1/(q^2*u)*B[2*Lambda[1]] """ # In type BC dual we used q^2 and q elsewhere # Not sure this is the right thing to do or just a workaround ... @@ -992,10 +991,10 @@ def twisted_demazure_lusztig_operator_on_basis(self, weight, i, q1, q2, conventi sage: Lambda = L.classical().fundamental_weights() sage: KL.twisted_demazure_lusztig_operator_on_basis( ....: Lambda[1] + 2*Lambda[2], 1, q1, q2, convention='dominant') - (-q2)*B[(2, 3, 0, 0)] + -q2*B[(2, 3, 0, 0)] sage: KL.twisted_demazure_lusztig_operator_on_basis( ....: Lambda[1] + 2*Lambda[2], 2, q1, q2, convention='dominant') - (-q1-q2)*B[(3, 1, 1, 0)] + (-q2)*B[(3, 0, 2, 0)] + -(q1+q2)*B[(3, 1, 1, 0)] - q2*B[(3, 0, 2, 0)] sage: KL.twisted_demazure_lusztig_operator_on_basis( ....: Lambda[1] + 2*Lambda[2], 3, q1, q2, convention='dominant') q1*B[(3, 2, 0, 0)] @@ -1060,7 +1059,7 @@ def twisted_demazure_lusztig_operators(self, q1, q2, convention='antidominant'): sage: T.Ti_inverse_on_basis(L0.zero(), 1) 1/q1*B[(0, 0)] sage: T.Ti_on_basis(alpha[1], 1) - (-q1-q2)*B[(0, 0)] + (-q2)*B[(-1, 1)] + -(q1+q2)*B[(0, 0)] - q2*B[(-1, 1)] sage: T.Ti_inverse_on_basis(alpha[1], 1) ((q1+q2)/(q1*q2))*B[(0, 0)] + 1/q1*B[(-1, 1)] + ((q1+q2)/(q1*q2))*B[(1, -1)] sage: T.Ti_on_basis(L0.zero(), 0) # needs sage.graphs @@ -1141,7 +1140,7 @@ def twisted_demazure_lusztig_operators(self, q1, q2, convention='antidominant'): sage: def T0c(*l0): return T0_check_on_basis(L0(l0)) sage: T0(0,0,1) # not double checked # needs sage.graphs - ((-t+1)/q)*B[(1, 0, 0)] + 1/q^2*B[(2, 0, -1)] + -((t-1)/q)*B[(1, 0, 0)] + 1/q^2*B[(2, 0, -1)] sage: T0c(0,0,1) # needs sage.graphs (t^2-t)*B[(1, 0, 0)] + (t^2-t)*B[(1, 1, -1)] + t^2*B[(2, 0, -1)] + (t-1)*B[(0, 0, 1)] """ diff --git a/src/sage/combinat/sf/hall_littlewood.py b/src/sage/combinat/sf/hall_littlewood.py index c725d478749..cca78b8dce0 100644 --- a/src/sage/combinat/sf/hall_littlewood.py +++ b/src/sage/combinat/sf/hall_littlewood.py @@ -251,7 +251,7 @@ def P(self): sage: Pz(Qz[2,1]) (z^2-2*z+1)*HLP[2, 1] sage: Qz(Py[2]) - ((-y+z)/(z^3-z^2-z+1))*HLQ[1, 1] + (1/(-z+1))*HLQ[2] + -((y-z)/(z^3-z^2-z+1))*HLQ[1, 1] + (1/(-z+1))*HLQ[2] sage: Qy(Pz[2]) ((y-z)/(y^3-y^2-y+1))*HLQ[1, 1] + (1/(-y+1))*HLQ[2] sage: Qy.hall_littlewood_family() == HLy diff --git a/src/sage/combinat/sf/llt.py b/src/sage/combinat/sf/llt.py index d0a0a040672..5a3c2a0bf15 100644 --- a/src/sage/combinat/sf/llt.py +++ b/src/sage/combinat/sf/llt.py @@ -83,13 +83,13 @@ class LLT_class(UniqueRepresentation): sage: s(HS3t[2,1]) s[2, 1] + t*s[3] sage: HS3x(HS3t[2,1]) - HSp3[2, 1] + (-x+t)*HSp3[3] + HSp3[2, 1] - (x-t)*HSp3[3] sage: s(HS3x(HS3t[2,1])) s[2, 1] + t*s[3] sage: LLT3t2 = Symxt.llt(3,t=2) sage: HC3t2 = LLT3t2.hcospin() sage: HS3x(HC3t2[3,1]) - 2*HSp3[3, 1] + (-2*x+1)*HSp3[4] + 2*HSp3[3, 1] - (2*x-1)*HSp3[4] """ @staticmethod def __classcall__(cls, Sym, k, t='t'): diff --git a/src/sage/combinat/sf/macdonald.py b/src/sage/combinat/sf/macdonald.py index 395906bada4..cd6576cca85 100644 --- a/src/sage/combinat/sf/macdonald.py +++ b/src/sage/combinat/sf/macdonald.py @@ -251,14 +251,14 @@ def P(self): sage: P(Q([2])) ((q*t^2-q*t-t+1)/(q^3-q^2-q+1))*McdP[2] sage: P(Q([2,1])) - ((-q*t^4+2*q*t^3-q*t^2+t^2-2*t+1)/(-q^4*t+2*q^3*t-q^2*t+q^2-2*q+1))*McdP[2, 1] + -((q*t^4-2*q*t^3+q*t^2-t^2+2*t-1)/(-q^4*t+2*q^3*t-q^2*t+q^2-2*q+1))*McdP[2, 1] :: sage: P(J([2])) (q*t^2-q*t-t+1)*McdP[2] sage: P(J([2,1])) - (-q*t^4+2*q*t^3-q*t^2+t^2-2*t+1)*McdP[2, 1] + -(q*t^4-2*q*t^3+q*t^2-t^2+2*t-1)*McdP[2, 1] By transitivity, one get coercions from the classical bases:: @@ -278,13 +278,13 @@ def P(self): sage: P2 = Macyz.P() sage: P3 = Maczx.P() sage: m(P1[2,1]) - ((-2*x*y^2+x*y-y^2+x-y+2)/(-x*y^2+1))*m[1, 1, 1] + m[2, 1] + -((2*x*y^2-x*y+y^2-x+y-2)/(-x*y^2+1))*m[1, 1, 1] + m[2, 1] sage: m(P2[2,1]) - ((-2*y*z^2+y*z-z^2+y-z+2)/(-y*z^2+1))*m[1, 1, 1] + m[2, 1] + -((2*y*z^2-y*z+z^2-y+z-2)/(-y*z^2+1))*m[1, 1, 1] + m[2, 1] sage: m(P1(P2(P3[2,1]))) - ((-2*x^2*z-x^2+x*z-x+z+2)/(-x^2*z+1))*m[1, 1, 1] + m[2, 1] + -((2*x^2*z+x^2-x*z+x-z-2)/(-x^2*z+1))*m[1, 1, 1] + m[2, 1] sage: P1(P2[2]) - ((-x*y^2+2*x*y*z-y^2*z-x+2*y-z)/(x*y^2*z-x*y-y*z+1))*McdP[1, 1] + McdP[2] + -((x*y^2-2*x*y*z+y^2*z+x-2*y+z)/(x*y^2*z-x*y-y*z+1))*McdP[1, 1] + McdP[2] sage: m(z*P1[2]+x*P2[2]) ((x^2*y^2*z+x*y^2*z^2-x^2*y^2+x^2*y*z-x*y*z^2+y^2*z^2-x^2*y-2*x*y*z-y*z^2+x*y-y*z+x+z)/(x*y^2*z-x*y-y*z+1))*m[1, 1] + (x+z)*m[2] """ @@ -405,7 +405,7 @@ def J(self): :: sage: s(J([2])) - (-q*t+t^2+q-t)*s[1, 1] + (q*t^2-q*t-t+1)*s[2] + -(q*t-t^2-q+t)*s[1, 1] + (q*t^2-q*t-t+1)*s[2] sage: J(s([2])) ((q-t)/(q*t^4-q*t^3-q*t^2-t^3+q*t+t^2+t-1))*McdJ[1, 1] + (1/(q*t^2-q*t-t+1))*McdJ[2] """ @@ -483,9 +483,10 @@ def Ht(self): sage: Ht = Sym.macdonald().Ht() sage: s = Sym.schur() sage: Ht(s([2,1])) - (q/(q*t^2-t^3-q^2+q*t))*McdHt[1, 1, 1] + ((-q^2-q*t-t^2)/(q^2*t^2-q^3-t^3+q*t))*McdHt[2, 1] + (t/(-q^3+q^2*t+q*t-t^2))*McdHt[3] + (q/(q*t^2-t^3-q^2+q*t))*McdHt[1, 1, 1] - ((q^2+q*t+t^2)/(q^2*t^2-q^3-t^3+q*t))*McdHt[2, 1] + + (t/(-q^3+q^2*t+q*t-t^2))*McdHt[3] sage: Ht(s([2])) - ((-q)/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2] + -(q/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2] """ return MacdonaldPolynomials_ht(self) @@ -506,10 +507,11 @@ def S(self): sage: Sym = SymmetricFunctions(FractionField(QQ['q','t'])) sage: S = Sym.macdonald().S(); S - Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald S basis + Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t + over Rational Field in the Macdonald S basis sage: p = Sym.power() sage: p(S[2,1]) - ((1/3*t^3-t^2+t-1/3)/(q^3-3*q^2+3*q-1))*p[1, 1, 1] + ((-1/3*t^3+1/3)/(q^3-1))*p[3] + ((1/3*t^3-t^2+t-1/3)/(q^3-3*q^2+3*q-1))*p[1, 1, 1] - ((1/3*t^3-1/3)/(q^3-1))*p[3] sage: J = Sym.macdonald().J() sage: S(J([2])) (q^3-q^2-q+1)*McdS[2] @@ -521,7 +523,7 @@ def S(self): sage: S(J[2]) q*McdS[1, 1] + McdS[2] sage: p(S[2,1]) - (-1/3*t^3+t^2-t+1/3)*p[1, 1, 1] + (1/3*t^3-1/3)*p[3] + -(1/3*t^3-t^2+t-1/3)*p[1, 1, 1] + (1/3*t^3-1/3)*p[3] sage: from sage.combinat.sf.macdonald import qt_kostka sage: qt_kostka([2],[1,1]) @@ -534,9 +536,9 @@ def S(self): sage: S = Sym.macdonald().S() sage: s = Sym.schur() sage: S(s([2])) - ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2] + ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] - ((q^2*t-q*t-q+1)/(-t^3+t^2+t-1))*McdS[2] sage: s(S([1,1])) - ((-q*t^2+q*t+t-1)/(-q^3+q^2+q-1))*s[1, 1] + ((q*t-t^2-q+t)/(-q^3+q^2+q-1))*s[2] + -((q*t^2-q*t-t+1)/(-q^3+q^2+q-1))*s[1, 1] + ((q*t-t^2-q+t)/(-q^3+q^2+q-1))*s[2] """ return MacdonaldPolynomials_s(self) @@ -903,11 +905,11 @@ def product(self, left, right): sage: J([1])^2 #indirect doctest ((q-1)/(q*t-1))*McdJ[1, 1] + ((t-1)/(q*t-1))*McdJ[2] sage: J.product( J[1], J[2] ) - ((-q^2+1)/(-q^2*t+1))*McdJ[2, 1] + ((-t+1)/(-q^2*t+1))*McdJ[3] + -((q^2-1)/(-q^2*t+1))*McdJ[2, 1] - ((t-1)/(-q^2*t+1))*McdJ[3] sage: H.product( H[1], H[2] ) - ((q^2-1)/(q^2*t-1))*McdH[2, 1] + ((-t+1)/(-q^2*t+1))*McdH[3] + ((q^2-1)/(q^2*t-1))*McdH[2, 1] - ((t-1)/(-q^2*t+1))*McdH[3] sage: P.product( P[1], P[2] ) - ((-q^3*t^2+q*t^2+q^2-1)/(-q^3*t^2+q^2*t+q*t-1))*McdP[2, 1] + McdP[3] + -((q^3*t^2-q*t^2-q^2+1)/(-q^3*t^2+q^2*t+q*t-1))*McdP[2, 1] + McdP[3] sage: Q.product(Q[1],Q[2]) McdQ[2, 1] + ((q^2*t-q^2+q*t-q+t-1)/(q^2*t-1))*McdQ[3] sage: Ht.product(Ht[1],Ht[2]) @@ -970,15 +972,15 @@ def nabla(self, q=None, t=None, power=1): ((q^2*t+q*t-t-1)/(q*t-1))*McdP[1, 1] + McdP[2] sage: H = Sym.macdonald().H() sage: H([1,1]).nabla() - t*McdH[1, 1] + (-t^2+1)*McdH[2] + t*McdH[1, 1] - (t^2-1)*McdH[2] sage: H([1,1]).nabla(q=1) - ((t^2+q-t-1)/(q*t-1))*McdH[1, 1] + ((-t^3+t^2+t-1)/(q*t-1))*McdH[2] + ((t^2+q-t-1)/(q*t-1))*McdH[1, 1] - ((t^3-t^2-t+1)/(q*t-1))*McdH[2] sage: H(0).nabla() 0 sage: H([2,2,1]).nabla(t=1/H.t) - ((-q^2)/(-t^4))*McdH[2, 2, 1] + -(q^2/(-t^4))*McdH[2, 2, 1] sage: H([2,2,1]).nabla(t=1/H.t,power=-1) - ((-t^4)/(-q^2))*McdH[2, 2, 1] + -(t^4/(-q^2))*McdH[2, 2, 1] """ parent = self.parent() if (q is None and t is None): @@ -1179,7 +1181,7 @@ def _to_s(self, part): -q*t^4 + 2*q*t^3 - q*t^2 + t^2 - 2*t + 1, q*t^3 - t^4 - q*t^2 + t^3 - q*t + t^2 + q - t] sage: Sym.schur()( J[2,1] ) - (q*t^3-t^4-q*t^2+t^3-q*t+t^2+q-t)*s[1, 1, 1] + (-q*t^4+2*q*t^3-q*t^2+t^2-2*t+1)*s[2, 1] + (q*t^3-t^4-q*t^2+t^3-q*t+t^2+q-t)*s[1, 1, 1] - (q*t^4-2*q*t^3+q*t^2-t^2+2*t-1)*s[2, 1] """ q, t = QQqt.gens() S = self._macdonald.S() @@ -1292,7 +1294,7 @@ def _s_to_self(self, x): McdH[2, 1] sage: H2 = Sym.macdonald(t=0).H() sage: H2(q*s[1, 1, 1] + (q*t+1)*s[2, 1] + t*s[3]) - (-q^2*t+1)*McdH[2, 1] + t*McdH[3] + -(q^2*t-1)*McdH[2, 1] + t*McdH[3] sage: Sym = SymmetricFunctions(FractionField(QQ['x'])) sage: x = Sym.base_ring().gen() @@ -1478,7 +1480,7 @@ def _s_to_self( self, x ): sage: s = SymmetricFunctions(FractionField(QQ['q','t'])).s() sage: Ht = s.symmetric_function_ring().macdonald().Ht() sage: Ht._s_to_self(s[2]) - ((-q)/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2] + -(q/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2] """ return self._m_to_self(self._m(x)) @@ -1877,7 +1879,7 @@ def _creation_by_determinant(self, k): sage: S = Sym.macdonald().S() sage: a = S(1) sage: a = a._creation_by_determinant(1); a - (-q+1)*McdS[1] + -(q-1)*McdS[1] sage: a = a._creation_by_determinant(3) sage: Sym.macdonald().J()(a) McdJ[2, 1, 1] @@ -1905,7 +1907,7 @@ def creation(self, k): sage: S = Sym.macdonald().S() sage: a = S(1) sage: a.creation(1) - (-q+1)*McdS[1] + -(q-1)*McdS[1] sage: a.creation(2) (q^2*t-q*t-q+1)*McdS[1, 1] + (q^2-q*t-q+t)*McdS[2] """ diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 60fc4b65c53..92a913a71ec 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -3145,7 +3145,7 @@ def factor(self): sage: R. = QQ[] sage: s = SymmetricFunctions(R.fraction_field()).s() sage: factor((s[3] + x*s[2,1] + 1)*(3*y*s[2] + s[4,1] + x*y)) - (-s[] + (-x)*s[2, 1] - s[3]) * ((-x*y)*s[] + (-3*y)*s[2] - s[4, 1]) + (-s[] - x*s[2, 1] - s[3]) * (-x*y*s[] - 3*y*s[2] - s[4, 1]) TESTS:: @@ -3833,7 +3833,7 @@ def theta_qt(self, q=None, t=None): sage: q,t = QQqt.gens() sage: p = SymmetricFunctions(QQqt).p() sage: p([2]).theta_qt(q,t) - ((-q^2+1)/(-t^2+1))*p[2] + -((q^2-1)/(-t^2+1))*p[2] sage: p([2,1]).theta_qt(q,t) ((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1] sage: p(0).theta_qt(q=1,t=3) @@ -3892,13 +3892,13 @@ def omega_qt(self, q=None, t=None): sage: q,t = QQqt.gens() sage: p = SymmetricFunctions(QQqt).p() sage: p[5].omega_qt() - ((-q^5+1)/(-t^5+1))*p[5] + -((q^5-1)/(-t^5+1))*p[5] sage: p[5].omega_qt(q,t) - ((-q^5+1)/(-t^5+1))*p[5] + -((q^5-1)/(-t^5+1))*p[5] sage: p([2]).omega_qt(q,t) ((q^2-1)/(-t^2+1))*p[2] sage: p([2,1]).omega_qt(q,t) - ((-q^3+q^2+q-1)/(t^3-t^2-t+1))*p[2, 1] + -((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1] sage: p([3,2]).omega_qt(5,q) -(2976/(q^5-q^3-q^2+1))*p[3, 2] sage: p(0).omega_qt() @@ -3911,11 +3911,11 @@ def omega_qt(self, q=None, t=None): sage: H([1,1]).omega_qt(q,t) ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2] sage: H([1,1]).omega_qt(t,q) - ((-t^3+t^2+t-1)/(-q^3+q^2+q-1))*McdH[2] + -((t^3-t^2-t+1)/(-q^3+q^2+q-1))*McdH[2] sage: Sym = SymmetricFunctions(FractionField(QQ['q','t'])) sage: S = Sym.macdonald().S() sage: S([1,1]).omega_qt() - ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2] + ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] - ((q^2*t-q*t-q+1)/(-t^3+t^2+t-1))*McdS[2] sage: s = Sym.schur() sage: s(S([1,1]).omega_qt()) s[2] @@ -4859,14 +4859,14 @@ def nabla(self, q=None, t=None, power=1): sage: Sym = SymmetricFunctions(FractionField(QQ['q','t'])) sage: p = Sym.power() sage: p([1,1]).nabla() - (-1/2*q*t+1/2*q+1/2*t+1/2)*p[1, 1] + (1/2*q*t-1/2*q-1/2*t+1/2)*p[2] + -(1/2*q*t-1/2*q-1/2*t-1/2)*p[1, 1] + (1/2*q*t-1/2*q-1/2*t+1/2)*p[2] sage: p([2,1]).nabla(q=1) - (-t-1)*p[1, 1, 1] + t*p[2, 1] + -(t+1)*p[1, 1, 1] + t*p[2, 1] sage: p([2]).nabla(q=1)*p([1]).nabla(q=1) - (-t-1)*p[1, 1, 1] + t*p[2, 1] + -(t+1)*p[1, 1, 1] + t*p[2, 1] sage: s = Sym.schur() sage: s([2,1]).nabla() - (-q^3*t-q^2*t^2-q*t^3)*s[1, 1, 1] + (-q^2*t-q*t^2)*s[2, 1] + -(q^3*t+q^2*t^2+q*t^3)*s[1, 1, 1] - (q^2*t+q*t^2)*s[2, 1] sage: s([1,1,1]).nabla() (q^3+q^2*t+q*t^2+t^3+q*t)*s[1, 1, 1] + (q^2+q*t+t^2+q+t)*s[2, 1] + s[3] sage: s([1,1,1]).nabla(t=1) @@ -4876,9 +4876,9 @@ def nabla(self, q=None, t=None, power=1): sage: s(1).nabla() s[] sage: s([2,1]).nabla(power=-1) - ((-q-t)/(q^2*t^2))*s[2, 1] + ((q^2+q*t+t^2)/(-q^3*t^3))*s[3] + -((q+t)/(q^2*t^2))*s[2, 1] + ((q^2+q*t+t^2)/(-q^3*t^3))*s[3] sage: (s([2])+s([3])).nabla() - (-q*t)*s[1, 1] + (q^3*t^2+q^2*t^3)*s[1, 1, 1] + q^2*t^2*s[2, 1] + -q*t*s[1, 1] + (q^3*t^2+q^2*t^3)*s[1, 1, 1] + q^2*t^2*s[2, 1] """ parent = self.parent() BR = parent.base_ring() diff --git a/src/sage/databases/cubic_hecke_db.py b/src/sage/databases/cubic_hecke_db.py index 3c75faf88ca..2614b4720bc 100644 --- a/src/sage/databases/cubic_hecke_db.py +++ b/src/sage/databases/cubic_hecke_db.py @@ -1067,7 +1067,7 @@ def read_braid_image(self, braid_tietze, ring_of_definition): sage: cha_fc.is_empty(CubicHeckeFileCache.section.braid_images) True sage: b2_img = CHA2(b2); b2_img - w*c^-1 + u*c + (-v) + w*c^-1 + u*c - v sage: cha_fc.write_braid_image(b2.Tietze(), b2_img.to_vector()) sage: cha_fc.read_braid_image(b2.Tietze(), ring_of_definition) (-v, u, w) @@ -1102,7 +1102,7 @@ def write_braid_image(self, braid_tietze, braid_image_vect): sage: B2 = BraidGroup(2) sage: b, = B2.gens(); b3 = b**3 sage: b3_img = CHA2(b3); b3_img - u*w*c^-1 + (u^2-v)*c + (-u*v+w) + u*w*c^-1 + (u^2-v)*c - (u*v-w) sage: cha_fc.write_braid_image(b3.Tietze(), b3_img.to_vector()) sage: cha_fc.read_braid_image(b3.Tietze(), ring_of_definition) (-u*v + w, u^2 - v, u*w) diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd index 3980a856368..3b4a2581f85 100644 --- a/src/sage/libs/singular/decl.pxd +++ b/src/sage/libs/singular/decl.pxd @@ -152,6 +152,7 @@ cdef extern from "singular/Singular/libsingular.h": void (*cfNormalize)(number* a, const n_Procs_s* r) bint (*cfDivBy)(number* a, number* b, const n_Procs_s* r) + bint (*cfGreater)(number* a, number* b, const n_Procs_s* ) bint (*cfEqual)(number* a,number* b, const n_Procs_s* ) bint (*cfIsZero)(number* a, const n_Procs_s* ) # algebraic number comparison with zero bint (*cfIsOne)(number* a, const n_Procs_s* ) # algebraic number comparison with one diff --git a/src/sage/libs/singular/polynomial.pyx b/src/sage/libs/singular/polynomial.pyx index a6023aaa2ae..19e3d593279 100644 --- a/src/sage/libs/singular/polynomial.pyx +++ b/src/sage/libs/singular/polynomial.pyx @@ -254,45 +254,62 @@ cdef int singular_polynomial_cmp(poly *p, poly *q, ring *r) noexcept: sage: (2/3*x^2 + 1/2*y + 3) > (2/3*x^2 + 1/4*y + 10) True + + TESTS: + + Ensure that comparison is transitive (as long as ``cfGreater`` is transitive and + consistent with ``cfGreaterZero``, see :issue:`39018` for more details):: + + sage: P. = GF(5)[] + sage: P(1) > P(4) + False + sage: P(4) > P(2) + True + sage: P(2) > P(1) + True + + :: + + sage: R. = Integers(10)[] + sage: l = [i*x+j*y+k for i in range(10) for j in range(10) for k in range(10)] + sage: l.sort() + sage: for i in range(len(l)): + ....: for b in l[:i]: + ....: assert b < l[i], (b, l[i]) + + More tests for :issue:`35681`:: + + sage: P. = ZZ[] + sage: P(0) > P(-1) + True """ cdef number *h - cdef int ret = 0 + cdef int tmp if r != currRing: rChangeCurrRing(r) - # handle special cases first (slight slowdown, as special cases - # are - well - special - if p == NULL: - if q == NULL: - # compare 0, 0 - return 0 - elif p_IsConstant(q,r): - # compare 0, const - return 1-2*r.cf.cfGreaterZero(p_GetCoeff(q,r), r.cf) # -1: <, 1: > # - elif q == NULL: - if p_IsConstant(p,r): - # compare const, 0 - return -1+2*r.cf.cfGreaterZero(p_GetCoeff(p,r), r.cf) # -1: <, 1: > - - while ret==0 and p!=NULL and q!=NULL: - ret = p_Cmp( p, q, r) - - if ret==0: - h = r.cf.cfSub(p_GetCoeff(p, r),p_GetCoeff(q, r),r.cf) - # compare coeffs - ret = -1+r.cf.cfIsZero(h,r.cf)+2*r.cf.cfGreaterZero(h, r.cf) # -1: <, 0:==, 1: > - n_Delete(&h, r.cf) - p = pNext(p) - q = pNext(q) + while True: + if p == NULL: + if q == NULL: + return 0 + return -1 if r.cf.cfGreaterZero(p_GetCoeff(q, r), r.cf) else 1 + elif q == NULL: + return 1 if r.cf.cfGreaterZero(p_GetCoeff(p, r), r.cf) else -1 + + tmp = p_Cmp(p, q, r) + if tmp != 0: + if tmp < 0: + return -1 if r.cf.cfGreaterZero(p_GetCoeff(q, r), r.cf) else 1 + else: + return 1 if r.cf.cfGreaterZero(p_GetCoeff(p, r), r.cf) else -1 - if ret==0: - if p==NULL and q != NULL: - ret = -1 - elif p!=NULL and q==NULL: - ret = 1 + # compare coefficients + if not r.cf.cfEqual(p_GetCoeff(p, r), p_GetCoeff(q, r), r.cf): + return 1 if r.cf.cfGreater(p_GetCoeff(p, r), p_GetCoeff(q, r), r.cf) else -1 - return ret + p = pNext(p) + q = pNext(q) cdef int singular_polynomial_mul(poly** ret, poly *p, poly *q, ring *r) except -1: """ diff --git a/src/sage/rings/invariants/invariant_theory.py b/src/sage/rings/invariants/invariant_theory.py index 300e3e9c2f5..1f31834eac0 100644 --- a/src/sage/rings/invariants/invariant_theory.py +++ b/src/sage/rings/invariants/invariant_theory.py @@ -3850,8 +3850,8 @@ def J_covariant(self): sage: p2 = A0*x^2 + A1*y^2 + A2*z^2 + A3*w^2 sage: q = invariant_theory.quaternary_biquadratic(p1, p2, [w, x, y, z]) sage: q.J_covariant().factor() - z * y * x * w * (a3*A2 - a2*A3) * (a3*A1 - a1*A3) * (-a2*A1 + a1*A2) - * (a3*A0 - a0*A3) * (-a2*A0 + a0*A2) * (-a1*A0 + a0*A1) + z * y * x * w * (-a1*A0 + a0*A1) * (-a2*A0 + a0*A2) * (-a2*A1 + a1*A2) + * (a3*A2 - a2*A3) * (a3*A1 - a1*A3) * (a3*A0 - a0*A3) """ F = self._ring.base_ring() return 1/F(16) * self._jacobian_determinant( diff --git a/src/sage/rings/lazy_series.py b/src/sage/rings/lazy_series.py index 6a4fea857a4..b801c6f1b57 100644 --- a/src/sage/rings/lazy_series.py +++ b/src/sage/rings/lazy_series.py @@ -2435,8 +2435,8 @@ def arctan(self): sage: L. = LazyPowerSeriesRing(QQ) sage: atan(x/(1-y)) - x + x*y + (-1/3*x^3+x*y^2) + (-x^3*y+x*y^3) + (1/5*x^5-2*x^3*y^2+x*y^4) - + (x^5*y-10/3*x^3*y^3+x*y^5) + (-1/7*x^7+3*x^5*y^2-5*x^3*y^4+x*y^6) + O(x,y)^8 + x + x*y - (1/3*x^3-x*y^2) - (x^3*y-x*y^3) + (1/5*x^5-2*x^3*y^2+x*y^4) + + (x^5*y-10/3*x^3*y^3+x*y^5) - (1/7*x^7-3*x^5*y^2+5*x^3*y^4-x*y^6) + O(x,y)^8 TESTS:: @@ -2555,8 +2555,8 @@ def tanh(self): sage: L. = LazyPowerSeriesRing(QQ) sage: tanh(x/(1-y)) # needs sage.libs.flint - x + x*y + (-1/3*x^3+x*y^2) + (-x^3*y+x*y^3) + (2/15*x^5-2*x^3*y^2+x*y^4) - + (2/3*x^5*y-10/3*x^3*y^3+x*y^5) + (-17/315*x^7+2*x^5*y^2-5*x^3*y^4+x*y^6) + O(x,y)^8 + x + x*y - (1/3*x^3-x*y^2) - (x^3*y-x*y^3) + (2/15*x^5-2*x^3*y^2+x*y^4) + + (2/3*x^5*y-10/3*x^3*y^3+x*y^5) - (17/315*x^7-2*x^5*y^2+5*x^3*y^4-x*y^6) + O(x,y)^8 TESTS:: @@ -2618,8 +2618,8 @@ def sech(self): sage: L. = LazyPowerSeriesRing(QQ) sage: sech(x/(1-y)) # needs sage.libs.flint - 1 + (-1/2*x^2) + (-x^2*y) + (5/24*x^4-3/2*x^2*y^2) + (5/6*x^4*y-2*x^2*y^3) - + (-61/720*x^6+25/12*x^4*y^2-5/2*x^2*y^4) + O(x,y)^7 + 1 - 1/2*x^2 - x^2*y + (5/24*x^4-3/2*x^2*y^2) + (5/6*x^4*y-2*x^2*y^3) + - (61/720*x^6-25/12*x^4*y^2+5/2*x^2*y^4) + O(x,y)^7 TESTS:: @@ -2688,8 +2688,8 @@ def arcsinh(self): sage: L. = LazyPowerSeriesRing(QQ) sage: asinh(x/(1-y)) - x + x*y + (-1/6*x^3+x*y^2) + (-1/2*x^3*y+x*y^3) + (3/40*x^5-x^3*y^2+x*y^4) - + (3/8*x^5*y-5/3*x^3*y^3+x*y^5) + (-5/112*x^7+9/8*x^5*y^2-5/2*x^3*y^4+x*y^6) + O(x,y)^8 + x + x*y - (1/6*x^3-x*y^2) - (1/2*x^3*y-x*y^3) + (3/40*x^5-x^3*y^2+x*y^4) + + (3/8*x^5*y-5/3*x^3*y^3+x*y^5) - (5/112*x^7-9/8*x^5*y^2+5/2*x^3*y^4-x*y^6) + O(x,y)^8 TESTS:: @@ -2908,11 +2908,11 @@ def sqrt(self): sage: L. = LazyPowerSeriesRing(QQ) sage: sqrt(1+x/(1-y)) - 1 + 1/2*x + (-1/8*x^2+1/2*x*y) + (1/16*x^3-1/4*x^2*y+1/2*x*y^2) - + (-5/128*x^4+3/16*x^3*y-3/8*x^2*y^2+1/2*x*y^3) - + (7/256*x^5-5/32*x^4*y+3/8*x^3*y^2-1/2*x^2*y^3+1/2*x*y^4) - + (-21/1024*x^6+35/256*x^5*y-25/64*x^4*y^2+5/8*x^3*y^3-5/8*x^2*y^4+1/2*x*y^5) - + O(x,y)^7 + 1 + 1/2*x - (1/8*x^2-1/2*x*y) + (1/16*x^3-1/4*x^2*y+1/2*x*y^2) + - (5/128*x^4-3/16*x^3*y+3/8*x^2*y^2-1/2*x*y^3) + + (7/256*x^5-5/32*x^4*y+3/8*x^3*y^2-1/2*x^2*y^3+1/2*x*y^4) + - (21/1024*x^6-35/256*x^5*y+25/64*x^4*y^2-5/8*x^3*y^3+5/8*x^2*y^4-1/2*x*y^5) + + O(x,y)^7 This also works for Dirichlet series:: @@ -4875,7 +4875,7 @@ class LazyPowerSeries(LazyCauchyProductSeries): sage: L. = LazyPowerSeriesRing(ZZ) sage: f = 1 / (1 - x^2 + y^3); f - 1 + x^2 + (-y^3) + x^4 + (-2*x^2*y^3) + (x^6+y^6) + O(x,y)^7 + 1 + x^2 - y^3 + x^4 - 2*x^2*y^3 + (x^6+y^6) + O(x,y)^7 sage: P. = PowerSeriesRing(ZZ, default_prec=101) sage: g = 1 / (1 - x^2 + y^3); f[100] - g[100] 0 @@ -4884,7 +4884,7 @@ class LazyPowerSeries(LazyCauchyProductSeries): sage: g = loads(dumps(f)) sage: g - 1 + x^2 + (-y^3) + x^4 + (-2*x^2*y^3) + (x^6+y^6) + O(x,y)^7 + 1 + x^2 - y^3 + x^4 - 2*x^2*y^3 + (x^6+y^6) + O(x,y)^7 sage: g == f True """ @@ -5503,14 +5503,14 @@ def derivative(self, *args): sage: f = (1 + x + y^2 + z)^-1 sage: f.derivative(x) - -1 + (2*x+2*z) + (-3*x^2+2*y^2-6*x*z-3*z^2) + ... + O(x,y,z)^6 + -1 + (2*x+2*z) - (3*x^2-2*y^2+6*x*z+3*z^2) + ... + O(x,y,z)^6 sage: f.derivative(y, 2) - -2 + (4*x+4*z) + (-6*x^2+12*y^2-12*x*z-6*z^2) + ... + O(x,y,z)^5 + -2 + (4*x+4*z) - (6*x^2-12*y^2+12*x*z+6*z^2) + ... + O(x,y,z)^5 sage: f.derivative(x, y) - 4*y + (-12*x*y-12*y*z) + (24*x^2*y-12*y^3+48*x*y*z+24*y*z^2) - + (-40*x^3*y+48*x*y^3-120*x^2*y*z+48*y^3*z-120*x*y*z^2-40*y*z^3) + O(x,y,z)^5 + 4*y - (12*x*y+12*y*z) + (24*x^2*y-12*y^3+48*x*y*z+24*y*z^2) + - (40*x^3*y-48*x*y^3+120*x^2*y*z-48*y^3*z+120*x*y*z^2+40*y*z^3) + O(x,y,z)^5 sage: f.derivative(x, y, z) - (-12*y) + (48*x*y+48*y*z) + (-120*x^2*y+48*y^3-240*x*y*z-120*y*z^2) + O(x,y,z)^4 + -12*y + (48*x*y+48*y*z) - (120*x^2*y-48*y^3+240*x*y*z+120*y*z^2) + O(x,y,z)^4 sage: R. = QQ[] sage: L. = LazyPowerSeriesRing(R) @@ -5797,7 +5797,7 @@ def integral(self, variable=None, *, constants=None): sage: L. = LazyPowerSeriesRing(QQ) sage: (x + y - z^2).integral(z) - (x*z+y*z) + (-1/3*z^3) + (x*z+y*z) - 1/3*z^3 TESTS:: @@ -5928,13 +5928,13 @@ def _format_series(self, formatter, format_strings=False): sage: L. = LazyPowerSeriesRing(QQ) sage: f = 1 / (2 - x^2 + y) sage: f._format_series(repr) - '1/2 + (-1/4*y) + (1/4*x^2+1/8*y^2) + (-1/4*x^2*y-1/16*y^3) - + (1/8*x^4+3/16*x^2*y^2+1/32*y^4) + (-3/16*x^4*y-1/8*x^2*y^3-1/64*y^5) + '1/2 - 1/4*y + (1/4*x^2+1/8*y^2) - (1/4*x^2*y+1/16*y^3) + + (1/8*x^4+3/16*x^2*y^2+1/32*y^4) - (3/16*x^4*y+1/8*x^2*y^3+1/64*y^5) + (1/16*x^6+3/16*x^4*y^2+5/64*x^2*y^4+1/128*y^6) + O(x,y)^7' sage: f = (2 - x^2 + y) sage: f._format_series(repr) - '2 + y + (-x^2)' + '2 + y - x^2' """ P = self.parent() cs = self._coeff_stream @@ -6011,7 +6011,7 @@ def polynomial(self, degree=None, names=None): sage: L. = LazyPowerSeriesRing(ZZ) sage: f = x^2 + y*x - x + 2; f - 2 + (-x) + (x^2+x*y) + 2 - x + (x^2+x*y) sage: f.polynomial() x^2 + x*y - x + 2 @@ -6019,7 +6019,7 @@ def polynomial(self, degree=None, names=None): sage: g = 1 / (1 + x + y + x*y) sage: g3 = g.truncate(4); g3 - 1 + (-x-y) + (x^2+x*y+y^2) + (-x^3-x^2*y-x*y^2-y^3) + 1 - (x+y) + (x^2+x*y+y^2) - (x^3+x^2*y+x*y^2+y^3) sage: g.polynomial() Traceback (most recent call last): ... @@ -6628,7 +6628,7 @@ def revert(self): sage: L = LazySymmetricFunctions(p) sage: f = L(a + b*p[1]) sage: f.revert() - (((-a)/b)*p[]) + 1/b*p[1] + (-a/b*p[]) + 1/b*p[1] sage: f = L(2*p[1]) sage: f.revert() 1/2*p[1] diff --git a/src/sage/rings/lazy_series_ring.py b/src/sage/rings/lazy_series_ring.py index 51359391111..17dda1061dd 100644 --- a/src/sage/rings/lazy_series_ring.py +++ b/src/sage/rings/lazy_series_ring.py @@ -2273,9 +2273,9 @@ def _element_constructor_(self, x=None, valuation=None, constant=None, degree=No sage: f.parent() Fraction Field of Multivariate Polynomial Ring in a, b, c over Integer Ring sage: L(f) # needs sage.libs.singular - 1 + (a+b) + (-a*b) + (-a^2*b-a*b^2-c^3) + (a^2*b^2-a*c^3-b*c^3) - + (a^3*b^2+a^2*b^3+2*a*b*c^3) + (-a^3*b^3+2*a^2*b*c^3+2*a*b^2*c^3+c^6) - + O(a,b,c)^7 + 1 + (a+b) - a*b - (a^2*b+a*b^2+c^3) + (a^2*b^2-a*c^3-b*c^3) + + (a^3*b^2+a^2*b^3+2*a*b*c^3) - (a^3*b^3-2*a^2*b*c^3-2*a*b^2*c^3-c^6) + + O(a,b,c)^7 sage: L(f) == (1 + aa + bb) / (1 + aa*bb + cc^3) # needs sage.libs.singular True @@ -2535,11 +2535,9 @@ def some_elements(self): sage: L.some_elements()[:6] [0, 1, q, q + q^2 + q^3, - 1 + q + q^2 + (-q^3) + (-q^4) + (-q^5) + (-q^6) + O(q,t)^7, - 1 + (q+t) + (q^2-q*t+t^2) + (q^3+t^3) - + (q^4+q^3*t+q*t^3+t^4) - + (q^5-q^4*t+q^3*t^2+q^2*t^3-q*t^4+t^5) - + (q^6-q^3*t^3+t^6) + O(q,t)^7] + 1 + q + q^2 - q^3 - q^4 - q^5 - q^6 + O(q,t)^7, + 1 + (q+t) + (q^2-q*t+t^2) + (q^3+t^3) + (q^4+q^3*t+q*t^3+t^4) + + (q^5-q^4*t+q^3*t^2+q^2*t^3-q*t^4+t^5) + (q^6-q^3*t^3+t^6) + O(q,t)^7] """ z = self.gen(0) elts = [self.zero(), self.one(), self.an_element()] @@ -2595,14 +2593,14 @@ def taylor(self, f): sage: L. = LazyPowerSeriesRing(QQ) sage: def f(x, y): return (1 + x) / (1 + y) sage: L.taylor(f) - 1 + (a-b) + (-a*b+b^2) + (a*b^2-b^3) + (-a*b^3+b^4) + (a*b^4-b^5) + (-a*b^5+b^6) + O(a,b)^7 + 1 + (a-b) - (a*b-b^2) + (a*b^2-b^3) - (a*b^3-b^4) + (a*b^4-b^5) - (a*b^5-b^6) + O(a,b)^7 sage: g(w, z) = (1 + w) / (1 + z) sage: L.taylor(g) - 1 + (a-b) + (-a*b+b^2) + (a*b^2-b^3) + (-a*b^3+b^4) + (a*b^4-b^5) + (-a*b^5+b^6) + O(a,b)^7 + 1 + (a-b) - (a*b-b^2) + (a*b^2-b^3) - (a*b^3-b^4) + (a*b^4-b^5) - (a*b^5-b^6) + O(a,b)^7 sage: y = SR.var('y') sage: h = (1 + x) / (1 + y) sage: L.taylor(h) - 1 + (a-b) + (-a*b+b^2) + (a*b^2-b^3) + (-a*b^3+b^4) + (a*b^4-b^5) + (-a*b^5+b^6) + O(a,b)^7 + 1 + (a-b) - (a*b-b^2) + (a*b^2-b^3) - (a*b^3-b^4) + (a*b^4-b^5) - (a*b^5-b^6) + O(a,b)^7 """ try: return f(*self.gens()) diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index 8ac31a6ff67..4692efc0747 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -37,8 +37,8 @@ sage: add_units += [q*ui - uj for ui, uj in I if ui != uj] sage: L = R.localization(tuple(add_units)); L # needs sage.libs.pari Multivariate Polynomial Ring in u0, u1, u2, q over Integer Ring localized at - (q, q + 1, u2, u1, u1 - u2, u0, u0 - u2, u0 - u1, u2*q - u1, u2*q - u0, - u1*q - u2, u1*q - u0, u0*q - u2, u0*q - u1) + (q, q + 1, u2, u1 - u2, u1, u0 - u1, u0 - u2, u0, u2*q - u0, u2*q - u1, u1*q - u0, + u1*q - u2, u0*q - u1, u0*q - u2) Define the representation matrices (of one of the three dimensional irreducible representations):: @@ -82,8 +82,8 @@ sage: f = L.hom((3,5,7,11), codomain=Fp); f Ring morphism: From: Multivariate Polynomial Ring in u0, u1, u2, q over Integer Ring localized at - (q, q + 1, u2, u1, u1 - u2, u0, u0 - u2, u0 - u1, u2*q - u1, u2*q - u0, - u1*q - u2, u1*q - u0, u0*q - u2, u0*q - u1) + (q, q + 1, u2, u1 - u2, u1, u0 - u1, u0 - u2, u0, u2*q - u0, u2*q - u1, + u1*q - u0, u1*q - u2, u0*q - u1, u0*q - u2) To: Finite Field of size 17 Defn: u0 |--> 3 u1 |--> 5 @@ -110,8 +110,8 @@ sage: fQ = L.hom((3,5,7,11), codomain=QQ); fQ Ring morphism: From: Multivariate Polynomial Ring in u0, u1, u2, q over Integer Ring - localized at (q, q + 1, u2, u1, u1 - u2, u0, u0 - u2, u0 - u1, - u2*q - u1, u2*q - u0, u1*q - u2, u1*q - u0, u0*q - u2, u0*q - u1) + localized at (q, q + 1, u2, u1 - u2, u1, u0 - u1, u0 - u2, u0, u2*q - u0, + u2*q - u1, u1*q - u0, u1*q - u2, u0*q - u1, u0*q - u2) To: Rational Field Defn: u0 |--> 3 u1 |--> 5 @@ -141,8 +141,8 @@ sage: fF = L.hom((x, y, z, t), codomain=F); fF Ring morphism: From: Multivariate Polynomial Ring in u0, u1, u2, q over Integer Ring - localized at (q, q + 1, u2, u1, u1 - u2, u0, u0 - u2, u0 - u1, - u2*q - u1, u2*q - u0, u1*q - u2, u1*q - u0, u0*q - u2, u0*q - u1) + localized at (q, q + 1, u2, u1 - u2, u1, u0 - u1, u0 - u2, u0, u2*q - u0, + u2*q - u1, u1*q - u0, u1*q - u2, u0*q - u1, u0*q - u2) To: Fraction Field of Quotient of Multivariate Polynomial Ring in x, y, z, t over Rational Field by the ideal (x + y + z) Defn: u0 |--> -ybar - zbar diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 24239660dec..d8546e31b33 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -1067,31 +1067,28 @@ def triangular_decomposition(self, algorithm=None, singular=None): [Ideal (a - 1, b - 1, c - 1, d^2 + 3*d + 1, e + d + 3) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a - 1, b - 1, c^2 + 3*c + 1, d + c + 3, e - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a - 1, b^2 + 3*b + 1, c + b + 3, d - 1, e - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a - 1, b^4 + b^3 + b^2 + b + 1, -c + b^2, -d + b^3, - e + b^3 + b^2 + b + 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, + Ideal (a - 1, b^4 + b^3 + b^2 + b + 1, -c + b^2, -d + b^3, e + b^3 + b^2 + b + 1) of Multivariate + Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^2 + 3*a + 1, b - 1, c - 1, d - 1, e + a + 3) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^2 + 3*a + 1, b + a + 3, c - 1, d - 1, e - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 - 4*a^3 + 6*a^2 + a + 1, -11*b^2 + 6*b*a^3 - 26*b*a^2 + 41*b*a - 4*b - 8*a^3 + 31*a^2 - 40*a - 24, 11*c + 3*a^3 - 13*a^2 + 26*a - 2, 11*d + 3*a^3 - 13*a^2 + 26*a - 2, -11*e - 11*b + 6*a^3 - 26*a^2 + 41*a - 4) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a^4 + a^3 + a^2 + a + 1, - b - 1, c + a^3 + a^2 + a + 1, -d + a^3, -e + a^2) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a^4 + a^3 + a^2 + a + 1, - b - a, c - a, d^2 + 3*d*a + a^2, e + d + 3*a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a^4 + a^3 + a^2 + a + 1, - b - a, c^2 + 3*c*a + a^2, d + c + 3*a, e - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a^4 + a^3 + a^2 + a + 1, - b^2 + 3*b*a + a^2, c + b + 3*a, d - a, e - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a^4 + a^3 + a^2 + a + 1, - b^3 + b^2*a + b^2 + b*a^2 + b*a + b + a^3 + a^2 + a + 1, - c + b^2*a^3 + b^2*a^2 + b^2*a + b^2, - -d + b^2*a^2 + b^2*a + b^2 + b*a^2 + b*a + a^2, + Ideal (a^4 + a^3 + a^2 + a + 1, b - a, c - a, d^2 + 3*d*a + a^2, + e + d + 3*a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, + Ideal (a^4 + a^3 + a^2 + a + 1, b - a, c^2 + 3*c*a + a^2, d + c + 3*a, + e - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, + Ideal (a^4 + a^3 + a^2 + a + 1, b - 1, c + a^3 + a^2 + a + 1, -d + a^3, + -e + a^2) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, + Ideal (a^4 + a^3 + a^2 + a + 1, b^2 + 3*b*a + a^2, c + b + 3*a, d - a, + e - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, + Ideal (a^4 + a^3 + a^2 + a + 1, b^3 + b^2*a + b^2 + b*a^2 + b*a + b + a^3 + a^2 + a + 1, + c + b^2*a^3 + b^2*a^2 + b^2*a + b^2, -d + b^2*a^2 + b^2*a + b^2 + b*a^2 + b*a + a^2, -e + b^2*a^3 - b*a^2 - b*a - b - a^2 - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, - Ideal (a^4 + a^3 + 6*a^2 - 4*a + 1, - -11*b^2 + 6*b*a^3 + 10*b*a^2 + 39*b*a + 2*b + 16*a^3 + 23*a^2 + 104*a - 24, - 11*c + 3*a^3 + 5*a^2 + 25*a + 1, 11*d + 3*a^3 + 5*a^2 + 25*a + 1, - -11*e - 11*b + 6*a^3 + 10*a^2 + 39*a + 2) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field] + Ideal (a^4 + a^3 + 6*a^2 - 4*a + 1, -11*b^2 + 6*b*a^3 + 10*b*a^2 + 39*b*a + 2*b + 16*a^3 + 23*a^2 + 104*a - 24, + 11*c + 3*a^3 + 5*a^2 + 25*a + 1, 11*d + 3*a^3 + 5*a^2 + 25*a + 1, -11*e - 11*b + 6*a^3 + 10*a^2 + 39*a + 2) + of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field] sage: R. = PolynomialRing(QQ, 2, order='lex') sage: f1 = 1/2*((x1^2 + 2*x1 - 4)*x2^2 + 2*(x1^2 + x1)*x2 + x1^2) @@ -2333,7 +2330,7 @@ def elimination_ideal(self, variables, algorithm=None, *args, **kwds): Check that this method works over QQbar (:issue:`25351`):: - sage: # needs sage.rings.number_field sage.libs.giac + sage: # needs sage.libs.giac sage.rings.number_field sage: R. = QQbar[] sage: I = R * [x - t, y - t^2, z - t^3, s - x + y^3] sage: J = I.elimination_ideal([t, s]); J @@ -4635,7 +4632,7 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal sage: I.groebner_basis('libsingular:slimgb') [a + (-60)*c^3 + 158/7*c^2 + 8/7*c - 1, b + 30*c^3 + (-79/7)*c^2 + 3/7*c, c^4 + (-10/21)*c^3 + 1/84*c^2 + 1/84*c] - sage: # needs sage.rings.number_field sage.libs.giac + sage: # needs sage.libs.giac sage.rings.number_field sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching sage: J = I.change_ring(P.change_ring(order='degrevlex')) sage: gb = J.groebner_basis('giac') # random diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index adf3df1cf95..8f63477e1aa 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -4312,9 +4312,9 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base): sage: R. = QQ[] sage: f = (-2) * (a - d) * (-a + b) * (b - d) * (a - c) * (b - c) * (c - d) sage: F = f.factor(); F - (-2) * (c - d) * (-b + c) * (b - d) * (-a + c) * (-a + b) * (a - d) + (-2) * (-a + c) * (-a + b) * (-b + c) * (c - d) * (b - d) * (a - d) sage: F[0][0] - c - d + -a + c sage: F.unit() -2 diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index b8445edeb20..4d2e607b37d 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -7177,9 +7177,9 @@ cdef class Polynomial(CommutativePolynomial): sage: f = R('e*i') * x + x^2 sage: f._giac_init_() '((1)*1)*sageVARx^2+((1)*sageVARe*sageVARi)*sageVARx' - sage: giac(f) # needs giac + sage: giac(f) # needs giac sageVARx^2+sageVARe*sageVARi*sageVARx - sage: giac(R.zero()) # needs giac + sage: giac(R.zero()) # needs giac 0 """ g = 'sageVAR' + self.variable_name() @@ -7646,7 +7646,7 @@ cdef class Polynomial(CommutativePolynomial): sage: x = polygen(R) sage: f = (x - a) * (x - b) * (x - c) sage: f.compose_power(2).factor() # needs sage.libs.singular sage.modules - (x - c^2) * (x - b^2) * (x - a^2) * (x - b*c)^2 * (x - a*c)^2 * (x - a*b)^2 + (x - a^2) * (x - b^2) * (x - c^2) * (x - a*b)^2 * (x - a*c)^2 * (x - b*c)^2 sage: # needs sage.libs.singular sage.modules sage: x = polygen(QQ) @@ -7715,7 +7715,7 @@ cdef class Polynomial(CommutativePolynomial): sage: x = polygen(QQ) sage: f = x^2 - 2*x + 2 - sage: f.adams_operator_on_roots(10) # needs sage.libs.singular + sage: f.adams_operator_on_roots(10) # needs sage.libs.singular x^2 + 1024 When ``self`` is monic, the output will have leading coefficient @@ -7725,10 +7725,10 @@ cdef class Polynomial(CommutativePolynomial): sage: R. = ZZ[] sage: x = polygen(R) sage: f = (x - a) * (x - b) * (x - c) - sage: f.adams_operator_on_roots(3).factor() # needs sage.libs.singular - (-1) * (x - c^3) * (x - b^3) * (x - a^3) - sage: f.adams_operator_on_roots(3, monic=True).factor() # needs sage.libs.singular - (x - c^3) * (x - b^3) * (x - a^3) + sage: f.adams_operator_on_roots(3).factor() # needs sage.libs.singular + (-1) * (x - a^3) * (x - b^3) * (x - c^3) + sage: f.adams_operator_on_roots(3, monic=True).factor() # needs sage.libs.singular + (x - a^3) * (x - b^3) * (x - c^3) """ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing @@ -7768,8 +7768,8 @@ cdef class Polynomial(CommutativePolynomial): sage: [f.symmetric_power(k).factor() for k in range(5)] # needs sage.libs.singular [x - 1, (-x + d) * (-x + c) * (-x + b) * (-x + a), - (x - c*d) * (x - b*d) * (x - a*d) * (x - b*c) * (x - a*c) * (x - a*b), - (x - b*c*d) * (x - a*c*d) * (x - a*b*d) * (x - a*b*c), + (x - a*b) * (x - a*c) * (x - b*c) * (x - a*d) * (x - b*d) * (x - c*d), + (x - a*b*c) * (x - a*b*d) * (x - a*c*d) * (x - b*c*d), x - a*b*c*d] """ try: diff --git a/src/sage/rings/polynomial/symmetric_ideal.py b/src/sage/rings/polynomial/symmetric_ideal.py index 869af07d904..b271846b59c 100644 --- a/src/sage/rings/polynomial/symmetric_ideal.py +++ b/src/sage/rings/polynomial/symmetric_ideal.py @@ -27,8 +27,8 @@ sage: # needs sage.combinat sage: G = R * I.groebner_basis() sage: G - Symmetric Ideal (x_1^2 + x_1, x_2 - x_1) of - Infinite polynomial ring in x over Rational Field + Symmetric Ideal (x_2 - x_1, x_1^2 + x_1) of Infinite polynomial ring in x + over Rational Field sage: Q = R.quotient(G) sage: p = x[3]*x[1] + x[2]^2 + 3 sage: Q(p) @@ -123,8 +123,8 @@ class SymmetricIdeal(Ideal_generic): The default ordering is lexicographic. We now compute a Groebner basis:: sage: J = I.groebner_basis(); J # about 3 seconds # needs sage.combinat - [x_1*y_2*y_1 + 2*x_1*y_2, x_2*y_2*y_1 + 2*x_2*y_1, - x_2*x_1*y_1^2 + 2*x_2*x_1*y_1, x_2*x_1*y_2 - x_2*x_1*y_1] + [x_2*x_1*y_2 - x_2*x_1*y_1, x_1*y_2*y_1 + 2*x_1*y_2, + x_2*y_2*y_1 + 2*x_2*y_1, x_2*x_1*y_1^2 + 2*x_2*x_1*y_1] Note that even though the symmetric ideal can be generated by a single polynomial, its reduced symmetric Groebner basis comprises @@ -139,11 +139,11 @@ class SymmetricIdeal(Ideal_generic): sage: # needs sage.combinat sage: P = Permutation([2, 1]) sage: J[2] - x_2*x_1*y_1^2 + 2*x_2*x_1*y_1 + x_2*y_2*y_1 + 2*x_2*y_1 sage: J[2]^P - x_2*x_1*y_2^2 + 2*x_2*x_1*y_2 + x_1*y_2*y_1 + 2*x_1*y_2 sage: J[2]^P in J - False + True However, any element of ``J`` has symmetric reduction zero even after applying a permutation. This even holds when the @@ -157,7 +157,7 @@ class SymmetricIdeal(Ideal_generic): ideal membership:: sage: [p.reduce(I) for p in J] # needs sage.combinat - [0, x_2*y_2*y_1 + 2*x_2*y_1, x_2*x_1*y_1^2 + 2*x_2*x_1*y_1, x_2*x_1*y_2 - x_2*x_1*y_1] + [x_2*x_1*y_2 - x_2*x_1*y_1, 0, x_2*y_2*y_1 + 2*x_2*y_1, x_2*x_1*y_1^2 + 2*x_2*x_1*y_1] Note that we give no guarantee that the computation of a symmetric Groebner basis will terminate in any order different from @@ -239,8 +239,8 @@ def _contains_(self, p): sage: I = R.ideal([x[1]*x[2] + x[3]]) sage: I = R * I.groebner_basis() # needs sage.combinat sage: I # needs sage.combinat - Symmetric Ideal (x_1^2 + x_1, x_2 - x_1) of - Infinite polynomial ring in x over Rational Field + Symmetric Ideal (x_2 - x_1, x_1^2 + x_1) of + Infinite polynomial ring in x over Rational Field sage: x[2]^2 + x[3] in I # indirect doctest # needs sage.combinat True """ @@ -617,12 +617,14 @@ def symmetrisation(self, N=None, tailreduce=False, report=None, use_full_group=F sage: X. = InfinitePolynomialRing(QQ) sage: I = X * (x[1] + x[2], x[1]*x[2]) sage: I.symmetrisation() # needs sage.combinat - Symmetric Ideal (-x_1^2, x_2 + x_1) of - Infinite polynomial ring in x over Rational Field + Symmetric Ideal (-x_2^2, -x_1^2, x_2 + x_1) of Infinite polynomial ring in x + over Rational Field sage: I.symmetrisation(N=3) # needs sage.combinat - Symmetric Ideal (-2*x_1) of Infinite polynomial ring in x over Rational Field + Symmetric Ideal (-x_2^2, -x_1^2, -2*x_1) of Infinite polynomial ring in x + over Rational Field sage: I.symmetrisation(N=3, use_full_group=True) # needs sage.combinat - Symmetric Ideal (-2*x_1) of Infinite polynomial ring in x over Rational Field + Symmetric Ideal (-x_1^2, -2*x_1) of Infinite polynomial ring in x + over Rational Field """ newOUT = self.interreduction(tailreduce=tailreduce, report=report).squeezed() R = self.ring() @@ -678,7 +680,7 @@ def symmetric_basis(self): sage: X. = InfinitePolynomialRing(QQ) sage: I = X * (x[1] + x[2], x[1]*x[2]) sage: I.symmetric_basis() # needs sage.combinat - [x_1^2, x_2 + x_1] + [x_2^2, x_1^2, x_2 + x_1] """ return Sequence(self.symmetrisation(tailreduce=True).normalisation().gens(), self.ring(), check=False) @@ -822,27 +824,32 @@ def groebner_basis(self, tailreduce=False, reduced=True, algorithm=None, report= sage: I1.groebner_basis(report=True, reduced=True) # needs sage.combinat Symmetric interreduction - [1/2] > + [1/2] > [2/2] :> - [1/2] > - [2/2] > + [1/2] > + [2/2] > Symmetrise 2 polynomials at level 2 Apply permutations > > Symmetric interreduction - [1/3] > - [2/3] > - [3/3] :> - -> 0 - [1/2] > - [2/2] > + [1/3] > + [2/3] > + [3/3] > + Apply permutations + > + :> + :> + Symmetric interreduction + [1/3] > + [2/3] > + [3/3] > Symmetrisation done Classical Groebner basis -> 2 generators Symmetric interreduction - [1/2] > - [2/2] > + [1/2] > + [2/2] > Symmetrise 2 polynomials at level 3 Apply permutations > @@ -852,24 +859,24 @@ def groebner_basis(self, tailreduce=False, reduced=True, algorithm=None, report= :> ::> Symmetric interreduction - [1/4] > + [1/4] > [2/4] :> -> 0 [3/4] ::> -> 0 [4/4] :> -> 0 - [1/1] > + [1/1] > Apply permutations :> :> :> Symmetric interreduction - [1/1] > + [1/1] > Classical Groebner basis -> 1 generators Symmetric interreduction - [1/1] > + [1/1] > Symmetrise 1 polynomials at level 4 Apply permutations > @@ -879,12 +886,12 @@ def groebner_basis(self, tailreduce=False, reduced=True, algorithm=None, report= :> :> Symmetric interreduction - [1/2] > + [1/2] > [2/2] :> -> 0 - [1/1] > + [1/1] > Symmetric interreduction - [1/1] > + [1/1] > [x_1] The Aschenbrenner-Hillar algorithm is only guaranteed to work diff --git a/src/sage/rings/polynomial/toy_variety.py b/src/sage/rings/polynomial/toy_variety.py index ba67a1ece2e..3543c92474b 100644 --- a/src/sage/rings/polynomial/toy_variety.py +++ b/src/sage/rings/polynomial/toy_variety.py @@ -255,10 +255,10 @@ def triangular_factorization(B, n=-1): sage: p3 = (x-2)^2*(y-1)^3 sage: I = R.ideal(p1,p2,p3) sage: triangular_factorization(I.groebner_basis()) # needs sage.libs.singular - [[x^2 - 4*x + 4, y, z], - [x^5 - 3*x^4 + 3*x^3 - x^2, y - 1, z], - [x^2 - 4*x + 4, y, z - 1], - [x^5 - 3*x^4 + 3*x^3 - x^2, y - 1, z - 1]] + [[x^2 - 4*x + 4, y, z - 1], + [x^5 - 3*x^4 + 3*x^3 - x^2, y - 1, z - 1], + [x^2 - 4*x + 4, y, z], + [x^5 - 3*x^4 + 3*x^3 - x^2, y - 1, z]] """ # type checking in a probably vain attempt to avoid stupid errors if isinstance(B, (tuple, list)): diff --git a/src/sage/schemes/curves/point.py b/src/sage/schemes/curves/point.py index e74e009b1ce..782fc4abe14 100644 --- a/src/sage/schemes/curves/point.py +++ b/src/sage/schemes/curves/point.py @@ -307,7 +307,7 @@ def tangents(self): ....: 5*x - y + 1]) sage: Q = C([-1,0]) sage: Q.tangents() - [y, x + 1, x - y + 1, x + y + 1] + [y, x - y + 1, x + 1, x + y + 1] """ return self.codomain().tangents(self) diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py index 24d438dca07..63bdb6fca43 100644 --- a/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py +++ b/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py @@ -1,4 +1,4 @@ -""" +r""" This file (./mpoly_doctest.sage) was *autogenerated* from ./mpoly.tex, with sagetex.sty version 2011/05/27 v2.3.1. It contains the contents of all the sageexample environments from this file. @@ -73,14 +73,14 @@ Sage example in ./mpoly.tex, line 381:: - sage: print("total={d} (in x)={dx} partial={ds}"\ + sage: print("total={d} (in x)={dx} partial={ds}" ....: .format(d=p.degree(), dx=p.degree(x), ds=p.degrees())) total=4 (in x)=3 partial=(3, 2, 1) Sage example in ./mpoly.tex, line 441:: sage: R. = QQ[]; p = x^2 + y^2; q = x + y - sage: print("({quo})*({q}) + ({rem}) == {p}".format( \ + sage: print("({quo})*({q}) + ({rem}) == {p}".format( ....: quo=p//q, q=q, rem=p%q, p=p//q*q+p%q)) (-x + y)*(x + y) + (2*x^2) == x^2 + y^2 sage: p.mod(q) # is NOT equivalent to p%q @@ -92,7 +92,7 @@ sage: (x^10 + y^5).gcd(x^4 - y^2) x^2 + y sage: (x^10 + y^5).factor() - (x^2 + y) * (x^2 + (a^3)*y) * (x^2 + (a^2)*y) * (x^2 + a*y) * (x^2 + (-a^3 - a^2 - a - 1)*y) + (x^2 + y) * (x^2 + a*y) * (x^2 + (a^2)*y) * (x^2 + (-a^3 - a^2 - a - 1)*y) * (x^2 + (a^3)*y) Sage example in ./mpoly.tex, line 564:: @@ -170,7 +170,7 @@ [Ideal (z^17 - 1, y - 2*z^10, x - 3*z^3) of Multivariate Polynomial Ring in x, y, z over Rational Field] sage: J.transformed_basis() - [z^17 - 1, -2*z^10 + y, -3/4*y^2 + x] + [z^17 - 1, -3/4*y^2 + x, -2*z^10 + y] Sage example in ./mpoly.tex, line 909::