CoCalc Shared Filesscratch / toto.ipynb
Author: Pierre Guillot
Views : 11
Description: mon script toto
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
$x$
In [5]:
R.<x1, x2, x3, x4, x5>= QQ[]
In [6]:
R
$\Bold{Q}[x_{1}, x_{2}, x_{3}, x_{4}, x_{5}]$
In [8]:
f= x1^2*(x2*x5 + x3*x4);f
$x_{1}^{2} x_{3} x_{4} + x_{1}^{2} x_{2} x_{5}$
In [9]:
X= [0] + list(R.gens()); X
$\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)
$x_{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
$x_{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)
$6$
In [16]:
S.<T>= R[]
In [17]:
graal= prod([T - foo for foo in L])
In [19]:
c= graal.coefficients()
In [21]:
c[6]
$1$
In [22]:
c[0]
WARNING: Some output was deleted.
In [23]:
symmetrize(c[0])
$s_{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 [ ]: