|
7.2.4.2 poly expressions (plural)
A polynomial expression is (optional parts in square brackets):
-
a monomial (there are NO spaces allowed inside a monomial)
| [coefficient] ring_variable [exponent] [ring_variable [exponent] ...]
| monomials which contain an indexed ring variable
must be built from ring_variable and coefficient
with the operations * and ^
-
an identifier of type poly
-
a function returning poly
-
polynomial expressions combined by the arithmetic operations
+ , - , * , / , or ^ .
-
a type cast to poly
Example:
| ring r=0,(x,y),dp;
def R=nc_algebra(1,1); // make it a Weyl algebra
setring R;
R;
==> // coefficients: QQ
==> // number of vars : 2
==> // block 1 : ordering dp
==> // : names x y
==> // block 2 : ordering C
==> // noncommutative relations:
==> // yx=xy+1
yx; // not correct input
==> xy
y*x; // correct input
==> xy+1
poly f = 10x2*y3 + 2y2*x^2 - 2*x*y + y - x + 2;
lead(f);
==> 10x2y3
leadmonom(f);
==> x2y3
simplify(f,1); // normalize leading coefficient
==> x2y3+1/5x2y2+3/5xy-1/10x+1/10y+3/5
cleardenom(f);
==> 10x2y3+2x2y2+6xy-x+y+6
|
|