[BACK]Return to restriction.k CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib / restriction

Annotation of OpenXM/src/k097/lib/restriction/restriction.k, Revision 1.3

1.3     ! takayama    1: /*  $OpenXM: OpenXM/src/k097/lib/restriction/restriction.k,v 1.2 2013/01/24 00:27:54 takayama Exp $ */
1.1       takayama    2: load["lib/minimal/minimal-test.k"];;
                      3: Load_sm1(["Srestall_s.sm1","lib/restriction/Srestall_s.sm1"],"Srestall_s.sm1.loaded");
                      4:
                      5: def Srestall(gg,ttxx,tt,k1) {
                      6:   local cohom, gg, ttxx, tt, k1, cohom0, cohomd,ans;
                      7:   sm1("gg dehomogenize /gg set");
                      8:   gg = ToString_array(gg);
                      9:   sm1(" [(x) ring_of_differential_operators [[(x) 1]] weight_vector 0] define_ring ]");
                     10:   sm1("[(Homogenize_vec) 1] system_variable");
                     11:   Println([Tag(gg),Tag(ttxx),Tag(tt)]);
                     12:   sm1("gg ttxx tt k1 (integer) dc Srestall1  /cohom0 set");
                     13:   sm1(" cohom0 {deRham.simp} map /cohomd set ");
                     14:   ans = [cohomd,cohom0];
                     15:   return(ans);
                     16: }
                     17: HelpAdd(["Srestall",
                     18: [ "Srestall(gg,v,rv,k1) evaluates the dimensions of all restictions of",
                     19:   "gg along the list of variables rv. Here, v is a list of variables and",
                     20:   " k1 is the maximal integral root of the b-function of gg.",
                     21:   "Srestall uses the function Sminimal to get a (-w,w)-minimal free resolution.",
                     22:   "cf. Bfroots1(ii,vv)"
                     23: ]]);
                     24:
                     25: def DeRham2(f) {
                     26:   local s;
                     27:   s = ToString(f);
                     28:   II = Sannfs(f,"x,y");
                     29:   Println("Step 1: Annhilating ideal (II)"); Println(II);
                     30:   sm1(" II 0 get { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set ");
                     31:   Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]);
                     32:   pp = Map(II,"Spoly");
                     33:   Res = Sminimal(pp);
                     34:   Res0 = Res[0];
                     35:   Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
                     36:   R = BfRoots1(Res0[0],"x,y");
                     37:   Println("Step3: computing the cohomology of the truncated complex.");
                     38:   Print("Roots and b-function are "); Println(R);
                     39:   R0 = R[0];
                     40:   Ans=Srestall(Res0, ["x", "y"], ["x", "y"],R0[Length(R0)-1]);
                     41:   Print("Answer is "); Println(Ans[0]);
                     42:   return(Ans);
                     43: }
                     44:
                     45: def DeRham3(f) {
                     46:   local s;
                     47:   s = ToString(f);
                     48:   II = Sannfs(f,"x,y,z");
                     49:   Print("Step 1: Annhilating ideal (II)"); Println(II);
                     50:   sm1(" II 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /II set ");
                     51:   Sweyl("x,y,z",[["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]]);
                     52:   pp = Map(II,"Spoly");
                     53:   Res = Sminimal(pp);
                     54:   Res0 = Res[0];
                     55:   Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
                     56:   R = BfRoots1(Res0[0],"x,y,z");
                     57:   Println("Step3: computing the cohomology of the truncated complex.");
                     58:   Print("Roots and b-function are "); Println(R);
                     59:   R0 = R[0];
                     60:   Ans=Srestall(Res0, ["x", "y", "z"],  ["x", "y", "z"],R0[Length(R0)-1] );
                     61:   Print("Answer is ");Println(Ans[0]);
                     62:   return(Ans);
                     63: }
                     64:
                     65: def DeRham1(f) {
                     66:   local s;
                     67:   s = ToString(f);
                     68:   II = Sannfs(f,"x");
                     69:   Println("Step 1: Annhilating ideal (II)"); Println(II);
                     70:   sm1(" II 0 get { [(x) (Dx) ] laplace0 } map /II set ");
                     71:   Sweyl("x",[["x",-1,"Dx",1]]);
                     72:   pp = Map(II,"Spoly");
                     73:   Res = Sminimal(pp);
                     74:   Res0 = Res[0];
                     75:   Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
                     76:   R = BfRoots1(Res0[0],"x");
                     77:   Println("Step3: computing the cohomology of the truncated complex.");
                     78:   Print("Roots and b-function are "); Println(R);
                     79:   R0 = R[0];
                     80:   Ans=Srestall(Res0, ["x"], ["x"],R0[Length(R0)-1]);
                     81:   Print("Answer is "); Println(Ans[0]);
                     82:   return(Ans);
                     83: }
                     84:
                     85: /*  Demo for non-quasi */
                     86: def nonquasi(p,q) {
                     87:   local s,ans,f;
                     88:   f = x^p+y^q+x*y^(q-1);
                     89:   Print("f=");Println(f);
                     90:   s = ToString(f);
                     91:   sm1(" Onverbose ");
                     92:   sm1(" s [(s) (x) (y)] genericAnn /ans set ");
                     93:   sm1(" ans 0 get (ring) dc ring_def ");
                     94:   sm1("[ ans { [[(s). (-1).]] replace } map ] /II set ");
                     95:   Println("Step 1: Annhilating ideal (II)"); Println(II);
                     96:   sm1(" II 0 get { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set ");
                     97:   Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]);
                     98:   pp = Map(II,"Spoly");
                     99:   Res = Sminimal(pp);
                    100:   Res0 = Res[0];
                    101:   Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
                    102:   R = BfRoots1(Res0[0],"x,y");
                    103:   Println("Step3: computing the cohomology of the truncated complex.");
                    104:   Print("Roots and b-function are "); Println(R);
                    105:   R0 = R[0];
                    106:   Ans=Srestall(Res0, ["x", "y"],  ["x", "y"], R0[Length(R0)-1]);
                    107:   Print("Answer is "); Println(Ans[0]);
                    108:   return(Ans);
                    109: }
                    110:
1.3     ! takayama  111: /* should be moved to slib.k */
        !           112: def UseSmallD() {
        !           113:   sm1("[(Strict)] system_variable /aaa.strict set ");
        !           114:   sm1("[(Strict) 0] system_variable ");
        !           115:   /* kan96xx/Doc/callsm1.sm1 */
        !           116:   sm1("/@@@.Dsymbol (d) def /aaaDsymbol (d) def ");
        !           117:   sm1("/@@@.Esymbol (ee0) def ");
        !           118:   sm1("/@@@.Hsymbol (hh) def ");
        !           119:   sm1("[(Strict) aaa.strict] system_variable ");
        !           120: }
        !           121: HelpAdd(["UseSmallD",
        !           122: [ "UseSmallD() changes the Dsymbol to d and E,H symbols to ee0,hh",
        !           123:   "@@@.Dsymbol can be refered by aaaDsymbol."
        !           124: ]]);
        !           125:
1.2       takayama  126: def t_addD(v) {
1.3     ! takayama  127:   sm1(" /aaaDsymbol @@@.Dsymbol def ");
        !           128:   return(AddString([aaaDsymbol,ToString(v)])); /* add x->Dx */
1.2       takayama  129: }
                    130: def Sintegration(gg,v,intv) {
                    131:   local i,vstr,n,dv,wv,vall;
                    132:   II=Map(gg,"ToString");
                    133:   v = Map(v,"ToString");
                    134:   intv = Map(intv,"ToString");
                    135:   vstr=" "; n=Length(v);
                    136:   for (i=0; i<n-1; i++) {
                    137:     vstr=AddString([vstr,v[i],","]);
                    138:   }
                    139:   vstr=AddString([vstr,v[n-1]]);
                    140:   dv=Map(v,"t_addD");
                    141:   wv=[ ];
                    142:   for (i=0; i<n; i++) { wv = Join(wv,[v[i],-1]); }
                    143:   for (i=0; i<n; i++) { wv = Join(wv,[dv[i],1]); }
                    144:   /* Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]); */
                    145:   Sweyl(vstr,[wv]);
                    146:   II=Map(II,"Poly");
                    147:   /* sm1(" II 0 get { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set "); */
                    148:   vall = Join(v,dv);
                    149:   sm1(" II { vall laplace0 } map /II set ");
                    150:   pp = Map(II,"Spoly");
                    151:   Println("Step1: Laplace transform "); Println(pp);
                    152:   Res = Sminimal(pp);
                    153:   Res0 = Res[0];
                    154:   Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
                    155:   /* R = BfRoots1(Res0[0],"x,y"); */
                    156:   R = BfRoots1(Res0[0],vstr);
                    157:   Println("Step3: computing the cohomology of the truncated complex.");
                    158:   Print("Roots and b-function are "); Println(R);
                    159:   R0 = R[0];
                    160:   /* Ans=Srestall(Res0, ["x", "y"], ["x", "y"],R0[Length(R0)-1]); */
                    161:   Ans=Srestall(Res0, v, intv,R0[Length(R0)-1]);
                    162:   Print("Answer is "); Println(Ans[0]);
                    163:   return(Ans);
                    164: }
                    165: HelpAdd(["Sintegration",
                    166: [ "Sintegration(gg,v,intv) evaluates the dimensions of all integrations of",
                    167:   "gg along the list of variables intv. Here, v is a list of variables.",
                    168:   "Interation variables intv must be in the first part of v.",
                    169:   "Sintegration uses the function Srestall.",
                    170:   "Example: RingD(\"x,t\"); Sintegration([Dt-(3*t^2-x),Dx+t],[t,x],[t]):"
                    171: ]]);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>