Section9.89

]>
Book Contents Previous Section 9.88 XPBWPolynomial Next Section 9.90 XPolynomialRing Book Index

## 9.89 XPolynomial

The XPolynomial domain constructor implements multivariate polynomials whose set of variables is Symbol. These variables do not commute. The only parameter of this construtor is the coefficient ring which may be non-commutative. However, coefficients and variables commute. The representation of the polynomials is recursive. The abbreviation for XPolynomial is XPOLY.

Other constructors like XPolynomialRing, XRecursivePolynomial as well as XDistributedPolynomial, LiePolynomial and XPBWPolynomial implement multivariate polynomials in non-commutative variables.

We illustrate now some of the facilities of the XPOLY domain constructor.

Define a polynomial ring over the integers.

poly := XPolynomial(Integer)

XPolynomialInteger

Type: Domain

Define a first polynomial,

pr: poly := 2*x + 3*y-5

-5+x 2+y 3

Type: XPolynomial Integer

and a second one.

pr2: poly := pr*pr

25+x(-20+x 4+y 6)+y(-30+x 6+y 9)

Type: XPolynomial Integer

Rewrite pr in a distributive way,

pd := expand pr

-5+2 x+3 y

Type: XDistributedPolynomial(Symbol,Integer)

compute its square,

pd2 := pd*pd

25-20 x-30 y+4 x 2+6 x y+6 y x+9 y 2

Type: XDistributedPolynomial(Symbol,Integer)

and checks that:

expand(pr2) - pd2

0

Type: XDistributedPolynomial(Symbol,Integer)

We define:

qr := pr**3

-125+x(150+x(-60+x 8+y 12)+y(-90+x 12+y 18))+y(225+x(-90+x 12+y 18)+y(-135+x 18+y 27))

Type: XPolynomial Integer

and:

qd := pd**3

-125+150 x+225 y-60 x 2-90 x y-90 y x-135 y 2+8 x 3+12 x 2 y+12 x y x+18 x y 2+12 y x 2+18 y x y+18 y 2 x+27 y 3

Type: XDistributedPolynomial(Symbol,Integer)

We truncate qd at degree 3:

trunc(qd,2)

-125+150 x+225 y-60 x 2-90 x y-90 y x-135 y 2

Type: XDistributedPolynomial(Symbol,Integer)

The same for qr:

trunc(qr,2)

-125+x(150+x(-60)+y(-90))+y(225+x(-90)+y(-135))

Type: XPolynomial Integer

We define:

Word := OrderedFreeMonoid Symbol

OrderedFreeMonoidSymbol

Type: Domain

and:

w: Word := x*y**2

x y 2

Type: OrderedFreeMonoid Symbol

The we can compute the right-quotient of qr by r:

rquo(qr,w)

18

Type: XPolynomial Integer

and the shuffle-product of pr by r:

sh(pr,w::poly)

x(x y y 4+y(x y 2+y(-5+x 2+y 9)))+y x y y 3

Type: XPolynomial Integer
Book Contents Previous Section 9.88 XPBWPolynomial Next Section 9.90 XPolynomialRing Book Index