The main algebra¶
Multivariate Polynomial Algebra
This modules implements the polynomial ring seen as an algebra with multibases. Especially, it implements bases such as the Schubert, Grothendieck, and Key polynomials, and any basis based on a divided difference type operation.
In the monomial basis, a multivariate polynomial is seen as a linear combination of vectors. Where each vector represents the exponents of the given monomial.
The number of variables is not set: the algebra can be understood as the projective limit of all polynomial rings with a finite number of variables.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra
sage: A.<x> = MultivariatePolynomialAlgebra(QQ)
sage: A
The Multivariate polynomial algebra on x over Rational Field
sage: A.an_element()
2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3]
sage: x
The Multivariate polynomial algebra on x over Rational Field on the monomial basis
sage: x[1,1,2] + x[3,2,4]
x[3, 2, 4] + x[1, 1, 2]
sage: x[1,1,2] * x[3,2,4]
x[4, 3, 6]
Here is how to access a single variable:
sage: x1 = A.var(1)
sage: x1
x[1]
sage: x2 = A.var(2)
sage: x2
x[0, 1]
sage: x1 * x2
x[1, 1]
Get back a symbolic expression:
sage: pol = A.an_element(); pol
2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3]
sage: pol.to_expr()
x1*x2^2*x3^3 + 2*x1 + 3*x2 + 1
You can apply many different actions on the polynomial:
sage: pol = A.an_element(); pol
2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3]
sage: pol.divided_difference(2)
-x[1, 2, 2] + 3*x[0, 0, 0]
sage: pol.isobaric_divided_difference(2)
2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + 3*x[0, 0, 1]
sage: pol.hat_isobaric_divided_difference(2)
3*x[0, 0, 1] - x[1, 2, 3]
sage: pol.si(1)
3*x[1, 0, 0] + 2*x[0, 1, 0] + x[0, 0, 0] + x[2, 1, 3]
The main purpose of this module is to implement different bases of the polynomial algebra based on these actions:
sage: Schub = A.schubert_basis()
sage: K = A.demazure_basis()
sage: Khat = A.demazure_hat_basis()
sage: Groth = A.grothendieck_positive_basis()
sage: Schub(pol)
-Y[1, 3, 2] - Y[3, 2, 1] - Y[1, 0, 0] + Y[1, 2, 3] + Y[0, 0, 0] + Y[4, 1, 1] + Y[3, 1, 2] + 3*Y[0, 1, 0] + Y[2, 3, 1] - Y[2, 1, 3]
sage: K(pol)
-K[2, 1, 3] - K[1, 3, 2] - K[3, 2, 1] - K[1, 0, 0] + K[1, 2, 3] + K[0, 0, 0] + K[3, 1, 2] + 3*K[0, 1, 0] + K[2, 3, 1]
sage: Khat(pol)
2*^K[1, 0, 0] + 3*^K[0, 1, 0] + ^K[0, 0, 0] + ^K[1, 2, 3]
sage: Groth(pol)
-G[1, 3, 2] - G[3, 2, 1] - G[1, 0, 0] + G[1, 2, 3] + G[0, 0, 0] + G[4, 1, 1] + G[2, 2, 3] + G[2, 3, 1] + G[3, 3, 3] + 3*G[1, 1, 0] - G[4, 1, 3] - 2*G[2, 3, 2] - G[3, 3, 2] + G[2, 3, 3] - G[2, 1, 3] + G[3, 2, 2] - G[3, 1, 3] + 3*G[0, 1, 0] + G[3, 1, 2] + G[1, 3, 3]
-
class
multipolynomial_bases.multivariate_polynomials.
FiniteRankMultivariatePolynomialAlgebra
(polynomial_ring_tower, nb_variables, main_repr_var='x', extra_bases_category=None)¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.parent.Parent
This class implements the polynomial algebra in a given number of variables.
INPUT:
polynomial_ring_tower
– the class of the polynomial algebra in an unset number of variables. from which theFiniteRankMultivariatePolynomialAlgebra
comes from. AFiniteRankMultivariatePolynomialAlgebra
always comes from aMultivariatePolynomialAlgebra
which contains general informations likethe base ring.
nb_variables
– the number of variablesmain_repr_var
– the letter corresponding to the set of variables, it is used to represent several bases, default isx
TESTS:
sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: var('t') t sage: A = MultivariatePolynomialAlgebra(QQ[t]) sage: B = FiniteRankMultivariatePolynomialAlgebra(A,4) sage: B The Multivariate polynomial algebra on x over Univariate Polynomial Ring in t over Rational Field with 4 variables sage: TestSuite(B).run()
-
a_realization
()¶ Returns a default realization of
self
, the monomial basisEXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: F = A.algebra_finite_nb_variables(3) sage: F.a_realization() The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis
-
an_element
()¶ Return an element of
self
. By default, this element lies in the monomial basis.EXAMPLES:
sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: B = FiniteRankMultivariatePolynomialAlgebra(A,7) sage: B.an_element() 2*x[1, 0, 0, 0, 0, 0, 0] + 3*x[0, 1, 0, 0, 0, 0, 0] + x[0, 0, 0, 0, 0, 0, 0] + x[1, 2, 3, 4, 5, 6, 7]
-
from_morphism_basis
(polynomial_ring_tower, basis_name, basis_repr)¶ Creates a basis defined by its morphism to another basis
INPUT:
polynomial_ring_tower
: the basis ofAbsractPolynomialRing
which is a facade to this basis and represents
it on a undefined number of variables. It must have a \(get_morphism_on_basis\) method and a \(get_basis_keys\) method as well as a
morphism_to_basis
-basis_name
: the name of the basis (used in repr) -basis_repr
: the basis representation for elements (exemple “x”)OUTPUT:
- the basis of which elements are indexed by the set return
by
polynomial_ring_tower.get_basis_keys(self.nb_variables())
and can be coerced on themorphims_to_basis
basis of thepolynomial_ring_tower
on the right number of variables (self.nb_variables()
)
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: M = A.monomial_basis() sage: def get_basis_keys(n): code = "A" + str(n-1); return RootSystem(code).ambient_space(QQ) sage: def get_morphism_on_basis(n): return lambda key: M( [key[i] for i in xrange(n)]) sage: MyBasis = A.from_morphism_basis(1,M,get_basis_keys,get_morphism_on_basis,"My Basis", "X"); MyBasis The Multivariate polynomial algebra on x over Rational Field on the My Basis sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: F2 = FiniteRankMultivariatePolynomialAlgebra(A,2) sage: MyFiniteBasis = F2.from_morphism_basis(MyBasis,"MyBasis", "X"); MyFiniteBasis The Multivariate polynomial algebra on x over Rational Field with 2 variables on the MyBasis sage: MyFiniteBasis.an_element() X(2, 2) sage: M( MyFiniteBasis.an_element()) x[2, 2]
We have recreated the basis on ambient space.
-
linear_basis_on_vectors
(polynomial_ring_tower, basis_name, basis_repr, **keywords)¶ Creates a linear basis on objects inedexed by vectors based on an operation to convert each object (through its vector) into a ambient space basis polynomial. The type of the ambient space basis and the method of conversion are all contained into the
polynomial_ring_tower
polynomial_ring_tower
: the basis ofAbsractPolynomialRing
which is a facade to this basis and
represents it on a undefined number of variables. It should inherit from a basis.LinearBasisOnVectors -
basis_name
: the name of the basis (used in repr) -basis_repr
: the basis representation for elements -**keyword
: parameters used to create the morphism to the ambient space basis,sent toCombinatorialFreeModule.module_morphism
.OUTPUT :
- a basis named
basis_name
and defined by its conversion to an ambient space basis,
the type of the ambient space basis and the method of conversion are all contained into thepolynomial_ring_tower
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: def schubert_on_basis(v, basis, call_back): ... for i in xrange(len(v)-1): ... if(v[i]<v[i+1]): ... v[i], v[i+1] = v[i+1] + 1, v[i] ... return call_back(v).divided_difference(i+1) ... return basis(v) sage: myBasis = A.linear_basis_on_vectors("A","MySchub","Y",schubert_on_basis) sage: F3 = A.algebra_finite_nb_variables(3) sage: myFiniteBasis = F3.linear_basis_on_vectors(myBasis,"MySchub","Y") sage: myFiniteBasis The Multivariate polynomial algebra on x over Rational Field with 3 variables on the MySchub
-
monomial_basis
(basis_repr=None)¶ Returns the algebra
self
view in the monomials basis.- INPUT:
basis_repr
, the representation letter for the elements of the base, by default, it is the main representation for
the set of variable :
self._main_repr_var
EXAMPLES:
sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: B = FiniteRankMultivariatePolynomialAlgebra(A,5) sage: B.monomial_basis() The Multivariate polynomial algebra on x over Rational Field with 5 variables on the monomial basis
-
monomial_basis_with_type
(letter, basis_repr=None)¶ Return the algebra
self
view in the proper ambient space of the root system design byletter
.EXAMPLES:
sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: F = FiniteRankMultivariatePolynomialAlgebra(A,2) sage: F.monomial_basis_with_type("B") The Multivariate polynomial algebra on x over Rational Field with 2 variables on the Monomial basis of type B
-
nb_variables
()¶ Return the number of variables of
self
.EXAMPLES:
sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: B = FiniteRankMultivariatePolynomialAlgebra(A,8) sage: B.nb_variables() 8 sage: B = FiniteRankMultivariatePolynomialAlgebra(A,0) sage: B.nb_variables() 0
-
polynomial_ring_tower
()¶ Return the polynomial ring tower given to define
self
.EXAMPLES:
sage: from multipolynomial_bases.multivariate_polynomials import FiniteRankMultivariatePolynomialAlgebra sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: K = CyclotomicField(3) sage: A = MultivariatePolynomialAlgebra(K) sage: B = FiniteRankMultivariatePolynomialAlgebra(A,3) sage: B.polynomial_ring_tower() The Multivariate polynomial algebra on x over Cyclotomic Field of order 3 and degree 2
-
multipolynomial_bases.multivariate_polynomials.
MultivariatePolynomialAlgebra
(base_ring, names=None, set_of_variables=1)¶ Return the multivariate polynomial algebra.
This is a polynomial ring in one or two inifinite sets of variables, interpreted as a multibases algebra.
INPUT:
base_ring
the base ring of the algebranames
a list of maximal size 2 of names for the set of variablesset_of_variables
an integer default:1, if names is not set, thenset_of_variables
is used to know on how many set of variables the algebra is defined (max = 2)
OUTPUT:
The multivariate polynomial algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: A The Multivariate polynomial algebra on x over Rational Field
The generator
x
is not a single variable, it represents a infinite set of variables. More precisely, it is the monomial basis of the algebra.sage: x The Multivariate polynomial algebra on x over Rational Field on the monomial basis sage: x[1,1,2] + x[2,3,4] x[2, 3, 4] + x[1, 1, 2] sage: x == A.monomial_basis() True
Here is how to access a single variable:
sage: x1 = A.var(1) sage: x1 x[1] sage: x2 = A.var(2) sage: x2 x[0, 1] sage: x1 * x2 x[1, 1]
TESTS:
sage: A = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over Rational Field sage: A = MultivariatePolynomialAlgebra(QQ, names = ["x"]); A The Multivariate polynomial algebra on x over Rational Field sage: A = MultivariatePolynomialAlgebra(QQ, names = ["x", "y"]); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field sage: A = MultivariatePolynomialAlgebra(QQ, set_of_variables = 2); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field
-
class
multipolynomial_bases.multivariate_polynomials.
MultivariatePolynomialAlgebra_generic
(R, main_repr_var, always_show_main_var=False, extra_category=None, extra_bases_category=None)¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.parent.Parent
A class implementing the multivariate polynomial ring as multibases algebra.
INPUT:
R
: the base ring of the algebramain_repr_var
, the letter corresponding to the set of variables, it is used to represent several bases, default isx
always_show_main_var
, if Truemain_repr_var
will be displayed on elements of every basis, even the ones that don’t use it directly (Schubert basis, Demazure basis, ...), false by default, used onDoubleMultivariatePolynomialAlgebra
to differentiate the two sets of variables
OUTPUT:
- The Multivariate polynomial algebra on
main_repr_var
overR
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over Rational Field
The monomial basis is given as the algebra generator:
sage: x The Multivariate polynomial algebra on x over Rational Field on the monomial basis sage: A.monomial_basis() == x True
You can use it to create polynomials.
sage: pol = x[1,1,2] + x[3,4]; pol x[3, 4, 0] + x[1, 1, 2] sage: pol * x[2,3] x[5, 7, 0] + x[3, 4, 2]
You can also access a single variable.
sage: A.var(1) x[1] sage: A.var(2) x[0, 1] sage: A.var(3) x[0, 0, 1]
The coercion between elements with a different number of variables is done automatically.
sage: pol1 = x[1,1,2] sage: pol1.nb_variables() 3 sage: pol2 = x[2] sage: pol2.nb_variables() 1 sage: (pol1 * pol2).nb_variables() 3
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: TestSuite(A).run()
-
a_realization
()¶ Return a default realization of
self
: the monomial basisEXAMPLES
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: A.a_realization() The Multivariate polynomial algebra on x over Rational Field on the monomial basis
-
algebra_finite_nb_variables
(nb_variables, basis_repr=None)¶ Return the realization of
self
in a given number of variables.INPUT:
nb_variables
: the number of variablesbasis_repr
, the representation letter for the elements of the base, by default, it is the main representation for the set of variable :self._main_repr_var
OUTPUT:
The multivariate polynomial algebra in
nb_variables
variablesEXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: A3 = A.algebra_finite_nb_variables(3); A3 The Multivariate polynomial algebra on x over Rational Field with 3 variables
The finite number of variables ring contains method to obtain the algebra bases on a finite number of variables:
sage: m3 = A3.monomial_basis(); m3 The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis sage: ma3 = A3.monomial_basis_with_type("A"); ma3 The Multivariate polynomial algebra on x over Rational Field with 3 variables on the Monomial basis of type A
Coercions between rings with a different number of variables are created dynamically:
sage: x = A.monomial_basis() sage: pol1 = x[1,2,3]; pol1 x[1, 2, 3] sage: pol1.parent() The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis sage: pol2 = x[1,1]; pol2 x[1, 1] sage: pol2.parent() The Multivariate polynomial algebra on x over Rational Field with 2 variables on the monomial basis sage: pol1 + pol2 x[1, 1, 0] + x[1, 2, 3] sage: (pol1 + pol2).parent() The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis
-
an_element
()¶ Return an element of
self
. By default, this element lies in the monomial basis.EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: A.an_element() 2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3]
-
change_nb_variables
(pol, nb_variables)¶ Forcing the addition of variables
INPUT:
pol
: a polynomial expressed in any basisnb_variables
: the new number of variables
OUTPUT:
- the polynomial seen as a polynomial of
nb_variables
variables
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: pol = x.an_element(); pol 2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3] sage: A.change_nb_variables(pol, 5) x[1, 2, 3, 0, 0] + x[0, 0, 0, 0, 0] + 3*x[0, 1, 0, 0, 0] + 2*x[1, 0, 0, 0, 0] sage: xA = A.monomial_basis_with_type("A") sage: pol = xA.an_element(); pol 2*xA[1, 0, 0] + xA[2, 2, 3] + xA[0, 0, 0] + 3*xA[0, 1, 0] sage: A.change_nb_variables(pol, 5) xA[2, 2, 3, 0, 0] + xA[0, 0, 0, 0, 0] + 3*xA[0, 1, 0, 0, 0] + 2*xA[1, 0, 0, 0, 0]
-
demazure_basis
(group_type='A', basis_name=None, basis_repr='K')¶ Creates the Demazure basis where demazure / key polynomials are indexed by vectors.
Here is the definition we use for type A. For $v = (v_1, cdots, v_n) in mathbb{N}^n$, we define
$K_v = x_1^{v_1}x_2^{v_2}cdotsx_n^{v_n}$ if $v$ is a partition, i.e, if $v_1 geq v_2 geq cdots geq v_n$.
Otherwise, we have for $ v_i > v_{i+1}$
$K_{cdots v_{i+1} v_i cdots} = K_v pi_i$ where $pi_i$ is the ith isobar divided difference.
The vectors indexing the key polynomials can as well been seen as lehmer codes.
INPUT:
group_type
: (default:A
) the letter that represents the type of the weyl groupbasis_name
: (default: canonical name) the name of the basis (used in repr)basis_repr
: (default:K
) the basis representation for elements
OUTPUT:
- The Multivariate polynomial algebra on x over
R
on the Demazure basis of typegroup_type
indexed by vectors whereR
is the algebra base ring defined in the abstract algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: Dem = A.demazure_basis("A"); Dem The Multivariate polynomial algebra on x over Rational Field on the Demazure basis of type A sage: Dem.an_element() 2*K[1, 0, 0] + K[2, 2, 3] + K[0, 0, 0] + 3*K[0, 1, 0] sage: Dem[1,2,3] K[1, 2, 3]
Let us see some coercions:
sage: k = Dem.an_element(); k 2*K[1, 0, 0] + K[2, 2, 3] + K[0, 0, 0] + 3*K[0, 1, 0] sage: k.expand() xA[2, 3, 2] + 5*xA[1, 0, 0] + xA[3, 2, 2] + xA[0, 0, 0] + xA[2, 2, 3] + 3*xA[0, 1, 0] sage: xA = A.monomial_basis_with_type("A") sage: xA(k) xA[2, 3, 2] + 5*xA[1, 0, 0] + xA[3, 2, 2] + xA[0, 0, 0] + xA[2, 2, 3] + 3*xA[0, 1, 0] sage: x = A.monomial_basis() sage: x(k) x[2, 3, 2] + 5*x[1, 0, 0] + x[3, 2, 2] + x[0, 0, 0] + x[2, 2, 3] + 3*x[0, 1, 0] sage: xA.an_element(); Dem(xA.an_element()) 2*xA[1, 0, 0] + xA[2, 2, 3] + xA[0, 0, 0] + 3*xA[0, 1, 0] -K[1, 0, 0] + 3*K[0, 1, 0] + K[0, 0, 0] - K[2, 3, 2] + K[2, 2, 3] sage: x.an_element(); Dem(x.an_element()) 2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3] -K[2, 1, 3] - K[1, 3, 2] - K[3, 2, 1] - K[1, 0, 0] + K[1, 2, 3] + K[0, 0, 0] + K[3, 1, 2] + 3*K[0, 1, 0] + K[2, 3, 1]
Let us see some operations:
sage: Dem[1,2] + Dem[3,0,0] K[1, 2, 0] + K[3, 0, 0] sage: Dem.an_element() * Dem.an_element() 9*K[0, 2, 0] + 4*K[4, 2, 2] + 16*K[2, 0, 0] + 21*K[1, 1, 0] + 4*K[1, 0, 0] + 6*K[2, 3, 3] + 6*K[2, 4, 2] + K[0, 0, 0] + K[4, 5, 5] + 4*K[3, 2, 3] + K[4, 4, 6] + 2*K[2, 2, 3] + 6*K[0, 1, 0] sage: Dem[1,2] * Dem[3,0,0] K[4, 2, 0] + K[5, 1, 0]
We can also have type B, C or D key polynomials:
sage: DemB = A.demazure_basis("B"); DemB The Multivariate polynomial algebra on x over Rational Field on the Demazure basis of type B sage: pol = DemB[2,1,-2]; pol K[2, 1, -2] sage: pol.expand() xB[2, 1, 0] + xB[2, 2, 1] + xB[2, 1, 1] + xB[2, 1, -1] + xB[2, 2, 0] + xB[2, 1, -2] + xB[2, 2, -1] + xB[2, 1, 2]
-
demazure_hat_basis
(group_type='A', basis_name=None, basis_repr='^K')¶ Creates the Demazure hat basis where demazure polynomials are indexed by vectors.
Here is the definition we use for type A. For $v = (v_1, cdots, v_n) in mathbb{N}^n$, we define
$K_v = x_1^{v_1}x_2^{v_2}cdotsx_n^{v_n}$ if $v$ is a partition, i.e, if $v_1 geq v_2 geq cdots geq v_n$.
Otherwise, we have for $ v_i > v_{i+1}$
$K_{cdots v_{i+1} v_i cdots} = K_v pi_i$ where $pi_i$ is the ith isobar hat divided difference.
The vectors indexing the key polynomials can as well been seen as lehmer codes.
INPUT:
group_type
: (default:A
) the letter that represents the type of the weyl groupbasis_name
: (default: canonical name) the name of the basis (used in repr)basis_repr
: (default:^K
) the basis representation for elements
OUTPUT:
- The Multivariate polynomial algebra on x over
R
on the Demazure hat basis of typegroup_type
indexed by vectors whereR
is the algebra base ring defined in the abstract algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ); sage: Demh = A.demazure_hat_basis("A"); Demh The Multivariate polynomial algebra on x over Rational Field on the Demazure hat basis of type A sage: Demh.an_element() 2*^K[1, 0, 0] + ^K[2, 2, 3] + ^K[0, 0, 0] + 3*^K[0, 1, 0]
Let us see some coercions:
sage: kh = Demh[1,2,4]; kh ^K[1, 2, 4] sage: kh.expand() xA[2, 2, 3] + xA[1, 2, 4] + xA[1, 3, 3] sage: xA = A.monomial_basis_with_type("A") sage: xA(kh) xA[2, 2, 3] + xA[1, 2, 4] + xA[1, 3, 3] sage: x = A.monomial_basis() sage: x(kh) x[2, 2, 3] + x[1, 3, 3] + x[1, 2, 4] sage: Demh(xA[1,2,4]) ^K[2, 3, 2] + ^K[1, 2, 4] - ^K[1, 3, 3] sage: Demh(x[1,2,4]) ^K[2, 3, 2] + ^K[1, 2, 4] - ^K[1, 3, 3]
Let us see some operations:
sage: Demh[1,2] + Demh[3,0,0] ^K[1, 2, 0] + ^K[3, 0, 0] sage: Demh.an_element() * Demh.an_element() 9*^K[0, 2, 0] - ^K[5, 4, 5] + 3*^K[1, 1, 0] + 4*^K[1, 0, 0] + 6*^K[2, 3, 3] + ^K[0, 0, 0] + ^K[4, 4, 6] - ^K[4, 5, 5] + 2*^K[2, 2, 3] + 4*^K[3, 2, 3] + 6*^K[0, 1, 0] + 4*^K[2, 0, 0] sage: Demh[1,2] * Demh[3,0,0] ^K[4, 2, 0]
We can also have type B, C or D hat key polynomials:
sage: DemhB = A.demazure_hat_basis("B"); Demh The Multivariate polynomial algebra on x over Rational Field on the Demazure hat basis of type A sage: pol = DemhB[2,1,-2]; pol ^K[2, 1, -2] sage: pol.expand() xB[2, 1, -1] + xB[2, 1, 1] + xB[2, 1, 0] + xB[2, 1, -2]
-
facade_for
()¶ Return all the parents
self
is a facade forEXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(CC) sage: A.facade_for() []
The facade_for parents are added dynamically.
-
from_morphism_basis
(neutral_nb_variables, morphism_to_basis, get_basis_keys, get_morphism_on_basis, basis_name, basis_repr, variables_auto_coerce=False, **keywords)¶ Create a basis defined by its morphism to another basis
INPUT:
neutral_nb_variables
– the default number of variables to get theone element
morphism_to_basis
– the basis of the polynomial algebra onwhich the morphism will be defined
get_basis_keys
– a function with :- input:
nb_variables
– the number of variables
- output:
- the set of indexes that will be used to index elements of the basis on the given number of variables
get_morphism_on_basis
– a function with :- input:
-
nb_variables
, the number of variables- output:
- the function that will be used to create the module morphims on basis on the given number of variables
basis_name
– the name of the basis (used in repr)basis_repr
– the basis representation for elements (exemplex
)variables_auto_coerce
– if set toTrue
, a coercion will be created between elements of the basis indexed by vectors of size n to basis on m>n variables by extending the vectors with zeros (example: x[2,2,1] -> x[2,2,1,0,0]. Default isFalse
.**keywords
– the keywords sent to theCombinatorialFreeModule
morphism.
OUTPUT:
- the basis of which elements are indexed by the sets return
by
get_basis_keys
and can be coerced on themorphims_to_basis
basis
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: def get_basis_keys(n): code = "A" + str(n-1); return RootSystem(code).ambient_space(QQ) sage: def get_morphism_on_basis(n): return lambda key: m( [key[i] for i in xrange(n)]) sage: MyBasis = A.from_morphism_basis(1,m,get_basis_keys,get_morphism_on_basis,"My Basis", "x"); MyBasis The Multivariate polynomial algebra on x over Rational Field on the My Basis sage: MyBasis.an_element() x(2, 2, 3) sage: m( MyBasis.an_element() ) x[2, 2, 3]
We have recreated the typed basis.
-
gens
()¶ Return a tuple whose entries are the generators for this object.
In the case of the multivariate polynomial algebra, the number of actual generators is potentatially infinite. So this method actually return a tuple containing the monomial basis which can be seen as a multivariate gerator.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: x The Multivariate polynomial algebra on x over Rational Field on the monomial basis sage: x == A.gens()[0] True sage: x[1,2,3] x[1, 2, 3]
-
grothendieck_negative_basis
(basis_name=None, basis_repr='G')¶ Creates the simple Grothendieck basis where Grothendieck polynomials are indexed by vectors. The Negative stands for that we use a definition of the basis where the variable have negative exposants.
Here is the definition we use. For $v = (v_1, cdots, v_n) in mathbb{N}^n$, we define
$G_v = prod_{1 cdots n} (1 - frac{1}{x_i})^{v_i}$ if $v$ is a partition, i.e, if $v_1 geq v_2 geq cdots geq v_n$.
Otherwise, we have for $ v_i > v_{i+1}$
$G_{cdots v_{i+1} v_i-1 cdots} = G_v pi_i$ where $pi_i$ is the ith isobar divided difference.
The vectors indexing the Grothendieck polynomials can as well been seen as lehmer codes.
INPUT:
basis_name
: (default: canonical name) the name of the basis (used in repr)basis_repr
: (defaul:G
) the basis representation for elements
OUTPUT:
- The Multivariate polynomial algebra on x over
R
on the Grothendieck basis of typegroup_type
with negative exposants indexd by vectors whereR
is the algebra base ring defined in the abstract algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: Groth = A.grothendieck_negative_basis(); Groth The Multivariate polynomial algebra on x over Rational Field on the Grothendieck basis of type A with negative exposants sage: Groth.an_element() 2*G[1, 0, 0] + G[2, 2, 3] + G[0, 0, 0] + 3*G[0, 1, 0] sage: Groth[1,2,3] G[1, 2, 3]
We can convert a Grothendieck polynomial into the Monomial or Ambient Space basis but not the other way around as Grothendieck polynomials are with negative exposants. Note that conversion from monomials with negative exposants into Grothendieck polynomials is NOT implemented
sage: g = Groth[0,1]; g G[0, 1] sage: g.expand() xA[0, 0] - xA[-1, -1] sage: xA = A.monomial_basis_with_type("A") sage: xA(g) xA[0, 0] - xA[-1, -1] sage: x = A.monomial_basis() sage: x(g) x[0, 0] - x[-1, -1] sage: pol = x[0,0] - x[-1,-1] sage: Groth( pol) Traceback (most recent call last): ... TypeError: do not know how to make x (= x[0, 0] - x[-1, -1]) an element of self (=The Multivariate polynomial algebra on x over Rational Field with 2 variables on the Grothendieck basis of type A with negative exposants)
We can add Grothendieck polynomials but not multiply them as this would use conversion from monomials into Grothendieck polynomials
sage: Groth[1,2] + Groth[3,0,0] G[1, 2, 0] + G[3, 0, 0] sage: Groth[1,2] * Groth[3,0,0] Traceback (most recent call last): ... NotImplementedError: The product is not implemented for this basis
-
grothendieck_positive_basis
(basis_name=None, basis_repr='G')¶ Creates the simple Grothendieck basis where Grothendieck polynomials are indexed by vectors. The positive stands for that we use a definition of the basis where variables have positive exposants.
It corresponds to the basis given by
grothendieck_negative_basis
by a change of variables :$x_i = 1 - fract{1}{x_i}$
Here is the definition we use. For $v = (v_1, cdots, v_n) in mathbb{N}^n$, we define
$G_v = x_1^{v_1}x_2^{v_2}cdotsx_n^{v_n}$ if $v$ is a partition, i.e, if $v_1 geq v_2 geq cdots geq v_n$.
Otherwise, we have for $ v_i > v_{i+1}$
$G_{cdots v_{i+1} v_i-1 cdots} = G_v pi_i$ where $pi_i$ is the ith isobar divided difference.
The vectors indexing the Grothendieck polynomials can as well been seen as lehmer codes.
INPUT:
basis_name
: (default: canonical name) the name of the basis (used in repr)basis_repr
: (default:G
) the basis representation for elements
OUTPUT:
- The Multivariate polynomial algebra on x over
R
on the Grothendieck basis of typegroup_type
with positive exposants indexed by vectors whereR
is the algebra base ring defined in the abstract algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: Groth = A.grothendieck_positive_basis(); Groth The Multivariate polynomial algebra on x over Rational Field on the Grothendieck basis of type A, with positive exposants sage: Groth.an_element() 2*G[1, 0, 0] + G[2, 2, 3] + G[0, 0, 0] + 3*G[0, 1, 0] sage: Groth[1,2,3] G[1, 2, 3]
Let us see some coercions:
sage: g = Groth.an_element(); g 2*G[1, 0, 0] + G[2, 2, 3] + G[0, 0, 0] + 3*G[0, 1, 0] sage: g.expand() xA[3, 3, 3] - 3*xA[1, 1, 0] + xA[2, 3, 2] - xA[3, 3, 2] + 5*xA[1, 0, 0] - xA[2, 3, 3] + xA[3, 2, 2] + xA[0, 0, 0] - xA[3, 2, 3] + xA[2, 2, 3] + 3*xA[0, 1, 0] sage: xA = A.monomial_basis_with_type("A") sage: xA(g) xA[3, 3, 3] - 3*xA[1, 1, 0] + xA[2, 3, 2] - xA[3, 3, 2] + 5*xA[1, 0, 0] - xA[2, 3, 3] + xA[3, 2, 2] + xA[0, 0, 0] - xA[3, 2, 3] + xA[2, 2, 3] + 3*xA[0, 1, 0] sage: x = A.monomial_basis() sage: x(g) x[3, 3, 3] - 3*x[1, 1, 0] + x[2, 3, 2] - x[3, 3, 2] + 5*x[1, 0, 0] - x[2, 3, 3] + x[3, 2, 2] + x[0, 0, 0] - x[3, 2, 3] + x[2, 2, 3] + 3*x[0, 1, 0] sage: xA.an_element(); Groth(xA.an_element()) 2*xA[1, 0, 0] + xA[2, 2, 3] + xA[0, 0, 0] + 3*xA[0, 1, 0] G[3, 3, 3] + 3*G[1, 1, 0] - G[2, 3, 2] - G[3, 3, 2] - G[1, 0, 0] + G[2, 3, 3] + G[0, 0, 0] + 3*G[0, 1, 0] + G[2, 2, 3] sage: x.an_element(); Groth(x.an_element()) 2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3] -G[1, 3, 2] - G[3, 2, 1] - G[1, 0, 0] + G[1, 2, 3] + G[0, 0, 0] + G[4, 1, 1] + G[2, 2, 3] + G[2, 3, 1] + G[3, 3, 3] + 3*G[1, 1, 0] - G[4, 1, 3] - 2*G[2, 3, 2] - G[3, 3, 2] + G[2, 3, 3] - G[2, 1, 3] + G[3, 2, 2] - G[3, 1, 3] + 3*G[0, 1, 0] + G[3, 1, 2] + G[1, 3, 3]
Let us see some operations:
sage: Groth[1,2] + Groth[3,0,0] G[1, 2, 0] + G[3, 0, 0] sage: Groth.an_element() * Groth.an_element() 9*G[0, 2, 0] - 12*G[2, 1, 0] + 21*G[1, 1, 0] + 4*G[1, 0, 0] + 6*G[2, 3, 3] + 6*G[0, 1, 0] + 6*G[2, 4, 2] - 6*G[2, 4, 3] - 9*G[1, 2, 0] + G[0, 0, 0] + G[4, 4, 6] + G[4, 5, 5] + 4*G[3, 2, 3] + 2*G[2, 2, 3] - G[4, 5, 6] + 16*G[2, 0, 0] sage: Groth[1,2] * Groth[3,0,0] G[4, 2, 0] - G[5, 2, 0] + G[5, 1, 0]
-
linear_basis_on_vectors
(group_type, basis_name, basis_repr, on_basis_method, extra_parameters=(), **keywords)¶ Create a linear basis on objects inedexed by vectors based on an operation to convert each object (through its vector) into a typed polynomial.
INPUT:
group_type
– the letter that represents the type of the weyl group thatwill be used for the ambient space basis
basis_name
– the name of the basis (used in repr)basis_repr
– the basis representation for elementson_basis_method
– a method that takes a vector (python list) and returns the converted polynomial associated with it Theon_basis_method
should have the following signature :Input :
v
a python list representing the vectorbasis
the ambient space basis used to make the conversioncall_back
a call_back method to use the conversion recursively**keywords
extra parameters that could be used for convertion
- Output :
- a polynomial expanded into the sent
basis
and corresponding to the objected indexed by the sent vectorv
- a polynomial expanded into the sent
extra_parameters
: (default : empty) a tuple containing the extra parameters
to be sent to the
on_basis_method
as tuples(key,val)
**keyword
: parameters used to create the morphism to the ambient space basis, sent toCombinatorialFreeModule.module_morphism
. By default,triangular
is set toupper
: change it explicitly toNone
if you’re basis is not. A defaultcmp
method is also used to order keys : it compares degrees first and then orders vectors by inversed lexical order. This comparasion method is the classic one, used by Schubert, Demazure and Grothendieck polynomials.
OUTPUT :
- a basis named
basis_name
and defined by its conversion to the ambient space basis of typegroup_type
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: def schubert_on_basis(v, basis, call_back): ... for i in xrange(len(v)-1): ... if(v[i]<v[i+1]): ... v[i], v[i+1] = v[i+1] + 1, v[i] ... return call_back(v).divided_difference(i+1) ... return basis(v) sage: myBasis = A.linear_basis_on_vectors("A","MySchub","Y",schubert_on_basis) sage: pol = myBasis[2,1,3];pol Y[2, 1, 3] sage: pol.expand() xA[2, 2, 2] + xA[4, 1, 1] + xA[3, 2, 1] + xA[2, 3, 1] + xA[2, 1, 3] + xA[3, 1, 2] sage: myBasis(A.an_element()) -Y[1, 3, 2] - Y[3, 2, 1] - Y[1, 0, 0] + Y[1, 2, 3] + Y[0, 0, 0] + Y[4, 1, 1] + Y[3, 1, 2] + 3*Y[0, 1, 0] + Y[2, 3, 1] - Y[2, 1, 3]
We have recreated the Schubert basis. Let’s see an example with parameters:
sage: def t_inverse(v, basis, call_back, t1=1, t2=1): return t1/(t2*basis(v)) sage: tInverse = A.linear_basis_on_vectors("A","tInverse","T",t_inverse, (("t1",2), ("t2",4)), triangular = None) sage: pol = tInverse[1,1,2]; pol T[1, 1, 2] sage: pol.expand() 1/2*xA[-1, -1, -2]
-
macdonald_basis_on_vectors
(t1=None, t2=None, q=None, basis_name=None, basis_repr='M')¶ Creates the the basis of non symmetric Macdonald polynomials indexed by vectors.
INPUT:
t1
: (default: symbolic variable t1) the first parameter for the Hecke algebra operatort2
: (default: symbolic variable t2) the second parameter for the Hecke algebra operatorq
: (default: symbolic variable q) the specific q parmater of the polynomialsbasis_name
: (default: canonical name) the name of the basis (used in repr)basis_repr
: (default:M
) the basis representation for elements
OUTPUT:
- The Multivariate polynomial algebra on x over
R
on the Macdolald basis of type A indexed by vectors where ``R ``is the algebra base ring defined in the abstract algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: K.<t1,t2,q> = QQ[] sage: K = K.fraction_field() sage: A = MultivariatePolynomialAlgebra(K) sage: Mac = A.macdonald_basis_on_vectors(); Mac The Multivariate polynomial algebra on x over Fraction Field of Multivariate Polynomial Ring in t1, t2, q over Rational Field on the Macdonald basis of type A (indexed by vectors) sage: Mac.an_element() 2*M[1, 0, 0] + M[2, 2, 3] + M[0, 0, 0] + 3*M[0, 1, 0] sage: Mac[1,2] M[1, 2]
Let us see some coercions:
sage: pol = Mac[1,2];pol M[1, 2] sage: pol.expand() ((t2^2*q+t2^2)/q)*xA[0, 1] + 1/q*xA[1, 2] + t2^3*xA[0, 0] + t2^2*xA[1, 0] + ((t2*q+t2)/q)*xA[1, 1] + t2/q*xA[0, 2] sage: xA = A.monomial_basis_with_type("A") sage: xA(pol) ((t2^2*q+t2^2)/q)*xA[0, 1] + 1/q*xA[1, 2] + t2^3*xA[0, 0] + t2^2*xA[1, 0] + ((t2*q+t2)/q)*xA[1, 1] + t2/q*xA[0, 2] sage: x = A.monomial_basis() sage: x(pol) ((t2^2*q+t2^2)/q)*x[0, 1] + 1/q*x[1, 2] + t2^3*x[0, 0] + t2/q*x[0, 2] + t2^2*x[1, 0] + ((t2*q+t2)/q)*x[1, 1] sage: Mac(x[1,0] + x[0,1]) ((t1*q-t1)/(t1*q+t2))*M[0, 1] + (1/(-t2))*M[1, 0] + (t1-t2)*M[0, 0]
Let us see some operations:
sage: Mac[1,2] + Mac[1,0] M[1, 2] + M[1, 0] sage: Mac[1,2] * Mac[1,0] ((t1^2*t2*q^2-t1^2*t2*q-t2^3*q+t2^3)/(-t1*q-t2))*M[1, 2] + ((t1*q^2+t2*q^2)/(t1*q+t2))*M[1, 3] + ((t1^2*t2*q^3-t1^2*t2*q^2-t2^3*q^2+t2^3*q)/(-t1^2*q^2-2*t1*t2*q-t2^2))*M[2, 2]
-
maxDiffDiv
(pol)¶ Apply the maximum divided difference to the polynomial. As the result is a symmetrical function, it is writen as a symmetrical Schubert polynomial (same as Schur functions). Giving the result in this basis makes the algorithm faster and the result compact.
INPUT:
pol
: the polynomial to apply the maximum divided difference on
OUTPUT:
- the result polynomial in Schubert basis after applying maximum divided difference
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: pol = x[1,2,3] sage: A.maxDiffDiv(pol) -Y[1, 1, 1]
-
maxPi
(pol)¶ Apply the maximum isobaric divided difference to the polynomial. As the result is a symmetrical function, it is writen as a symmetrical Schubert polynomial (same as Schur functions). Giving the result in this basis makes the algorithm faster and the result compact.
INPUT:
pol
: the polynomial to apply the maximum isobaric divided difference on
OUTPUT:
- the result polynomial in Schubert basis after applying maximum isobaric divided difference
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: pol = x[2,1,3] sage: A.maxPi(pol) -Y[2, 2, 2]
-
monomial_basis
(basis_repr=None)¶ Return the monomial basis of
self
.INPUT:
basis_repr
, the representation letter for the elements of the base, by default, it is the main representation for the set of variable :self._main_repr_var
OUTPUT:
The monomial basis of the multivariate polynomial algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: x = A.monomial_basis();x The Multivariate polynomial algebra on x over Rational Field on the monomial basis sage: x[1,2,3] x[1, 2, 3] sage: x( [2,2] ) x[2, 2]
-
monomial_basis_with_type
(group_type, basis_repr=None)¶ Return a typed monomial basis.
Monomials are indexed by a root system lattice. They embed a group type and all divided difference are done within this group type.
INPUT:
group_type
: – the letter that represents type of the weyl group, can be either"A"
,"B"
,"C"
, or"D"
basis_repr
– (optional) the representation letter for the elements of the base, by default, it is using bothself._main_repr_var
andgroup_type
OUTPUT:
The monomial basis with type
group_type
.EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: xA = A.monomial_basis_with_type("A"); xA The Multivariate polynomial algebra on x over Rational Field on the Ambient space basis of type A sage: xB = A.monomial_basis_with_type("B") sage: xB The Multivariate polynomial algebra on x over Rational Field on the Ambient space basis of type B sage: xA == x False sage: xA == xB False sage: xA.group_type() 'A'
Default coercions are created between the typed and untyped basis:
sage: xA( x[1,2,3]) xA[1, 2, 3] sage: x( xA[2,4] ) x[2, 4] sage: xB( x[1,2,3]) xB[1, 2, 3] sage: x( xB[2,4]) x[2, 4]
-
reduce_nb_variables
(pol)¶ Creates a polynomial by removing all last variables with exposant 0 of the given polynomial
INPUT:
pol
: the polynomial to be reduced
OUTPUT:
- a polynomial equal to
pol
and without all the last variables with exposant 0
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: pol = x[1,2,2,0,0] + x[2,5];pol x[2, 5, 0, 0, 0] + x[1, 2, 2, 0, 0] sage: pol.nb_variables() 5 sage: red = A.reduce_nb_variables(pol); red x[2, 5, 0] + x[1, 2, 2] sage: red.nb_variables() 3 sage: red == pol True
-
schubert_basis
(basis_name=None, basis_repr='Y')¶ Creates the simple Schubert basis where schubert polynomials are indexed by vectors.
Here is the definition we use. For $v = (v_1, cdots, v_n) in mathbb{N}^n$, we define
$Y_v = x_1^{v_1}x_2^{v_2}cdotsx_n^{v_n}$ if $v$ is a partition, i.e, if $v_1 geq v_2 geq cdots geq v_n$.
Otherwise, we have for $ v_i > v_{i+1}$
$Y_{cdots v_{i+1} v_i-1 cdots} = Y_v partial_i$ where $partial_i$ is the ith divided difference.
The vectors indexing the Schubert polynomials can as well been seen as lehmer codes.
INPUT:
basis_name
: (default: canonical name) the name of the basis (used in repr)basis_repr
: (defaul:Y
) the basis representation for elements
OUTPUT:
- The Multivariate polynomial algebra on x over
R
on the Schubert basis of typegroup_type
index by vectors whereR
is the algebra base ring defined in the abstract algebra.
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: Schub = A.schubert_basis(); Schub The Multivariate polynomial algebra on x over Rational Field on the Schubert basis of type A sage: Schub.an_element() 2*Y[1, 0, 0] + Y[2, 2, 3] + Y[0, 0, 0] + 3*Y[0, 1, 0] sage: Schub[1,2,3] Y[1, 2, 3]
Let us see the coercions:
sage: Schub.an_element() 2*Y[1, 0, 0] + Y[2, 2, 3] + Y[0, 0, 0] + 3*Y[0, 1, 0] sage: y = Schub.an_element(); y 2*Y[1, 0, 0] + Y[2, 2, 3] + Y[0, 0, 0] + 3*Y[0, 1, 0] sage: y.expand() xA[2, 3, 2] + 5*xA[1, 0, 0] + xA[3, 2, 2] + xA[0, 0, 0] + xA[2, 2, 3] + 3*xA[0, 1, 0] sage: xA = A.monomial_basis_with_type("A") sage: xA(y) xA[2, 3, 2] + 5*xA[1, 0, 0] + xA[3, 2, 2] + xA[0, 0, 0] + xA[2, 2, 3] + 3*xA[0, 1, 0] sage: x = A.monomial_basis() sage: x (y ) x[2, 3, 2] + 5*x[1, 0, 0] + x[3, 2, 2] + x[0, 0, 0] + x[2, 2, 3] + 3*x[0, 1, 0] sage: xA.an_element(); Schub( xA.an_element()) 2*xA[1, 0, 0] + xA[2, 2, 3] + xA[0, 0, 0] + 3*xA[0, 1, 0] -Y[1, 0, 0] + 3*Y[0, 1, 0] + Y[0, 0, 0] - Y[2, 3, 2] + Y[2, 2, 3] sage: x.an_element(); Schub(x.an_element()) 2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3] -Y[1, 3, 2] - Y[3, 2, 1] - Y[1, 0, 0] + Y[1, 2, 3] + Y[0, 0, 0] + Y[4, 1, 1] + Y[3, 1, 2] + 3*Y[0, 1, 0] + Y[2, 3, 1] - Y[2, 1, 3]
Let us see some operations:
sage: Schub[1,2] + Schub[3,0,0] Y[1, 2, 0] + Y[3, 0, 0] sage: Schub.an_element() * Schub.an_element() 9*Y[0, 2, 0] + 21*Y[1, 1, 0] + 4*Y[1, 0, 0] + 6*Y[2, 3, 3] + 6*Y[2, 4, 2] + Y[0, 0, 0] + Y[4, 5, 5] + 4*Y[3, 2, 3] + 2*Y[2, 2, 3] + Y[4, 4, 6] + 6*Y[0, 1, 0] + 16*Y[2, 0, 0] sage: Schub[1,2] * Schub[3,0,0] Y[4, 2, 0] + Y[5, 1, 0]
-
var
(i, nb_variables=0)¶ Return the i_th variable as a monomial base element
INPUT:
i
: the index of the variable to returnnb_variables
: the number of variables of the result, default isi
, ifnb_variables
is lower thani
it is ignored and changed toi
OUTPUT:
- the ith variable as a monomial element
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ); sage: A.var(1) x[1] sage: A.var(3) x[0, 0, 1] sage: A.var(1,3) x[1, 0, 0] sage: A.var(4,3) x[0, 0, 0, 1]
Monomial Basis¶
Monomial basis
This module implements the Monomial Basis of multivariate polynomials.
-
class
multipolynomial_bases.monomial.
FiniteMonomialBasis
(abstract_algebra, basis_repr=None, extra_category=None)¶ Bases:
multipolynomial_bases.basis.FiniteRankPolynomialRingWithBasis
This class implements the monomial basis on a given number of variables. It is obtained automatically by MonomialBasis when a polynomial is created, see :class: MonomialBasis for more details.
It is a realization of both the monomial basis on an unset number of variables and the finite abstract polynomial ring on n variables.
INPUT: -
abstract_polynomial_ring
the realization of Abstract polynomial ring onn
variables. The number of variables is contained in this argument. -basis_repr
(optional), the string representating the monomials,by default it isabstract_polynomial_ring._main_repr_var
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: m3 The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: m3 The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis sage: TestSuite(m3).run()
-
class
Element
(M, x)¶ Bases:
multipolynomial_bases.basis.FiniteRankPolynomialRingWithBasis.Element
Create a combinatorial module element. This should never be called directly, but only through the parent combinatorial free module’s
__call__()
method.TESTS:
sage: F = CombinatorialFreeModule(QQ, ['a','b','c']) sage: B = F.basis() sage: f = B['a'] + 3*B['c']; f B['a'] + 3*B['c'] sage: f == loads(dumps(f)) True
-
FiniteMonomialBasis.
product_on_basis
(vector1, vector2)¶ Return the element of
self
which is the product of basis element indexed byvector1
andvector2
.This method is wrapped by
CombinatorialFreeModule
to compute the productEXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: m3[2,3,1] * m3[1,1,2] x[3, 4, 3]
-
class
-
class
FiniteMonomialBasis.
Element
(M, x) Bases:
multipolynomial_bases.basis.FiniteRankPolynomialRingWithBasis.Element
Create a combinatorial module element. This should never be called directly, but only through the parent combinatorial free module’s
__call__()
method.TESTS:
sage: F = CombinatorialFreeModule(QQ, ['a','b','c']) sage: B = F.basis() sage: f = B['a'] + 3*B['c']; f B['a'] + 3*B['c'] sage: f == loads(dumps(f)) True
-
class
multipolynomial_bases.monomial.
MonomialBasis
(abstract_polynomial_ring, basis_repr=None)¶ Bases:
multipolynomial_bases.basis.PolynomialRingWithBasis
This class implements the monomial basis. Polynomials are seen as sum of monomials. The monomials are indexed by integer vectors that are the exponents of the variables.
The class is called by
multivariate_polinomials.MultivariatePolynomialAlgebra.monomial_basis
It is a representation of
multivariate_polinomials.MultivariatePolynomialAlgebra
The number of variables is not set, this class is a facade for
FiniteMonomialBasis
.INPUT:
-
abstract_polynomial_ring
, The facade abstract polynomial ring of whichself
is a representation -basis_repr
(optional), the string representating the monomials,by default it isabstract_polynomial_ring._main_repr_var
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x> = MultivariatePolynomialAlgebra(QQ) sage: x The Multivariate polynomial algebra on x over Rational Field on the monomial basis sage: x.an_element() 2*x[1, 0, 0] + 3*x[0, 1, 0] + x[0, 0, 0] + x[1, 2, 3] sage: pol = x[2,2,1] + x[3,2]; pol x[2, 2, 1] + x[3, 2, 0]
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: TestSuite(m).run()
-
equivalent_basis
(abstract_polynomial_ring)¶ Returns the monomial basis of another abstract polynomial ring.
INPUT: -
abstract_polynomial_ring
, an abstract polynomial ring which is not the abstract polynomial ring ofself
OUTPUT: The monomial basis of
abstract_polynomial_ring
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis();m The Multivariate polynomial algebra on x over Rational Field on the monomial basis sage: B = MultivariatePolynomialAlgebra(ZZ) sage: mb = m.equivalent_basis(B); mb The Multivariate polynomial algebra on x over Integer Ring on the monomial basis
-
-
class
MonomialBasis.
_divided_difference_wrapper
(module, i, otype='A', t1=1, t2=2)¶ Bases:
multipolynomial_bases.basis.PolynomialRingWithBasis._divided_difference_wrapper
This inner class is used to wrap the divided difference on basis methods. The morphism module on basis method of
CombinatorialFreeModule
only takes the element key as a parameter. But we also need to know the type, number of variables and number of the divided difference.-
divided_difference_on_basis
(key)¶ On basis method for the divided difference, see
FiniteMonomialBasis.divided_difference_morphism
method for more details on what it does.TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: wrapp = m._divided_difference_wrapper(m3,1,"A") sage: key = list(m[1,2,1])[0][0];key [1, 2, 1] sage: wrapp.divided_difference_on_basis(key) -x[1, 1, 1]
-
hat_isobaric_divided_difference_on_basis
(key)¶ On basis method for the isobar divided difference, see
FiniteMonomialBasis.divided_difference_isobar_hat_morphism
method for more details on what it does.TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: wrapp = m._divided_difference_wrapper(m3,1,"A") sage: key = list(m[2,1,1])[0][0];key [2, 1, 1] sage: wrapp.hat_isobaric_divided_difference_on_basis(key) x[1, 2, 1]
-
hecke_generator_on_basis
(key)¶ On basis method for the hecke generator, see
FiniteMonomialBasis.hecke_generator_morphism
method for more details on what it does.TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: wrapp = m._divided_difference_wrapper(m3,1,"A") sage: key = list(m[1,2,1])[0][0];key [1, 2, 1] sage: wrapp.hecke_generator_on_basis(key) -2*x[2, 1, 1]
-
isobaric_divided_difference_on_basis
(key)¶ On basis method for the isobar divided difference, see
FiniteMonomialBasis.divided_difference_isobar_morphism
method for more details on what it does.TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: wrapp = m._divided_difference_wrapper(m3,1,"A") sage: key = list(m[2,1,1])[0][0];key [2, 1, 1] sage: wrapp.isobaric_divided_difference_on_basis(key) x[1, 2, 1] + x[2, 1, 1]
-
product_variable_on_basis
(key)¶ On basis method for a product by a variable.
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: wrapp = m._divided_difference_wrapper(m3,1,"A") sage: key = list(m[2,1,1])[0][0];key [2, 1, 1] sage: wrapp.product_variable_on_basis(key) x[3, 1, 1]
-
si_on_basis
(key)¶ On basis method for the si action
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: m = A.monomial_basis() sage: m3 = m.finite_rank_basis(3) sage: wrapp = m._divided_difference_wrapper(m3,1,"A") sage: key = list(m[2,1,1])[0][0];key [2, 1, 1] sage: wrapp.si_on_basis(key) x[1, 2, 1] sage: wrapp = m._divided_difference_wrapper(m3,1,"B") sage: wrapp.si_on_basis(key) x[-2, 1, 1] sage: wrapp = m._divided_difference_wrapper(m3,1,"C") sage: wrapp.si_on_basis(key) x[-2, 1, 1] sage: wrapp = m._divided_difference_wrapper(m3,2,"D") sage: wrapp.si_on_basis(key) x[-1, -2, 1] sage: wrapp = m._divided_difference_wrapper(m3,2,"E") sage: wrapp.si_on_basis(key) Traceback (most recent call last): ... ValueError: Unknown type E
-
Monomial Basis with group type¶
Monomial basis with type
This module implements the Monomial Basis of multivariate polynomials associated with a group type that determines the actions on monomials.
-
class
multipolynomial_bases.ambient_space_basis.
FiniteRankPolynomialRingWithBasisFromAmbientSpace
(abstract_polynomial_ring, group_code, group_type, basis_name, basis_repr=None, extra_category=None)¶ Bases:
multipolynomial_bases.basis.FiniteRankPolynomialRingWithBasis
This class implements the ambient basis on a given number of variables it is obtained automatically by PolynomialRingWithBasisFromAmbientSpace when a polynomial is created see AbastractPolynomialRing.monomial_basis_with_type for more information
EXAMPLES:
sage: # Fix a nice example
TESTS:
sage: # Fix a nice test
-
class
Element
(M, x)¶ Bases:
multipolynomial_bases.basis.FiniteRankPolynomialRingWithBasis.Element
Create a combinatorial module element. This should never be called directly, but only through the parent combinatorial free module’s
__call__()
method.TESTS:
sage: F = CombinatorialFreeModule(QQ, ['a','b','c']) sage: B = F.basis() sage: f = B['a'] + 3*B['c']; f B['a'] + 3*B['c'] sage: f == loads(dumps(f)) True
-
FiniteRankPolynomialRingWithBasisFromAmbientSpace.
from_monomial_morphism
()¶ Returns the module morphism from monomial basis to this basis
EXAMPLES:
sage: # Fix a nice example
-
FiniteRankPolynomialRingWithBasisFromAmbientSpace.
group_type
()¶ Returns the group type acting on
self
.EXAMPLES:
sage: # Fix a nice example
-
FiniteRankPolynomialRingWithBasisFromAmbientSpace.
product_on_basis
(key1, key2)¶ Returns the element of
self
which is the product of basis element indexed bykey1
andkey2
.EXAMPLES:
sage: # Fix a nice example
-
FiniteRankPolynomialRingWithBasisFromAmbientSpace.
to_monomial_morphism
()¶ Returns the module morphism from this basis to the monomial basis
EXAMPLES:
sage: # Fix a nice example
-
FiniteRankPolynomialRingWithBasisFromAmbientSpace.
weyl_group
()¶ Returns the weyl group acting on
self
.EXAMPLES:
sage: # Fix a nice example
-
class
-
class
FiniteRankPolynomialRingWithBasisFromAmbientSpace.
Element
(M, x) Bases:
multipolynomial_bases.basis.FiniteRankPolynomialRingWithBasis.Element
Create a combinatorial module element. This should never be called directly, but only through the parent combinatorial free module’s
__call__()
method.TESTS:
sage: F = CombinatorialFreeModule(QQ, ['a','b','c']) sage: B = F.basis() sage: f = B['a'] + 3*B['c']; f B['a'] + 3*B['c'] sage: f == loads(dumps(f)) True
-
class
multipolynomial_bases.ambient_space_basis.
PolynomialRingWithBasisFromAmbientSpace
(abstract_polynomial_ring, group_type, basis_name, basis_repr=None)¶ Bases:
multipolynomial_bases.basis.PolynomialRingWithBasis
This class implements the ambient space basis. This is really close to the monomial basis as polynomials are also seen as sum of monomials. But now, each monomial is indexed by an element of the ambient space basis and so has a group type embeded in it.
The class is called by
multivariate_polinomials.MultivariatePolynomialAlgebra.monomial_basis_with_type
It is a representation of
multivariate_polinomials.MultivariatePolynomialAlgebra
As the number of variable is not set, then the ambient space basis is not directly created, but the group type is kept.
INPUT:
-
abstract_polynomial_ring
, The facade abstract polynomial ring of whichself
is a representation -group_type
the group type of the ambient space bases (A
,B
,C
orD
) -basis_name
, the name of the basis -basis_repr
(optional), the string representating the monomials,by default it isabstract_polynomial_ring._main_repr_var
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: ma = A.monomial_basis_with_type("A"); ma The Multivariate polynomial algebra on x over Rational Field on the Ambient space basis of type A
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: ma = A.monomial_basis_with_type("A") sage: TestSuite(ma).run()
-
equivalent_basis
(abstract_polynomial_ring)¶ Returns the ambien space basis of another abstract polynomial ring.
INPUT: -
abstract_polynomial_ring
, an abstract polynomial ring which is not the abstract polynomial ring ofself
OUTPUT: The ambient space basis of
abstract_polynomial_ring
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A = MultivariatePolynomialAlgebra(QQ) sage: ma = A.monomial_basis_with_type("A"); ma The Multivariate polynomial algebra on x over Rational Field on the Ambient space basis of type A sage: AZ = MultivariatePolynomialAlgebra(ZZ) sage: maZ = ma.equivalent_basis(AZ); maZ The Multivariate polynomial algebra on x over Integer Ring on the Ambient space basis of type A
-
group_type
()¶ Return the group type of
self
.EXAMPLES:
sage: # Fix a nice example
-
-
class
PolynomialRingWithBasisFromAmbientSpace.
_divided_difference_wrapper
(module, i, t1=1, t2=2)¶ Bases:
multipolynomial_bases.basis.PolynomialRingWithBasis._divided_difference_wrapper
TESTS:
sage: # Fix a nice test
-
divided_difference_on_basis
(key)¶ Returns ...
EXAMPLES:
sage: # Fix a nice example
-
hat_isobaric_divided_difference_on_basis
(key)¶ EXAMPLES:
sage: class Foo: ....: def __init__(self, x): ....: self._x = x ....: @cached_method ....: def f(self,*args): ....: return self._x^2 sage: a = Foo(2) sage: a.f.cache {} sage: a.f() 4 sage: a.f.cache {((), ()): 4}
-
hecke_generator_on_basis
(key)¶ EXAMPLES:
sage: class Foo: ....: def __init__(self, x): ....: self._x = x ....: @cached_method ....: def f(self,*args): ....: return self._x^2 sage: a = Foo(2) sage: a.f.cache {} sage: a.f() 4 sage: a.f.cache {((), ()): 4}
-
isobaric_divided_difference_on_basis
(key)¶ Returns ...
EXAMPLES:
sage: # Fix a nice example
-
si_on_basis
(key)¶
-