CoCalc Public Filesscratch / toto.ipynbOpen with one click!
Author: Pierre Guillot
Views : 55
Description: mon script toto
Compute Environment: Ubuntu 18.04 (Deprecated)
In [2]:
def f(x): return x**2
In [3]:
f(4)
16
In [1]:
2+2
4
In [2]:
x
x
In [3]:
%display typeset
In [4]:
x
xx
In [5]:
R.<x1, x2, x3, x4, x5>= QQ[]
In [6]:
R
Q[x1,x2,x3,x4,x5]\Bold{Q}[x_{1}, x_{2}, x_{3}, x_{4}, x_{5}]
In [8]:
f= x1^2*(x2*x5 + x3*x4);f
x12x3x4+x12x2x5x_{1}^{2} x_{3} x_{4} + x_{1}^{2} x_{2} x_{5}
In [9]:
X= [0] + list(R.gens()); X
[0,x1,x2,x3,x4,x5]\left[0, x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\right]
In [10]:
g= lambda i, j, k, l, m : X[i]^2*(X[j]*X[k] + X[l]*X[m])
In [11]:
g(1, 2, 5, 3, 4)
x12x3x4+x12x2x5x_{1}^{2} x_{3} x_{4} + x_{1}^{2} x_{2} x_{5}
In [12]:
F= g(1, 2, 5, 4, 3) + g(2, 1, 3, 4, 5) + g(3, 1, 5, 2, 4) + g(4, 1, 2, 3, 5) + g(5, 1, 4, 2, 3)
In [13]:
F
x1x22x3+x12x3x4+x2x32x4+x1x2x42+x12x2x5+x1x32x5+x22x4x5+x3x42x5+x2x3x52+x1x4x52x_{1} x_{2}^{2} x_{3} + x_{1}^{2} x_{3} x_{4} + x_{2} x_{3}^{2} x_{4} + x_{1} x_{2} x_{4}^{2} + x_{1}^{2} x_{2} x_{5} + x_{1} x_{3}^{2} x_{5} + x_{2}^{2} x_{4} x_{5} + x_{3} x_{4}^{2} x_{5} + x_{2} x_{3} x_{5}^{2} + x_{1} x_{4} x_{5}^{2}
In [14]:
L= [F, F(X[2], X[1], X[3], X[4], X[5]), F(X[3], X[2], X[1], X[4], X[5]), F(X[4], X[2], X[3], X[1], X[5]) , F(X[5], X[2], X[3], X[4], X[1]), F(X[1], X[5], X[3], X[4], X[2]) ]
In [15]:
len(L)
66
In [16]:
S.<T>= R[]
In [17]:
graal= prod([T - foo for foo in L])
In [19]:
c= graal.coefficients()
In [21]:
c[6]
11
In [22]:
c[0]
WARNING: Some output was deleted.
In [23]:
symmetrize(c[0])
s18s44+2s17s22s42s58s18s3s42s5+s16s24s528s17s22s3s52+16s18s32s52+s15s22s3s4313s16s2s44+s14s24s3s4s54s15s22s32s4s522s15s23s42s5+88s16s2s3s42s5+12s17s43s59s14s25s52+72s15s23s3s52144s16s2s32s52+12s16s22s4s5248s17s3s4s52+2s13s22s33s422s14s34s42+s12s25s4315s13s23s3s43+5s14s2s32s43+65s14s22s44+5s15s3s44+s12s24s33s56s13s22s34s5+8s14s35s59s12s25s3s4s5+43s13s23s32s4s528s14s2s33s4s5+76s13s24s42s5287s14s22s3s42s554s15s32s42s5148s15s2s43s5+27s12s26s52210s13s24s3s52+370s14s22s32s52+152s15s33s5276s14s23s4s52+304s15s2s3s4s52+86s16s42s5214s15s22s53+56s16s3s53+s1s22s35s4+s25s32s4215s1s23s33s42+5s12s2s34s424s26s43+44s1s24s3s43+19s12s22s32s43+6s13s33s43128s12s23s44118s13s2s3s44+17s14s454s25s33s5+25s1s23s34s536s12s2s35s5+18s26s3s4s595s1s24s32s4s5+93s12s22s33s4s512s13s34s4s578s1s25s42s5+168s12s23s3s42s5+447s13s2s32s42s5+514s13s22s43s5+180s14s3s43s527s27s52+198s1s25s3s52185s12s23s32s52700s13s2s33s52+141s12s24s4s52397s13s22s3s4s52676s14s32s4s52294s14s2s42s52+50s13s23s53200s14s2s3s53468s15s4s53+s3813s2s36s4+65s22s34s42+5s1s35s42128s23s32s43118s1s2s33s43+48s24s44+384s1s22s3s44+82s12s32s4416s12s2s4512s22s35s5+38s1s36s5+12s23s33s4s529s1s2s34s4s5+196s24s3s42s5528s1s22s32s42s5172s12s33s42s5384s1s23s43s51174s12s2s3s43s5276s13s44s5150s24s32s52+525s1s22s33s52+375s12s34s5299s25s4s52+15s1s23s3s4s52+1995s12s2s32s4s52610s12s22s42s52+1470s13s3s42s52125s12s22s3s53+250s13s32s53+2300s13s2s4s53+625s14s54+17s34s4316s2s32s44192s22s45192s1s3s45124s35s4s5+590s2s33s42s5160s22s3s43s5+780s1s32s43s5+1760s1s2s44s5125s2s34s52725s22s32s4s522050s1s33s4s52+1200s23s42s52850s1s2s3s42s521450s12s43s52+625s1s2s32s531750s1s22s4s533500s12s3s4s533125s12s2s54+256s461600s3s44s5+3250s32s42s522000s2s43s521250s2s3s4s53+7500s1s42s53+3125s22s54+3125s1s3s549375s4s54s_{1}^{8} s_{4}^{4} + 2 s_{1}^{7} s_{2}^{2} s_{4}^{2} s_{5} - 8 s_{1}^{8} s_{3} s_{4}^{2} s_{5} + s_{1}^{6} s_{2}^{4} s_{5}^{2} - 8 s_{1}^{7} s_{2}^{2} s_{3} s_{5}^{2} + 16 s_{1}^{8} s_{3}^{2} s_{5}^{2} + s_{1}^{5} s_{2}^{2} s_{3} s_{4}^{3} - 13 s_{1}^{6} s_{2} s_{4}^{4} + s_{1}^{4} s_{2}^{4} s_{3} s_{4} s_{5} - 4 s_{1}^{5} s_{2}^{2} s_{3}^{2} s_{4} s_{5} - 22 s_{1}^{5} s_{2}^{3} s_{4}^{2} s_{5} + 88 s_{1}^{6} s_{2} s_{3} s_{4}^{2} s_{5} + 12 s_{1}^{7} s_{4}^{3} s_{5} - 9 s_{1}^{4} s_{2}^{5} s_{5}^{2} + 72 s_{1}^{5} s_{2}^{3} s_{3} s_{5}^{2} - 144 s_{1}^{6} s_{2} s_{3}^{2} s_{5}^{2} + 12 s_{1}^{6} s_{2}^{2} s_{4} s_{5}^{2} - 48 s_{1}^{7} s_{3} s_{4} s_{5}^{2} + 2 s_{1}^{3} s_{2}^{2} s_{3}^{3} s_{4}^{2} - 2 s_{1}^{4} s_{3}^{4} s_{4}^{2} + s_{1}^{2} s_{2}^{5} s_{4}^{3} - 15 s_{1}^{3} s_{2}^{3} s_{3} s_{4}^{3} + 5 s_{1}^{4} s_{2} s_{3}^{2} s_{4}^{3} + 65 s_{1}^{4} s_{2}^{2} s_{4}^{4} + 5 s_{1}^{5} s_{3} s_{4}^{4} + s_{1}^{2} s_{2}^{4} s_{3}^{3} s_{5} - 6 s_{1}^{3} s_{2}^{2} s_{3}^{4} s_{5} + 8 s_{1}^{4} s_{3}^{5} s_{5} - 9 s_{1}^{2} s_{2}^{5} s_{3} s_{4} s_{5} + 43 s_{1}^{3} s_{2}^{3} s_{3}^{2} s_{4} s_{5} - 28 s_{1}^{4} s_{2} s_{3}^{3} s_{4} s_{5} + 76 s_{1}^{3} s_{2}^{4} s_{4}^{2} s_{5} - 287 s_{1}^{4} s_{2}^{2} s_{3} s_{4}^{2} s_{5} - 54 s_{1}^{5} s_{3}^{2} s_{4}^{2} s_{5} - 148 s_{1}^{5} s_{2} s_{4}^{3} s_{5} + 27 s_{1}^{2} s_{2}^{6} s_{5}^{2} - 210 s_{1}^{3} s_{2}^{4} s_{3} s_{5}^{2} + 370 s_{1}^{4} s_{2}^{2} s_{3}^{2} s_{5}^{2} + 152 s_{1}^{5} s_{3}^{3} s_{5}^{2} - 76 s_{1}^{4} s_{2}^{3} s_{4} s_{5}^{2} + 304 s_{1}^{5} s_{2} s_{3} s_{4} s_{5}^{2} + 86 s_{1}^{6} s_{4}^{2} s_{5}^{2} - 14 s_{1}^{5} s_{2}^{2} s_{5}^{3} + 56 s_{1}^{6} s_{3} s_{5}^{3} + s_{1} s_{2}^{2} s_{3}^{5} s_{4} + s_{2}^{5} s_{3}^{2} s_{4}^{2} - 15 s_{1} s_{2}^{3} s_{3}^{3} s_{4}^{2} + 5 s_{1}^{2} s_{2} s_{3}^{4} s_{4}^{2} - 4 s_{2}^{6} s_{4}^{3} + 44 s_{1} s_{2}^{4} s_{3} s_{4}^{3} + 19 s_{1}^{2} s_{2}^{2} s_{3}^{2} s_{4}^{3} + 6 s_{1}^{3} s_{3}^{3} s_{4}^{3} - 128 s_{1}^{2} s_{2}^{3} s_{4}^{4} - 118 s_{1}^{3} s_{2} s_{3} s_{4}^{4} + 17 s_{1}^{4} s_{4}^{5} - 4 s_{2}^{5} s_{3}^{3} s_{5} + 25 s_{1} s_{2}^{3} s_{3}^{4} s_{5} - 36 s_{1}^{2} s_{2} s_{3}^{5} s_{5} + 18 s_{2}^{6} s_{3} s_{4} s_{5} - 95 s_{1} s_{2}^{4} s_{3}^{2} s_{4} s_{5} + 93 s_{1}^{2} s_{2}^{2} s_{3}^{3} s_{4} s_{5} - 12 s_{1}^{3} s_{3}^{4} s_{4} s_{5} - 78 s_{1} s_{2}^{5} s_{4}^{2} s_{5} + 168 s_{1}^{2} s_{2}^{3} s_{3} s_{4}^{2} s_{5} + 447 s_{1}^{3} s_{2} s_{3}^{2} s_{4}^{2} s_{5} + 514 s_{1}^{3} s_{2}^{2} s_{4}^{3} s_{5} + 180 s_{1}^{4} s_{3} s_{4}^{3} s_{5} - 27 s_{2}^{7} s_{5}^{2} + 198 s_{1} s_{2}^{5} s_{3} s_{5}^{2} - 185 s_{1}^{2} s_{2}^{3} s_{3}^{2} s_{5}^{2} - 700 s_{1}^{3} s_{2} s_{3}^{3} s_{5}^{2} + 141 s_{1}^{2} s_{2}^{4} s_{4} s_{5}^{2} - 397 s_{1}^{3} s_{2}^{2} s_{3} s_{4} s_{5}^{2} - 676 s_{1}^{4} s_{3}^{2} s_{4} s_{5}^{2} - 294 s_{1}^{4} s_{2} s_{4}^{2} s_{5}^{2} + 50 s_{1}^{3} s_{2}^{3} s_{5}^{3} - 200 s_{1}^{4} s_{2} s_{3} s_{5}^{3} - 468 s_{1}^{5} s_{4} s_{5}^{3} + s_{3}^{8} - 13 s_{2} s_{3}^{6} s_{4} + 65 s_{2}^{2} s_{3}^{4} s_{4}^{2} + 5 s_{1} s_{3}^{5} s_{4}^{2} - 128 s_{2}^{3} s_{3}^{2} s_{4}^{3} - 118 s_{1} s_{2} s_{3}^{3} s_{4}^{3} + 48 s_{2}^{4} s_{4}^{4} + 384 s_{1} s_{2}^{2} s_{3} s_{4}^{4} + 82 s_{1}^{2} s_{3}^{2} s_{4}^{4} - 16 s_{1}^{2} s_{2} s_{4}^{5} - 12 s_{2}^{2} s_{3}^{5} s_{5} + 38 s_{1} s_{3}^{6} s_{5} + 12 s_{2}^{3} s_{3}^{3} s_{4} s_{5} - 29 s_{1} s_{2} s_{3}^{4} s_{4} s_{5} + 196 s_{2}^{4} s_{3} s_{4}^{2} s_{5} - 528 s_{1} s_{2}^{2} s_{3}^{2} s_{4}^{2} s_{5} - 172 s_{1}^{2} s_{3}^{3} s_{4}^{2} s_{5} - 384 s_{1} s_{2}^{3} s_{4}^{3} s_{5} - 1174 s_{1}^{2} s_{2} s_{3} s_{4}^{3} s_{5} - 276 s_{1}^{3} s_{4}^{4} s_{5} - 150 s_{2}^{4} s_{3}^{2} s_{5}^{2} + 525 s_{1} s_{2}^{2} s_{3}^{3} s_{5}^{2} + 375 s_{1}^{2} s_{3}^{4} s_{5}^{2} - 99 s_{2}^{5} s_{4} s_{5}^{2} + 15 s_{1} s_{2}^{3} s_{3} s_{4} s_{5}^{2} + 1995 s_{1}^{2} s_{2} s_{3}^{2} s_{4} s_{5}^{2} - 610 s_{1}^{2} s_{2}^{2} s_{4}^{2} s_{5}^{2} + 1470 s_{1}^{3} s_{3} s_{4}^{2} s_{5}^{2} - 125 s_{1}^{2} s_{2}^{2} s_{3} s_{5}^{3} + 250 s_{1}^{3} s_{3}^{2} s_{5}^{3} + 2300 s_{1}^{3} s_{2} s_{4} s_{5}^{3} + 625 s_{1}^{4} s_{5}^{4} + 17 s_{3}^{4} s_{4}^{3} - 16 s_{2} s_{3}^{2} s_{4}^{4} - 192 s_{2}^{2} s_{4}^{5} - 192 s_{1} s_{3} s_{4}^{5} - 124 s_{3}^{5} s_{4} s_{5} + 590 s_{2} s_{3}^{3} s_{4}^{2} s_{5} - 160 s_{2}^{2} s_{3} s_{4}^{3} s_{5} + 780 s_{1} s_{3}^{2} s_{4}^{3} s_{5} + 1760 s_{1} s_{2} s_{4}^{4} s_{5} - 125 s_{2} s_{3}^{4} s_{5}^{2} - 725 s_{2}^{2} s_{3}^{2} s_{4} s_{5}^{2} - 2050 s_{1} s_{3}^{3} s_{4} s_{5}^{2} + 1200 s_{2}^{3} s_{4}^{2} s_{5}^{2} - 850 s_{1} s_{2} s_{3} s_{4}^{2} s_{5}^{2} - 1450 s_{1}^{2} s_{4}^{3} s_{5}^{2} + 625 s_{1} s_{2} s_{3}^{2} s_{5}^{3} - 1750 s_{1} s_{2}^{2} s_{4} s_{5}^{3} - 3500 s_{1}^{2} s_{3} s_{4} s_{5}^{3} - 3125 s_{1}^{2} s_{2} s_{5}^{4} + 256 s_{4}^{6} - 1600 s_{3} s_{4}^{4} s_{5} + 3250 s_{3}^{2} s_{4}^{2} s_{5}^{2} - 2000 s_{2} s_{4}^{3} s_{5}^{2} - 1250 s_{2} s_{3} s_{4} s_{5}^{3} + 7500 s_{1} s_{4}^{2} s_{5}^{3} + 3125 s_{2}^{2} s_{5}^{4} + 3125 s_{1} s_{3} s_{5}^{4} - 9375 s_{4} s_{5}^{4}
In [ ]: