Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

weighted univariate polynomials

I have a polynomial algebra in n variables k[x_1,...,x_n]. I know how assign different degrees to each of the generators as in

sage: P = PolynomialRing(QQ, 'x,y,z', order = TermOrder('wdegrevlex', (2,3,4)))
sage: P.inject_variables()
Defining x, y, z
sage: z.degree()
sage:
4

However if I want to do this with only one variable this does not work

sage: P = PolynomialRing(QQ, 'x', order = TermOrder('wdegrevlex', (2)))
sage: P.inject_variables()
Defining x
sage: x.degree()
1

I wander if I can do this in an uniform way cause I need to use a class that takes an arbitrary number of variables.

weighted univariate polynomials

I have a polynomial algebra in n variables k[x_1,...,x_n]. I know how assign different degrees to each of the generators as in

sage: P = PolynomialRing(QQ, 'x,y,z', order = TermOrder('wdegrevlex', (2,3,4)))
sage: P.inject_variables()
Defining x, y, z
sage: z.degree()
sage:
4

However if I want to do this with only one variable this does not work

sage: P = PolynomialRing(QQ, 'x', order = TermOrder('wdegrevlex', (2)))
sage: P.inject_variables()
Defining x
sage: x.degree()
1

I wander if I can do this in an uniform way cause I need to use a class that takes an arbitrary number of variables.

weighted univariate polynomials

I have a polynomial algebra in n variables k[x_1,...,x_n]. I know how assign different degrees to each of the generators as in

sage: P = PolynomialRing(QQ, 'x,y,z', order = TermOrder('wdegrevlex', (2,3,4)))
sage: P.inject_variables()
Defining x, y, z
sage: z.degree()
sage:
4

However if I want to do this with only one variable this does not work

sage: P = PolynomialRing(QQ, 'x', order = TermOrder('wdegrevlex', (2)))
sage: P.inject_variables()
Defining x
sage: x.degree()
1

I wander if I can do this in an uniform way cause I need to use a class that takes an arbitrary number of variables.