9.90 XPolynomialRingΒΆ

The XPolynomialRing domain constructor implements generalized polynomials with coefficients from an arbitrary Ring (not necessarily commutative) and whose exponents are words from an arbitrary OrderedMonoid (not necessarily commutative too). Thus these polynomials are (finite) linear combinations of words.

This constructor takes two arguments. The first one is a Ring and the second is an OrderedMonoid. The abbreviation for XPolynomialRing is XPR.

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

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

Define the free ordered monoid generated by the symbols.

Word := OrderedFreeMonoid(Symbol)
\[\]
OrderedFreeMonoidSymbol

Type: Domain

Define the linear combinations of these words with integer coefficients.

poly:= XPR(Integer,Word)
\[\]
XPolynomialRing(Integer,OrderedFreeMonoidSymbol)

Type: Domain

Then we define a first element from poly.

p:poly := 2 * x - 3 * y + 1
\[\]
1+2x-3y

Type: XPolynomialRing(Integer,OrderedFreeMonoid Symbol)

And a second one.

q:poly := 2 * x + 1
\[\]
1+2x

Type: XPolynomialRing(Integer,OrderedFreeMonoid Symbol)

We compute their sum,

p + q
\[\]
2+4x-3y

Type: XPolynomialRing(Integer,OrderedFreeMonoid Symbol)

their product,

p * q
\[\]
1+4x-3y+4x2-6yx

Type: XPolynomialRing(Integer,OrderedFreeMonoid Symbol)

and see that variables do not commute.

(p+q)^2-p^2-q^2-2*p*q
\[\]
-6xy+6yx

Type: XPolynomialRing(Integer,OrderedFreeMonoid Symbol)

Now we define a ring of square matrices,

M := SquareMatrix(2,Fraction Integer)
\[\]
SquareMatrix(2,FractionInteger)

Type: Domain

and the linear combinations of words with these matrices as coefficients.

poly1:= XPR(M,Word)
\[\]
XPolynomialRing(SquareMatrix(2,FractionInteger),  OrderedFreeMonoidSymbol)

Type: Domain

Define a first matrix,

m1:M := matrix [ [i*j^2 for i in 1..2] for j in 1..2]
\[\]
[1248]

Type: SquareMatrix(2,Fraction Integer)

a second one,

m2:M := m1 - 5/4
\[\]
[-1424274]

Type: SquareMatrix(2,Fraction Integer)

and a third one.

m3: M := m2^2
\[\]
[12916132685716]

Type: SquareMatrix(2,Fraction Integer)

Define a polynomial,

pm:poly1 := m1*x + m2*y + m3*z - 2/3
\[\]
[-2300-23]+[1248]x+[-1424274]y+[12916132685716]z

Type: XPolynomialRing( SquareMatrix(2,Fraction Integer), OrderedFreeMonoid Symbol)

a second one,

qm:poly1 := pm - m1*x
\[\]
[-2300-23]+[-1424274]y+[12916132685716]z

Type: XPolynomialRing( SquareMatrix(2,Fraction Integer), OrderedFreeMonoid Symbol)

and the following power.

qm^3
\[\]
[-82700-827]+[-13831639]y+[434523104385712]z+[-1298-26-52-8578]y2+[-319932-8314-8312-2646732]yz+[-319932-8314-8312-2646732]zy+[-103169128-64094-64092-820977128]z2+[319964831883142646764]y3+[1031692566409864094820977256]y2z+[1031692566409864094820977256]yzy+[3178239102479534112879534164254477871024]yz2+[1031692566409864094820977256]zy2+[3178239102479534112879534164254477871024]zyz+[3178239102479534112879534164254477871024]z2y+[98625409409612326223256123262231287888938974096]z3

Type: XPolynomialRing(SquareMatrix(2,Fraction Integer),OrderedFreeMonoid Symbol)