//////////////////////////////////////////////////////////////////// // ntbuch.lib : norm-trace codes with Buchberger // //////////////////////////////////////////////////////////////////// //LIB "general.lib"; // LIB "matrix.lib"; // LIB "brnoeth.lib"; proc permute_intvec2 (intvec L,intvec P) { int s=size(L); int n=size(P); intvec Lord=L; if (s0) { def base_r=basering; } // local variables int i,j,s; int ino,iyes; int li,k; intvec lno,lyes; intvec ell,t; intvec perm; intvec Boxes,aux; list L; list S; // general parameters int n=p^(2*r-1); int k1=p^(r-1); int k2=(p^r)-1; int k3=k2-k1; int theta=k2/(p-1); // Boxes for (i=1;i<=k1;i=i+1) { Boxes[i]=k2; } int k4=(k1-1)/(p-1); for (i=1;i<=k4;i=i+1) { aux[i]=p-1; } Boxes=Boxes,aux; Boxes=Boxes,1; // compute li's ring rT=(p^r,a),(T),lp; poly P=T; for (i=1;i0) { s=size(lyes); } // auxiliary ring ring Rxy=(p^r,a),(x,y),lp; // just in case this is useful ... map tau=basering,a*x,(a^theta)*y; export(tau); // equation of the norm-trace curve poly eq=x^(theta); for (i=0;i0) { setring base_r; } kill rT; int g=(p^(r-1)-1)*((p^r-1)/(p-1)-1)/2; intvec codepars=p,r,n,0,g,theta,s; L[1]=ell; L[2]=t; L[3]=Boxes; L[4]=Rxy; // L[5]=DC; // L[6]=Rt; L[7]=codepars; print("n="+string(n)); print("g="+string(g)); return(L); } proc NTmodule_basis (list L,int m) { // check if basering is defined and preserve it int defring=defined(basering); if (defring>0) { def base_r=basering; } list CODE; intvec Boxes=L[3]; int theta=size(Boxes)-1; def Rxy=L[4]; setring Rxy; int p=char(basering); int N=theta*(p-1); N=N+1; int r=1; while (p=n) { ERROR("m is not smaller than the number of rational points"); } if (m<=2*g-2) { ERROR("m is not larger than the Euler characteristic"); } // s=#B int s=L[7][7]; int k1=p^(r-1); int k2=(p^r)-1; int k3=k2-k1; // int theta=k2/(p-1); int k4=(k1-1)/(p-1); // list auxL; int i,j,k,d,h,counter; poly f,ff; ideal b; counter=1; for (i=0;i0) { setring base_r; } intvec codepars=p,r,n,m,g,theta,s; CODE[1]=L[1]; CODE[2]=L[2]; CODE[3]=Boxes; CODE[4]=Rxy; //CODE[5]=DC; CODE[6]=Rt; CODE[7]=codepars; return(CODE); } proc GB_NTbuchberger (list L) { // requires: NTcode data (DC, rational points, p -or q-, r, theta, m, rings ... // (Evaluate) --> algorithm 4.2 // return groebner basis G (Matrix) // check if basering is defined and preserve it int defring=defined(basering); if (defring>0) { def base_r=basering; } list CODE=L; def Rt=L[6]; setring Rt; module GB=groebner(MB); export(GB); if (defring>0) { setring base_r; } // update CODE CODE[6]=Rt; return(CODE); } ;