//This is the ideal Fourier invariants. ring rQ = 0,(q1,q2,q3,q4,q5),dp; ideal Invariants = q4^2-q3*q5, q3*q4-q2*q5, q3^2-q2*q4, q2*q3-q1*q5, q2^2-q1*q4; // This is the inverse of the Fourier transform. matrix ptoq[6][5] = 1/256,15/128,15/64,105/256,15/64, 15/256,105/128,45/64,-105/256,-75/64, 15/128,45/64,-45/32,15/128,15/32, 15/64,15/32,0,-165/64,15/8, 45/128,-45/64,-45/32,405/128,-45/32, 15/64,-45/32,15/8,-45/64,0; // This is the ring of probability distributions. ring rP = 0,(p1,p2,p3,p4,p5,p6),dp; //This is the Fourier transform. matrix qtop[5][6] = 1,1,1,1,1,1, 1,7/15,1/5,1/15,-1/15,-1/5, 1,1/5,-1/5,0,-1/15,2/15, 1,-1/15,1/105,-11/105,3/35,-1/35, 1,-1/3,1/15,2/15,-1/15,0; ideal Fourier = qtop*transpose(maxideal(1)); // This is the list of polynomial invariants. map F = rQ, Fourier; ideal PInvariants = F(Invariants); // This is the polynomial parametrization. ring r = 0,(e0,e1),dp; ideal P = e0^5+3*e1^5, 15*e0^4*e1+15*e0*e1^4+30*e1^5, 30*e0^3*e1^2+30*e0^2*e1^3+60*e1^5, 60*e0^3*e1^2+120*e0*e1^4+60*e1^5, 180*e0^2*e1^3+90*e0*e1^4+90*e1^5, 60*e0^2*e1^3+180*e0*e1^4; // This checks that the polynomial parametrization // lies on the probability simplex. // It requires suma.sing. Most likely, you should // change the directory where you saved this file. // If you do have this file, you should uncomment // the following two lines. // < "/home/lgp/singular/suma.sing"; // Suma(Substitute(1,P)); // This checks that the PInvariants vanish at // the polynomial parametrization. map Evaluate = rP, P; // The following command takes a lot of space and time to // finish for larger models. // ideal Z = Evaluate(PInvariants); setring rP; ideal Z; int i; for (i=1; i<= size(PInvariants); i++) { i; Z = PInvariants[i]; setring r; Evaluate(Z); setring rP; }