/* sord.rd (for SO, Ohara project). This is based on wishart/Prog/rd.rr. cf. h-mle/SO/Notes/note-so3.tex */ import("ok_diff.rr")$ /* p(yi) = yi q(yi,yj) = 1/(yi^2-yj^2) */ dp_ord(0)$ function p(x)$ function q(x,y)$ def pp(Yi) { return 1/Yi; } def qq(Yi,Yj) { return 1/(Yi^2-Yj^2); } /* (modified) Muirhead operators */ def mh(I,M) { E=newvect(M); E[I] = 2; L = dp_vtoe(E); Ei=newvect(M); Ei[I]=1; L += (p-M)*p(util_v(y,[I]))*dp_vtoe(Ei); for (J=0; J test1(); */ def mpmul(F,G,V) { if (type(F)<=3) return(F*G); if (dp_rest(F) != 0) error("mpmul(F,G,V), F must be a monomial."); N = length(V); E = dp_etov(F); C = dp_hc(F); P=1; for (I=0; I> + b*<<1,1>> + p*<<0,0>>; G = c*<<1,1>> - d*<<0,0>>; return(red1(F,G,[x,y])); } def test3() { F0=(a/b)+<<1,0>>; F =F0-<<1,0>>; print(F); G = c*<<1,0>>; H = F*G; print(type(dp_hm(H))); return(rtostr(H)); /* ask noro 2011.10.23 */ } def test2b() { F = a*<<2,1>> + b*<<1,1>> + p*<<0,0>>; G = (1/2)*<<1,1>> - d*<<0,0>>; A=red1(F,G,[x,y]); print(F-A[1]*G-A[0]); return(A); } /* G is a set */ def redall0(F,G,V) { N = length(G); Q = newvect(N); Reducible = 1; while (Reducible) { Reducible = 0; for (I=0; I>+b*<<2,0>>; G = [(1/2)*<<1,1>>+c*<<0,0>>,(1/3)*<<2,0>>+d*<<0,0>>]; A=redall(F,G,[x,y]); print(F-A[1][0]*G[0]-A[1][1]*G[1]-A[0]); return(A); } def test5() { dp_ord(0); M=2; G = [mh(0,M),mh(1,M)]; A=redall(<<2,1>>,G,[y_0,y_1]); return(A[0]); } /* red for dp */ def dpred0(F) { A = 0; while (F!=0) { A += red(dp_hc(F))*dp_ht(F); /* asir does not accept */ F = dp_rest(F); } return(A); } def test6() { M=2; G = [mh(0,M),mh(1,M)]; V = [y_0,y_1]; S=mpmul(<<0,2>>,G[0],V)-mpmul(<<2,0>>,G[1],V); A=redall(S,G,V); Rule = append(getRulep(2,2),getRuleq(2,2)); /* A = dpred(base_replace(A[0],Rule)); */ A = red(dp_dtop(base_replace(A[0],Rule),[dy_1,dy_2])); return(A); } def myelim(L,V) { F=1; for (I=0; I S_dm) error("Approximation degree is too big."); Kmax = Lmax = Mmax = N-1; for (K=0; K<=Kmax; K++)for (L=0; L<=Lmax; L++)for (M=0; M<=Mmax; M++) {{{ F = F+dp_vtoe(newvect(3,[K,L,M]))* (S_Etens[S_ZR+K][S_ZR+L][S_ZR+M]/(S_fct[S_ZR+K]*S_fct[S_ZR+L]*S_fct[S_ZR+M])); }}} return F; } def degmin(L) { L = dp_ptod(L,vars(L)); D = 1000; /* big */ while (L != 0) { T = dp_etov(L); if (T[0]+T[1]+T[2] < D) D = T[0]+T[1]+T[2]; L = dp_rest(L); } return(D); } def check1(P) { V = [y_0,y_1,y_2]; DV = [dy_0,dy_1,dy_2]; L0 = mh(0,3); L1 = mh(1,3); L2 = mh(2,3); L = [L0,L1,L2]; R = append(getRulep(3,0),getRuleq(3,0)); R = append(R,[[p,3]]); L = map(dp_dtop,L,DV); L = base_replace(L,R); L = map(nm,L); print(L); F = dp_dtop(so_int_d(S_dm-P),V); A=map(odiff_act,L,F,V); dp_ord(0); return(A); } /* Use odiff_act(L,F,V), ord(0); cf. wishart/Prog/w1.rr */ /* ---- done ---- */ /* dicimal to binary vector of size N */ def dtobv(A,N) { B = newvect(N); for (I=0; I 1) return(fctr(E1)); else return(pari(roots,E1)); /* E=matrix_eigenvalues(E0); return(E); */ } def eigen3(N,S0,S1,S2) { P0 = mhmat(3,0); P1 = mhmat(3,1); P2 = mhmat(3,2); Rule = [[y_0,S0*t^(-1)],[y_1,S1*t^(-1)],[y_2,S2*t^(-1)], [a,4/2],[c,4/2+N/2]]; P0 = base_replace(P0,Rule); P1 = base_replace(P1,Rule); P2 = base_replace(P2,Rule); Rule2 = [[t,0]]; P0 = base_replace(P0,Rule2); P1 = base_replace(P1,Rule2); P2 = base_replace(P2,Rule2); D = newmat(8,8); Dii = -(S0+S1+S2)-s; for (I=0; I<8; I++) D[I][I] = Dii; E0 = D + S0*P0+S1*P1 + S2*P2; E1=det(E0); if (length(vars(E1)) > 1) return(fctr(E1)); else return(pari(roots,E1)); } def getSer(N) { F=so_int_d(N); F=dp_dtop(F,[x,y,z]); G=[F,diff(F,x),diff(F,y),diff(F,z)]; G=base_replace(G,[[x,a*t],[y,b*t],[z,c*t]]); G=[G[0]*exp(0),G[1]*exp(0),G[2]*exp(0),G[3]*exp(0)]; G=map(eval,G); G=map(deval,G); return(G); } def getSer2(N) { F=so_int_d(N); F=dp_dtop(F,[x,y,z]); G=[F,diff(F,x),diff(F,y),diff(F,z)]; G=[G[0]*exp(0),G[1]*exp(0),G[2]*exp(0),G[3]*exp(0)]; G=map(eval,G); G=map(deval,G); return(G); } def foo1(N) { F=getSer(N); Rule=[[a,-5.614],[b,3.079],[c,2.387],[t,1]]; /* Commets */ Val=base_replace(F,Rule); return(Val); } def forC(N) { F=so_int_d(N); while (F!=0) { E=dp_etov(dp_ht(F)); C=deval(eval(dp_hc(F)*exp(0))); printf("Tnc[%a][%a][%a]=%a;\n",E[0],E[1],E[2],C); F=dp_rest(F); } } end$