contrib/operatingsystem: Add chdir/mkdir for ABCL.
[maxima.git] / share / sym / rtest_sym.mac
blob96d0f30e621cf8cd0dde9951c5aca11d319f971d
1 /* Here are all examples (I hope) from the online documentation
2    in our usual regression test format.  Note that the `doconline'
3    file has descriptions for `arite', `card_orbit' and `card_stab',
4    which are missing in the info file (inadvertence?) */
6 (load("sym/sym.mac"),'done);
7 done$
9 arite(4,2,[[[1,2,4]],[[1,5,5],[1,2]],[[1,2,2],[1,3]]]);
10 [[[1,2,4]],[[1,5,5],[3,2]],[[1,2,2],[3,3]]]$
12 card_orbit([5,2,1,3],6);
13 60$
15 /* TODO: Should be able to use `eq' instead of `?eq' */
16 card_stab([a,a,c,b,b],?eq);
18 card_stab([1,1,2,3,3],"=");
21 expand(comp2ele(3,[4,g1]));
22 [4,g1,g1^2-h2,h3-2*g1*h2+g1^3]$
23 expand(comp2ele(3,[2]));
24 [2,h1,h1^2-h2,0]$
25 expand(comp2pui(3,[4,g]));
26 [4,g,2*h2-g^2,3*h3-3*g*h2+g^3]$
27 comp2ele(3,[2]);
28 [2,h1,h1^2-h2,0]$
30 /* The examples omit trailing zeros, but according to the general
31   definition they are left in the list (cf. subsection
32   `Représentations en machine' of section 1.1 in docsym.tex. */
33 cont2part(2*a^3*b*x^4*y+x^5,[x,y]);
34 [[1,5,0],[2*a^3*b,4,1]]$
36 explose(2*a^3*b*x^4*y,[x,y,z]);
37 2*a^3*b*y*z^4+2*a^3*b*x*z^4+2*a^3*b*y^4*z+2*a^3*b*x^4*z+2*a^3*b*x*y^4
38              +2*a^3*b*x^4*y$
39 contract(%,[x,y,z]);
40 2*a^3*b*x^4*y$
42 expand(direct([z^2-e1*z+e2,z^2-f1*z+f2],z,b*v+a*u,[[u,v],[a,b]]));
43 /* The docs have here z instead of y, but the code (in direct.lisp)
44    shows that y is always used as dummy variable for the resulting
45    polynomial.  So this is a typo in the docs. */
46 y^2-e1*f1*y-4*e2*f2+e1^2*f2+e2*f1^2$
47 /* The other examples for `direct' are ok. */
48 expand(direct([z^3-e1*z^2+e2*z-e3,z^2-f1*z+f2],z,b*v+a*u,[[u,v],[a,b]]));
49 y^6-2*e1*f1*y^5-6*e2*f2*y^4+2*e1^2*f2*y^4+2*e2*f1^2*y^4+e1^2*f1^2*y^4
50    +9*e3*f1*f2*y^3+5*e1*e2*f1*f2*y^3-2*e1^3*f1*f2*y^3-2*e3*f1^3*y^3
51    -2*e1*e2*f1^3*y^3+9*e2^2*f2^2*y^2-6*e1^2*e2*f2^2*y^2+e1^4*f2^2*y^2
52    -9*e1*e3*f1^2*f2*y^2-6*e2^2*f1^2*f2*y^2+3*e1^2*e2*f1^2*f2*y^2
53    +2*e1*e3*f1^4*y^2+e2^2*f1^4*y^2-27*e2*e3*f1*f2^2*y+9*e1^2*e3*f1*f2^2*y
54    +3*e1*e2^2*f1*f2^2*y-e1^3*e2*f1*f2^2*y+15*e2*e3*f1^3*f2*y
55    -2*e1^2*e3*f1^3*f2*y-e1*e2^2*f1^3*f2*y-2*e2*e3*f1^5*y-27*e3^2*f2^3
56    +18*e1*e2*e3*f2^3-4*e1^3*e3*f2^3-4*e2^3*f2^3+e1^2*e2^2*f2^3
57    +27*e3^2*f1^2*f2^2-9*e1*e2*e3*f1^2*f2^2+e1^3*e3*f1^2*f2^2+e2^3*f1^2*f2^2
58    -9*e3^2*f1^4*f2+e1*e2*e3*f1^4*f2+e3^2*f1^6$
59 expand(direct([z^2-e1*z+e2,z^2-f1*z+f2],z,a+u,[[u],[a]]));
60 y^4-2*f1*y^3-2*e1*y^3+2*f2*y^2+f1^2*y^2+3*e1*f1*y^2+2*e2*y^2+e1^2*y^2
61    -2*f1*f2*y-2*e1*f2*y-e1*f1^2*y-2*e2*f1*y-e1^2*f1*y-2*e1*e2*y+f2^2+e1*f1*f2
62    -2*e2*f2+e1^2*f2+e2*f1^2+e1*e2*f1+e2^2$
64 ele2polynome([2,e1,e2],z);
65 z^2-e1*z+e2$
66 polynome2ele(x^7-14*x^5+56*x^3-56*x+22,x);
67 [7,0,-14,0,56,0,-56,-22]$
68 ele2polynome([7,0,-14,0,56,0,-56,-22],x);
69 x^7-14*x^5+56*x^3-56*x+22$
71 expand(elem([3,7],x^4-2*x*y,[x,y]));
72 28*e3+2*e2^2-198*e2+2401$
74 explose(a*x +1,[x,y,z]);
75 a*z+a*y+a*x+1$
77 kostka([3,3,3],[2,2,2,1,1,1]);
80 lgtreillis(4,2);
81 [[3,1],[2,2]]$
83 ltreillis(4,2);
84 [[4,0],[3,1],[2,2]]$
86 mon2schur([1,1,1]);
87 x1*x2*x3$
88 mon2schur([3]);
89 x1*x2*x3+x1^2*x2+x1^3$
90 mon2schur([1,2]);
91 2*x1*x2*x3+x1^2*x2$
93 expand(multi_elem([[2,e1,e2],[2,f1,f2]],a*x+a^2+x^3,[[x,y],[a,b]]));
94 -2*f2+f1^2+e1*f1-3*e1*e2+e1^3$
96 multi_orbit(a*x+b*y,[[x,y],[a,b]]);
97 [b*y+a*x,a*y+b*x]$
98 multi_orbit(x+y+2*a,[[x,y],[a,b,c]]);
99 [y+x+2*c,y+x+2*b,y+x+2*a]$
101 multi_pui([[2,p1,p2],[2,t1,t2]],a*x+a^2+x^3,[[x,y],[a,b]]);
102 /* The documentation had the exponent 3 at the wrong place.
103    The full form of the polynomial is
104    (a+b)*(x+y)+a^2+b^2+x^3+y^3 and
105    x^3+y^3=(3*(x+y)*(x^2+y^2)-(x+y)^3)/2=(3*p1*p2-p1^3)/2 */
106 t2+p1*t1+3*p1*p2/2-p1^3/2$
108 multsym([[3,1],[2,1,1]],[[5,2]],2);
109 /* doconline has [[10, 3, 1], [15, 2, 1], [15, 3, 0]], but the
110    different order of the monomials (or their orbits or their
111    corresponding sums) does not matter. */
112 [[10,3,1],[15,3,0],[15,2,1]]$
114 orbit(a*x+b*y,[x,y]);
115 [a*y+b*x,b*y+a*x]$
116 orbit(2*x+x^2,[x,y]);
117 [y^2+2*y,x^2+2*x]$
119 part2cont([[2*a^3*b,4,1]],[x,y]);
120 2*a^3*b*x^4*y$
122 partpol(-a*(x+y)+3*x*y,[x,y]);
123 [[3,1,1],[-a,1,0]]$
125 pui;
128 factor(pui([3,a,b],u*x*y*z,[x,y,z]));
129 (2*p3-3*a*b+a^3)*u/6$
131 pui2comp(2,[]);
132 [2,p1,(p2+p1^2)/2]$
133 ratsimp(pui2comp(3,[2,a1]));
134 [2,a1,(p2+a1^2)/2,(2*p3+3*a1*p2+a1^3)/6]$
136 polynome2ele(x^3-4*x^2+5*x-1,x);
137 [3,4,5,1]$
138 ele2pui(3,%);
139 [3,4,6,7]$
140 pui2polynome(x,%);
141 x^3-4*x^2+5*x-1$
143 ([[x,y],[a,b]],pui_direct(multi_orbit(a*x+b*y,%%),%%,[2,2]));
144 [a*x,4*a*b*x*y+a^2*x^2]$
145 ([[x,y],[a,b]],pui_direct(multi_orbit(a*x+b*y,%%),%%,[3,2]));
146 [2*a*x,4*a*b*x*y+2*a^2*x^2,3*a^2*b*x^2*y+2*a^3*x^3,
147  12*a^2*b^2*x^2*y^2+4*a^3*b*x^3*y+2*a^4*x^4,
148  10*a^3*b^2*x^3*y^2+5*a^4*b*x^4*y+2*a^5*x^5,
149  40*a^3*b^3*x^3*y^3+15*a^4*b^2*x^4*y^2+6*a^5*b*x^5*y+2*a^6*x^6]$
150 pui_direct([y+x+2*c,y+x+2*b,y+x+2*a],[[x,y],[a,b,c]],[2,3]);
151 [3*x+2*a,6*x*y+3*x^2+4*a*x+4*a^2,
152  9*x^2*y+12*a*x*y+3*x^3+6*a*x^2+12*a^2*x+8*a^3]$
154 ratsimp(puireduc(3,[2]));
155 [2,p1,p2,(3*p1*p2-p1^3)/2]$
157 resolvante:unitaire;
158 unitaire$
159 resolvante(x^7-14*x^5+56*x^3-56*x+22,x,x^3-1,[x]);
160 y^7+7*y^6-539*y^5-1841*y^4+51443*y^3+315133*y^2+376999*y+125253$
161 resolvante:lineaire;
162 lineaire$
163 resolvante(x^4-1,x,x1+2*x2+3*x3,[x1,x2,x3]);
164 y^24+80*y^20+7520*y^16+1107200*y^12+49475840*y^8+344489984*y^4+655360000$
165 resolvante:general;
166 general$
167 resolvante(x^4-1,x,x1+2*x2+3*x3,[x1,x2,x3]);
168 y^24+80*y^20+7520*y^16+1107200*y^12+49475840*y^8+344489984*y^4+655360000$
169 resolvante(x^4-1,x,x1+2*x2+3*x3,[x1,x2,x3,x4]);
170 y^24+80*y^20+7520*y^16+1107200*y^12+49475840*y^8+344489984*y^4+655360000$
171 direct([x^4-1],x,x1+2*x2+3*x3,[[x1,x2,x3]]);
172 y^24+80*y^20+7520*y^16+1107200*y^12+49475840*y^8+344489984*y^4+655360000$
173 resolvante:lineaire;
174 lineaire$
175 resolvante(x^4-1,x,x1+x2+x3,[x1,x2,x3]);
176 y^4-1$
177 resolvante:symetrique;
178 symetrique$
179 resolvante(x^4-1,x,x1+x2+x3,[x1,x2,x3]);
180 y^4-1$
181 resolvante:alternee;
182 alternee$
183 resolvante(x^4+x+1,x,x1-x2,[x1,x2]);
184 y^12+8*y^8+26*y^6-112*y^4+216*y^2+229$
185 resolvante:produit;
186 produit$
187 resolvante(x^7-7*x+3,x,x1*x2*x3,[x1,x2,x3]);
188 y^35-7*y^33-1029*y^29+135*y^28+7203*y^27-756*y^26+1323*y^24+352947*y^23
189     -46305*y^22-2463339*y^21+324135*y^20-30618*y^19-453789*y^18-40246444*y^17
190     +282225202*y^15-44274492*y^14+155098503*y^12+12252303*y^11+2893401*y^10
191     -171532242*y^9+6751269*y^8+2657205*y^7-94517766*y^6-3720087*y^5
192     +26040609*y^3+14348907$
193 resolvante:symetrique;
194 symetrique$
195 resolvante(x^7-7*x+3,x,x1*x2*x3,[x1,x2,x3]);
196 y^35-7*y^33-1029*y^29+135*y^28+7203*y^27-756*y^26+1323*y^24+352947*y^23
197     -46305*y^22-2463339*y^21+324135*y^20-30618*y^19-453789*y^18-40246444*y^17
198     +282225202*y^15-44274492*y^14+155098503*y^12+12252303*y^11+2893401*y^10
199     -171532242*y^9+6751269*y^8+2657205*y^7-94517766*y^6-3720087*y^5
200     +26040609*y^3+14348907$
201 resolvante:cayley;
202 cayley$
203 resolvante(x^5-4*x^2+x+1,x,a,[]);
204 x^6-40*x^5+4080*x^4-92928*x^3+3772160*x^2+37880832*x+93392896$
205 resolvante_bipartite(x^6+108,x);
206 y^10-972*y^8+314928*y^6-34012224*y^4$
207 resolvante_diedrale(x^5-3*x^4+1,x);
208 x^15-21*x^12-81*x^11-21*x^10+207*x^9+1134*x^8+2331*x^7-945*x^6-4970*x^5
209     -18333*x^4-29079*x^3-20745*x^2-25326*x-697$
210 resolvante_produit_sym(x^5+3*x^4+2*x-1,x);
211 [y^5+3*y^4+2*y-1,y^10-2*y^8-21*y^7-31*y^6-14*y^5-y^4+14*y^3+3*y^2+1,
212  y^10+3*y^8+14*y^7-y^6-14*y^5-31*y^4-21*y^3-2*y^2+1,y^5-2*y^4-3*y-1,y-1]$
213 resolvante:produit;
214 produit$
215 resolvante(x^5+3*x^4+2*x-1,x,a*b*c,[a,b,c]);
216 y^10+3*y^8+14*y^7-y^6-14*y^5-31*y^4-21*y^3-2*y^2+1$
218 schur2comp(h1*h2-h3,[h1,h2,h3]);
219 s[1,2]$
220 schur2comp(a*h3,[h3]);
221 s[3]*a$
223 treillis(4);
224 [[4],[3,1],[2,2],[2,1,1],[1,1,1,1]]$
226 treinat([5]);
227 [[5]]$
228 treinat([1,1,1,1,1]);
229 [[5],[4,1],[3,2],[3,1,1],[2,2,1],[2,1,1,1],[1,1,1,1,1]]$
230 treinat([3,2]);
231 [[5],[4,1],[3,2]]$
233 /* symtest.mac ends here */