Truncated multivariate polynomials¶
Truncated Multivariate polynomials
EXAMPLES:
sage: from msinvar import TMPoly
sage: R=TMPoly(QQ,2,'x',prec=(2,2))
sage: R.inject_variables(verbose=False)
sage: (x0+x1).Exp()
1 + x0 + x1 + x0^2 + x0*x1 + x1^2 + x0^2*x1 + x0*x1^2 + x0^2*x1^2
-
class
msinvar.tm_polynomials.
TMPolynomial
(parent, x)[source]¶ Bases:
sage.rings.polynomial.multi_polynomial_element.MPolynomial_polydict
The element class for truncated multivariate polynomials. The parent class is
TMPolynomialRing
.Implementation details:
The parent should have a method
le_prec()
to test if a given degree should be present.Truncation is performed in the
__init__()
method.Arithmetic operations are inherited from
MPolynomial_polydict
.We implement Adams operation adams, exp, log and plethystic Exp, Log.
Function for the twisted multilpication is given by self.parent().prod_twist
-
coeff
(e)[source]¶ Return the coefficient of degree e monomial as an element of the base_ring.
Note that coefficient returns an element of the polynomial ring.
-
subs
(**kw)[source]¶ Fixes some given variables in a given multivariate polynomial and returns the changed multivariate polynomials. The polynomial itself is not affected. The variable,value pairs for fixing are to be provided as a dictionary of the form {variable:value}.
This is a special case of evaluating the polynomial with some of the variables constants and the others the original variables.
INPUT:
fixed
- (optional) dictionary of inputs**kw
- named parameters
OUTPUT: new MPolynomial
EXAMPLES:
sage: R.<x,y> = QQbar[] sage: f = x^2 + y + x^2*y^2 + 5 sage: f((5,y)) 25*y^2 + y + 30 sage: f.subs({x:5}) 25*y^2 + y + 30
-
class
msinvar.tm_polynomials.
TMPolynomialRing
(base_ring=Rational Field, n=1, names='x', order='negdegrevlex', prec=None, prod_twist=None)[source]¶ Bases:
sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict
Truncated Multivariate polynomial ring.
Multivariate polynomials up to degree
prec
, whereprec
is a degree vector or an integer (total degree). Monomials of degreeprec
are included. We implement Adams operations, plethystic Exp and Log (we introduce the category of lambda ringsmsinvar.lambda_rings.LambdaRings
and embed our ring into it).This is the parent class for truncated multivariate polynomials. It has an alias
TMPoly
. The element class isTMPolynomial
.PARAMETERS:
base_ring
– the base of our polynomial algebra.n
– the number of vairables.names
– names of variables; can be just ‘x’ or ‘x,y,..’.prec
- precision vector (or integer, or None) for truncationorder
– the order of variables.prod_twist
- function that maps exponents (d,e) to the base_ring. The new product is x^d*x^e=prod_twist(d,e)*x^(d+e)
EXAMPLES:
sage: from msinvar import TMPoly sage: R=TMPoly(QQ,2,prec=(2,2)); R Multivariate Polynomial Ring in x0, x1 over Rational Field truncated at degree (2, 2) sage: x=R.gens(); (x[0]+x[1])**3 3*x0^2*x1 + 3*x0*x1^2 sage: QR=Frac(PolynomialRing(QQ,'y,t')) sage: S=TMPoly(QR,2,'x',prec=(2,2)) sage: y,t=QR.gens(); x=S.gens() sage: (y*x[0]+x[1]).adams(2) y^2*x0^2 + x1^2 sage: (y*x[0]).Exp() 1 + y*x0 + y^2*x0^2 sage: R=TMPoly(QQ,1,prec=2, prod_twist=lambda a,b:2) sage: x=R.gen(); x*x 2*x^2
-
Element
¶ alias of
msinvar.tm_polynomials.TMPolynomial
-
msinvar.tm_polynomials.
TMPoly
¶