//This is the ideal Fourier invariants. ring rQ = 0,(q1,q2,q3,q4),dp; ideal Invariants = q2*q3-q1*q4; // This is the inverse of the Fourier transform. matrix ptoq[5][4] = 1/8,1/8,5/8,1/8, 1/4,-1/4,1/4,-1/4, 1/8,1/8,-3/8,1/8, 1/4,1/4,-1/4,-1/4, 1/4,-1/4,-1/4,1/4; // This is the ring of probability distributions. ring rP = 0,(p1,p2,p3,p4,p5),dp; //This is the Fourier transform. matrix qtop[4][5] = 1,1,1,1,1, 1,-1,1,1,-1, 1,1/5,-3/5,-1/5,-1/5, 1,-1,1,-1,1; 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,(c0,c1,e0,e1),dp; ideal P = c0^3*e0^4+c0^3*e1^4+2*c0^2*c1*e0^3*e1+2*c0^2*c1*e0^2*e1^2+2*c0^2*c1*e0*e1^3+2*c0*c1^2*e0^3*e1+2*c0*c1^2*e0^2*e1^2+2*c0*c1^2*e0*e1^3+c1^3*e0^4+c1^3*e1^4, 2*c0^3*e0^3*e1+2*c0^3*e0*e1^3+2*c0^2*c1*e0^3*e1+8*c0^2*c1*e0^2*e1^2+2*c0^2*c1*e0*e1^3+2*c0*c1^2*e0^3*e1+8*c0*c1^2*e0^2*e1^2+2*c0*c1^2*e0*e1^3+2*c1^3*e0^3*e1+2*c1^3*e0*e1^3, 2*c0^3*e0^2*e1^2+c0^2*c1*e0^4+2*c0^2*c1*e0^3*e1+2*c0^2*c1*e0*e1^3+c0^2*c1*e1^4+c0*c1^2*e0^4+2*c0*c1^2*e0^3*e1+2*c0*c1^2*e0*e1^3+c0*c1^2*e1^4+2*c1^3*e0^2*e1^2, 2*c0^3*e0^3*e1+2*c0^3*e0*e1^3+2*c0^2*c1*e0^4+2*c0^2*c1*e0^3*e1+4*c0^2*c1*e0^2*e1^2+2*c0^2*c1*e0*e1^3+2*c0^2*c1*e1^4+2*c0*c1^2*e0^4+2*c0*c1^2*e0^3*e1+4*c0*c1^2*e0^2*e1^2+2*c0*c1^2*e0*e1^3+2*c0*c1^2*e1^4+2*c1^3*e0^3*e1+2*c1^3*e0*e1^3, 4*c0^3*e0^2*e1^2+4*c0^2*c1*e0^3*e1+4*c0^2*c1*e0^2*e1^2+4*c0^2*c1*e0*e1^3+4*c0*c1^2*e0^3*e1+4*c0*c1^2*e0^2*e1^2+4*c0*c1^2*e0*e1^3+4*c1^3*e0^2*e1^2; // 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(0,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; }