aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/XPOLY.ht
blob: 7278e432a9f54dc5504321335ba1b4441c1a2b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\XPolynomialXmpTitle}{XPolynomial}
\newcommand{\XPolynomialXmpNumber}{9.89}
%
% =====================================================================
\begin{page}{XPolynomialXmpPage}{9.89 XPolynomial}
% =====================================================================
\beginscroll
The \spadtype{XPolynomial} domain constructor implements multivariate polynomials
whose set of variables is \spadtype{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 \spadtype{XPolynomial} is \spadtype{XPOLY}.

Other constructors like \spadtype{XPolynomialRing}, \spadtype{XRecursivePolynomial} 
\spadtype{XDistributedPolynomial},
\spadtype{LiePolynomial} and
\spadtype{XPBWPolynomial}
implement multivariate polynomials
in non-commutative variables.

We illustrate now some of the facilities of the \spadtype{XPOLY} domain constructor.


\xtc{
Define a polynomial ring over the integers.
}{
\spadpaste{poly := XPolynomial(Integer) \bound{poly}}
}

\xtc{
Define a first polynomial,
}{
\spadpaste{pr: poly := 2*x + 3*y-5  \free{poly} \bound{pr}}
}


\xtc{
and a second one.
}{
\spadpaste{pr2: poly := pr*pr  \free{poly} \bound{pr2}}
}

\xtc{
Rewrite {\bf pr} in a distributive way,
}{
\spadpaste{pd  := expand pr   \free{pr} \bound{pd}}
}

\xtc{
compute its square,
}{
\spadpaste{pd2 := pd*pd   \free{pd} \bound{pd2}}
}

\xtc{
and checks that:
}{
\spadpaste{expand(pr2) - pd2 \free{pr2} \free{pd2}}
}


\xtc{
We define:
}{
\spadpaste{qr :=  pr**3 \free{pr} \bound{qr}}
}

\xtc{
and:
}{
\spadpaste{qd :=  pd**3 \free{pd} \bound{qd}}
}

\xtc{
We truncate {\bf qd} at degree {\bf 3}:
}{
\spadpaste{ trunc(qd,2) \free{qd}}
}

\xtc{
The same for {\bf qr}:
}{
\spadpaste{trunc(qr,2) \free{qr}}
}

\xtc{
We define:
}{
\spadpaste{Word := OrderedFreeMonoid Symbol \bound{Word}}
}

\xtc{
and:
}{
\spadpaste{w: Word := x*y**2 \free{Word} \bound{w}}
}

\xtc{
The we can compute the right-quotient of {\bf qr} by {\bf r}:
}{
\spadpaste{rquo(qr,w) \free{qr} \free{w}}
}

\xtc{
and the shuffle-product of {\bf pr} by {\bf r}:
}{
\spadpaste{sh(pr,w::poly) \free{pr} \free{w}}
}
\endscroll
\autobuttons
\end{page}
%