Double Polynomials¶
This module implements the ring of abstract polynomials over a double set of variables
This ring is actually an MultivariatePolynomialAlgebra
over antoher MultivariatePolynomialAlgebra
but the module provides methods that are specific to double multivariate polynomials to make it easy
to use
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra
sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ); A
The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field
sage: A.an_element()
y[0]*x[0, 0, 0] + 3*y[0]*x[0, 1, 0] + 2*y[0]*x[1, 0, 0] + y[0]*x[1, 2, 3]
x
and y
correspond to the monomial basis on the two sets of variables:
sage: x
The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the monomial basis
sage: y
The Multivariate polynomial algebra on y over Rational Field on the monomial basis
sage: x.an_element()
y[0]*x[0, 0, 0] + 3*y[0]*x[0, 1, 0] + 2*y[0]*x[1, 0, 0] + y[0]*x[1, 2, 3]
sage: y.an_element()
y[0, 0, 0] + 3*y[0, 1, 0] + 2*y[1, 0, 0] + y[1, 2, 3]
By default, all actions are done on the x
variable set:
sage: pol = x[1,2,3] + x[2,2,4]*y[1,2,3]; pol
y[0]*x[1, 2, 3] + (y[1,2,3])*x[2, 2, 4]
sage: pol.divided_difference(1)
(-y[0])*x[1, 1, 3]
You can obtain the polynomial ring on the y
variables which correspond
to the coeff ring:
sage: Coeffs = A.coeffs_ring(); Coeffs
The Multivariate polynomial algebra on y over Rational Field
You can change the bases of the x
polynomial by the usual coercion system:
sage: Schub = A.schubert_basis(); Schub
The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the Schubert basis of type A
sage: Schub(A.an_element())
y[0]*Yx[0, 0, 0] + 3*y[0]*Yx[0, 1, 0] + (-y[0])*Yx[1, 0, 0] + y[0]*Yx[1, 2, 3] + (-y[0])*Yx[1, 3, 2] + (-y[0])*Yx[2, 1, 3] + y[0]*Yx[2, 3, 1] + y[0]*Yx[3, 1, 2] + (-y[0])*Yx[3, 2, 1] + y[0]*Yx[4, 1, 1]
You can also change the base for the y
:
sage: YSchub = Coeffs.schubert_basis(); YSchub
The Multivariate polynomial algebra on y over Rational Field on the Schubert basis of type A
sage: pol = y[1,2,3] * x[2,2,4]; pol
(y[1,2,3])*x[2, 2, 4]
sage: pol.change_coeffs_bases(YSchub)
(Yy[1,2,3]-Yy[1,3,2]-Yy[2,1,3]+Yy[2,3,1]+Yy[3,1,2]-Yy[3,2,1]+Yy[4,1,1])*x[2, 2, 4]
Also, you can obtain the ring where the roles of \(x\) and \(y\) are exchanged:
sage: A2 = A.inversed_ring(); A2
The Multivariate polynomial algebra on y over The Multivariate polynomial algebra on x over Rational Field
sage: A2.an_element()
x[0]*y[0, 0, 0] + 3*x[0]*y[0, 1, 0] + 2*x[0]*y[1, 0, 0] + x[0]*y[1, 2, 3]
There is a coercion between A
and A2
:
sage: pol = x[2,2,4]*y[1,2,3]; pol
(y[1,2,3])*x[2, 2, 4]
sage: A2(pol)
(x[2,2,4])*y[1, 2, 3]
But this coercion doesn’t allow operations including polynomials from A
and A2
as the coercion
only exists between abstract polynomial rings but not between the concrete bases : sage coercion system
doesn’t look for a parent where the coercion could be made:
sage: A.an_element() + A2.an_element()
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for +: 'The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field with 3 variables on the monomial basis' and 'The Multivariate polynomial algebra on y over The Multivariate polynomial algebra on x over Rational Field with 3 variables on the monomial basis'
sage: A2(A.an_element()) + A2.an_element()
(2*x[0,0,0]+3*x[0,1,0]+2*x[1,0,0]+x[1,2,3])*y[0, 0, 0] + 3*x[0]*y[0, 1, 0] + 2*x[0]*y[1, 0, 0] + x[0]*y[1, 2, 3]
Some special bases have been implemented for double polynomials:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra
sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ)
sage: DSchub = A.double_schubert_basis()
sage: DSchub[0,1]
y[0]*YY[0, 1]
sage: DSchub[0,1].expand()
(-yA[0,1]-yA[1,0])*xA[0, 0] + y[0]*xA[0, 1] + y[0]*xA[1, 0]
sage: DSchub[0,1]^2
(yA[0,0,1]-yA[0,1,0])*YY[0, 1] + y[0]*YY[0, 2] + y[0]*YY[1, 1]
sage: DSchub(x[0,1])
(yA[0,1])*YY[0, 0] + y[0]*YY[0, 1] + (-y[0])*YY[1, 0]
sage: DSchub(y[0,1]*x[0,1])
(yA[0,2])*YY[0, 0] + (y[0,1])*YY[0, 1] + (-y[0,1])*YY[1, 0]
sage: DSchub(y[0,1])
(y[0,1])*YY[0, 0]
sage: DGroth = A.double_grothendieck_basis()
sage: DGroth
The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the Double Grothendieck basis of type A
sage: DGroth[0,1]
y[0]*GG[0, 1]
sage: DGroth[0,1].expand()
(-yA[1,1])*xA[-1, -1] + y[0]*xA[0, 0]
sage: DGroth[3,2,3].isobaric_divided_difference(1)
y[0]*GG[2, 2, 3]
sage: DGroth[3,2,3].hat_isobaric_divided_difference(1)
y[0]*GG[2, 2, 3] + (-y[0])*GG[3, 2, 3]
-
class
multipolynomial_bases.double_multivariate_polynomials.
DoubleGrothendieckBasis
(abstract_polynomial_ring, monomial_basis_with_type, basis_name, basis_repr)¶ Bases:
multipolynomial_bases.linear_basis_on_vectors.LinearBasisOnVectors
Explain this class
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field sage: DGroth = A.double_grothendieck_basis() sage: DGroth The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the Double Grothendieck basis of type A sage: DGroth[0,1] y[0]*GG[0, 1] sage: DGroth[0,1].expand() (-yA[1,1])*xA[-1, -1] + y[0]*xA[0, 0] sage: DGroth[3,2,3].isobaric_divided_difference(1) y[0]*GG[2, 2, 3] sage: DGroth[3,2,3].hat_isobaric_divided_difference(1) y[0]*GG[2, 2, 3] + (-y[0])*GG[3, 2, 3]
-
on_basis_method
(x, basis, call_back)¶
-
-
DoubleGrothendieckBasis.
_divided_difference_wrapper
¶ alias of
DoubleGrothendieckBasis._divided_difference_wrapper
-
class
multipolynomial_bases.double_multivariate_polynomials.
DoubleMultivariatePolynomialAlgebra_generic
(R, repr_var1='x', repr_var2='y', inversed_ring=None)¶ Bases:
multipolynomial_bases.multivariate_polynomials.MultivariatePolynomialAlgebra_generic
Implementation for double polynomial algebra
- INPUT:
R
: the base ring of the algebrarepr_var1
, a string representing the main variable set, default is \(x\)repr_var2
, a string representing the secondary variable set, default is \(y\)inversed_ring
, the ring where the roles of the two sets of variables are inversed. By default, nothing is sent and the ring is created, the field is then used to avoid infinite recursion
OUTPUT:
- The abstract ring of multivariate polynomials on
repr_var1
over te abstract ring of multivariate polynomials onrepr_var2
overR
TESTS:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ) sage: TestSuite(A).run()
-
coeffs_ring
()¶ r returns the multivariate polynomial ring on the second set of variables used as coefficients of the main ring on the first set of variables
OUPUT:
- the ring of multivariate polynomials on the second set of variables
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field sage: A.coeffs_ring() The Multivariate polynomial algebra on y over Rational Field
-
double_grothendieck_basis
(group_type='A', basis_name=None, basis_repr='GG')¶
-
double_schubert_basis
(group_type='A', basis_name=None, basis_repr='YY')¶
-
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,y> = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field sage: x The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the monomial basis sage: y The Multivariate polynomial algebra on y over Rational Field on the monomial basis sage: A.gens() [The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the monomial basis, The Multivariate polynomial algebra on y over Rational Field on the monomial basis] sage: A.gens()[0] == x True sage: A.gens()[1] == y True
-
inversed_ring
()¶ r returns the ring of multivariate polynomials where the roles of the two sets of variables are exchanged
OUTPUT:
- the ring of multivariate polynomials on the second set of variables over the ring of multivariate polynomials on the first set of variables
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field sage: A2 = A.inversed_ring(); A2 The Multivariate polynomial algebra on y over The Multivariate polynomial algebra on x over Rational Field There is a coercion between `D` and `D2`:: sage: pol = x.an_element() * y.an_element(); pol (y[0,0,0]+3*y[0,1,0]+2*y[1,0,0]+y[1,2,3])*x[0, 0, 0] + (3*y[0,0,0]+9*y[0,1,0]+6*y[1,0,0]+3*y[1,2,3])*x[0, 1, 0] + (2*y[0,0,0]+6*y[0,1,0]+4*y[1,0,0]+2*y[1,2,3])*x[1, 0, 0] + (y[0,0,0]+3*y[0,1,0]+2*y[1,0,0]+y[1,2,3])*x[1, 2, 3] sage: A2(pol) (x[0,0,0]+3*x[0,1,0]+2*x[1,0,0]+x[1,2,3])*y[0, 0, 0] + (3*x[0,0,0]+9*x[0,1,0]+6*x[1,0,0]+3*x[1,2,3])*y[0, 1, 0] + (2*x[0,0,0]+6*x[0,1,0]+4*x[1,0,0]+2*x[1,2,3])*y[1, 0, 0] + (x[0,0,0]+3*x[0,1,0]+2*x[1,0,0]+x[1,2,3])*y[1, 2, 3]
But this coercion doesn’t allow for operations including polynomials from both
A
andA2
as the coercion only exists between abstract polynomial rings but not between the concrete bases : sage coercion system doesn’t look for a parent where the coercion could be made
-
class
multipolynomial_bases.double_multivariate_polynomials.
DoubleSchubertBasis
(abstract_polynomial_ring, monomial_basis_with_type, basis_name, basis_repr)¶ Bases:
multipolynomial_bases.linear_basis_on_vectors.LinearBasisOnVectors
Explain this class
EXAMPLES:
sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ); A The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field sage: DSchub = A.double_schubert_basis(); DSchub The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field on the Double Schubert basis of type A sage: DSchub[0,1] y[0]*YY[0, 1] sage: DSchub[0,1].expand() (-yA[0,1]-yA[1,0])*xA[0, 0] + y[0]*xA[0, 1] + y[0]*xA[1, 0] sage: DSchub[0,1]^2 (yA[0,0,1]-yA[0,1,0])*YY[0, 1] + y[0]*YY[0, 2] + y[0]*YY[1, 1] sage: DSchub(x[0,1]) (yA[0,1])*YY[0, 0] + y[0]*YY[0, 1] + (-y[0])*YY[1, 0] sage: DSchub(y[0,1]*x[0,1]) (yA[0,2])*YY[0, 0] + (y[0,1])*YY[0, 1] + (-y[0,1])*YY[1, 0] sage: DSchub(y[0,1]) (y[0,1])*YY[0, 0]
-
cmp
(key1, key2)¶
-
on_basis_method
(x, basis, call_back)¶
-
-
class
multipolynomial_bases.double_multivariate_polynomials.
Finite_rank_double_bases
(s=None)¶ Bases:
sage.categories.category.Category
r This category is an extra category for bases of double multivariate polynomials. It is used to add extra methods on double polynomials.
- OUTPUT:
- The category of finite rank bases for double polynomials
- EXAMPLES::
- sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ) sage: A._extra_bases_category The category of finite rank bases for double polynomials sage: A.an_element().parent().category() Join of Category of graded algebras with basis over The Multivariate polynomial algebra on y over Rational Field and The category of finite rank bases for double polynomials and Category of realizations of The Multivariate polynomial algebra on x over The Multivariate polynomial algebra on y over Rational Field with 3 variables
TESTS:
sage: from multipolynomial_bases.double_multivariate_polynomials import Finite_rank_double_bases sage: C = Finite_rank_double_bases() sage: C The category of finite rank bases for double polynomials sage: from multipolynomial_bases import MultivariatePolynomialAlgebra sage: A.<x,y> = MultivariatePolynomialAlgebra(QQ) sage: TestSuite(A.an_element().parent().category()).run()
-
ElementMethods
¶
-
super_categories
()¶ TESTS:
sage: from multipolynomial_bases.double_multivariate_polynomials import Finite_rank_double_bases sage: Finite_rank_double_bases().super_categories() []
-
Finite_rank_double_bases.
ElementMethods