Annotation of OpenXM/src/k097/lib/minimal/minimal-test.k, Revision 1.11
1.11 ! takayama 1: /* $OpenXM: OpenXM/src/k097/lib/minimal/minimal-test.k,v 1.10 2000/08/01 05:16:02 takayama Exp $ */
1.1 takayama 2: load["minimal.k"];
3: def sm1_resol1(p) {
4: sm1(" p resol1 /FunctionValue set ");
5: }
6:
7: def test8() {
8: local p,pp,ans,b,c,cc,ww,ww2;
9: f = "x^3-y^2*z^2";
10: p = Sannfs(f,"x,y,z");
11: ww = [["x",1,"y",1,"z",1,"Dx",1,"Dy",1,"Dz",1,"h",1],
12: ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
13: ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
14: sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
15: Sweyl("x,y,z",ww);
16: pp = Map(p,"Spoly");
17: /* return(pp); */
18: /* pp =
19: [y*Dy-z*Dz , -2*x*Dx-3*y*Dy+1 , 2*x*Dy*Dz^2-3*y*Dx^2 ,
20: 2*x*Dy^2*Dz-3*z*Dx^2 , 2*x*z*Dz^3-3*y^2*Dx^2+4*x*Dz^2 ]
21: */
22: ans = sm1_resol1([pp,"x,y,z",ww]);
23: /* Schreyer is in ans. */
24:
25: v = [x,y,z];
26: b = ans;
27: Println("------ ker=im for Schreyer ?------------------");
28: c = Skernel(b[0],v);
29: c = c[0];
30: sm1_pmat([c,b[1],v]);
31: cc = sm1_res_div(c,b[1],v);
32: sm1_pmat(sm1_gb(cc,v));
33: c = Skernel(b[1],v);
34: c = c[0];
35: cc = sm1_res_div(c,b[2],v);
36: sm1_pmat(sm1_gb(cc,v));
37: return(ans);
38: }
39: /*
40: a = test8();
41: SisComplex(a):
42: */
43:
1.3 takayama 44: def test11() {
45: local a;
46: a = test_ann3("x^3-y^2*z^2");
47: return(a);
48: }
49: /* f should be a string. */
1.5 takayama 50: /* a=test_ann3("x^3+y^3+z^3");
51: It returns the following resolution in 1.5 hours. June 14, 2000.
52: [
53: [
54: [ x*Dx+y*Dy+z*Dz-3*h^2 ]
55: [ -z*Dy^2+y*Dz^2 ]
56: [ -z*Dx^2+x*Dz^2 ]
57: [ -y*Dx^2+x*Dy^2 ]
58: ]
59: [
60: [ 0 , -x , y , -z ]
61: [ z*Dx^2-x*Dz^2 , x*Dy , x*Dx+z*Dz-3*h^2 , z*Dy ]
62: [ y*Dx^2-x*Dy^2 , -x*Dz , y*Dz , x*Dx+y*Dy-3*h^2 ]
63: [ 0 , Dx^2 , -Dy^2 , Dz^2 ]
64: [ z*Dy^2-y*Dz^2 , x*Dx+y*Dy+z*Dz-2*h^2 , 0 , 0 ]
65: ]
66: [
67: [ -x*Dx+3*h^2 , y , -z , 0 , -x ]
68: [ Dy^3+Dz^3 , Dy^2 , -Dz^2 , x*Dx+y*Dy+z*Dz , -Dx^2 ]
69: ]
70: ]
71: */
1.3 takayama 72: def test_ann3(f) {
73: local a,v,ww2,ans2;
1.7 takayama 74: a = Sannfs3(f);
1.3 takayama 75: ans2 = a[0];
76: v = [x,y,z];
77: ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
78: Sweyl("x,y,z",ww2);
79: ans2 = ReParse(ans2);
80: r= IsExact_h(ans2,[x,y,z]);
81: Println(r);
1.9 takayama 82: return([r,ans2,a]);
1.3 takayama 83: }
84: def test11a() {
85: local a,v,ww2,ans2;
86: /* constructed by test11.
87: ans2 =
88: [[[y*Dy-z*Dz] , [-2*x*Dx-3*z*Dz+h^2] , [2*x*Dy*Dz^2-3*y*Dx^2*h] , [2*x*Dy^2*Dz-3*z*Dx^2*h]] ,
89: [[3*Dx^2*h , 0 , Dy , -Dz] ,
90: [6*x*Dy*Dz^2-9*y*Dx^2*h , -2*x*Dy*Dz^2+3*y*Dx^2*h , -2*x*Dx-3*y*Dy , 0] ,
91: [0 , 2*x*Dy^2*Dz-3*z*Dx^2*h , 0 , 2*x*Dx+3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*Dz-h^2 , y*Dy-z*Dz , 0 , 0] ,
117: [2*x*Dy*Dz , 0 , z , -y]],
118: [[-2*x*Dx-3*y*Dy-3*z*Dz-6*h^2 , -Dy , -Dz , 3*Dx^2*h , 3*Dy*Dz ] ,
119: [3*y*z , z , y , -2*x*Dy*Dz , 2*x*Dx]]];
120:
121: sm1_pmat( ans2[1]*ans2[0] );
122: sm1_pmat( ans2[2]*ans2[1] );
123: ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
124: Sweyl("x,y,z",ww2);
125: ans2 = ReParse(ans2);
126: r= IsExact_h(ans2,[x,y,z]);
127: Println(r);
128: return([r,ans2]);
129: }
130:
131: def test12() {
132: local a,v,ww2,ans2;
133: a = Sannfs3("x^3-y^2*z^2");
134: ans2 = a[0];
135: v = [x,y,z];
136: ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
1.4 takayama 137: Sweyl("x,y,z",ww2);
138: ans2 = ReParse(ans2); /* DO NOT FORGET! */
1.3 takayama 139: r= IsExact_h(ans2,[x,y,z]);
140: Println(r);
141: return([r,ans2]);
142: }
1.4 takayama 143:
144: def test13() {
145: Println("test13 try to construct a minimal free resolution");
146: Println("of a GKZ system [[1,2]]. 6/12, 2000.");
1.5 takayama 147: ans2 = GKZ([[1,2]],[0]);
148: /* Be careful!! It resets the grade to module1, not module1v */
1.4 takayama 149: ww2 = [["x1",-1,"x2",-1,"Dx1",1,"Dx2",1]];
150: Sweyl("x1,x2",ww2);
151: ans2 = ReParse(ans2[0]);
1.5 takayama 152: Println(ans2);
1.4 takayama 153: return(Sminimal(ans2));
154: }
155:
156: def test14() {
157: Println("test14 try to construct a minimal free resolution");
158: Println("of a GKZ system [[1,2,3]]. 6/12, 2000.");
1.6 takayama 159: ans2 = GKZ([[1,2,3]],[0]);
160: /* It stops by the strategy error.
161: July 26, 2000. It works fine after fixing a bug in resol.c */
1.4 takayama 162: ww2 = [["x1",-1,"x2",-1,"x3",-1,"Dx1",1,"Dx2",1,"Dx3",1]];
163: Sweyl("x1,x2,x3",ww2);
164: ans2 = ReParse(ans2[0]);
165: return(Sminimal(ans2));
166: }
167: def test14a() {
168: Println("test14a try to construct a minimal free resolution");
169: Println("of a GKZ system [[1,2,3]]. 6/12, 2000.");
170: Println("Without automatic homogenization.");
171: ww2 = [["x1",-1,"x2",-1,"x3",-1,"Dx1",1,"Dx2",1,"Dx3",1]];
172: Sweyl("x1,x2,x3",ww2);
173: ans2 = [x1*Dx1+2*x2*Dx2+3*x3*Dx3 , Dx1^2-Dx2*h , -Dx1*Dx2+Dx3*h ,
174: Dx2^2-Dx1*Dx3 ];
175: ans2 = ReParse(ans2);
1.8 takayama 176: return(Sminimal(ans2,["homogenized"]));
1.4 takayama 177: }
178:
179: def test15() {
180: Println("test15 try to construct a minimal free resolution");
181: Println("of a GKZ system [[1,2,3]] by the order filt. 6/12, 2000.");
182: ww2 = [["Dx1",1,"Dx2",1,"Dx3",1]];
1.7 takayama 183: ans2 = GKZ([[1,2,3]],[0]);
1.4 takayama 184: Sweyl("x1,x2,x3",ww2);
185: ans2 = ReParse(ans2[0]);
1.7 takayama 186: a = Sminimal(ans2);
187: Println("Minimal Resolution is "); sm1_pmat(a[0]);
188: Sweyl("x1,x2,x3");
189: ans3 = ReParse(a[0]);
190: r= IsExact_h(ans3,[x1,x2,x3]);
191: Println(r);
192: return(a);
1.4 takayama 193: }
194:
195: def test15b() {
196: Println("test15b try to construct a minimal free resolution");
197: Println("of toric [[1,2,3]] by the order filt. 6/12, 2000.");
198: ww2 = [["Dx1",1,"Dx2",1,"Dx3",1]];
199: Sweyl("x1,x2,x3",ww2);
200: ans2 = [Dx1^2-Dx2*h , -Dx1*Dx2+Dx3*h , Dx2^2-Dx1*Dx3 ];
201: ans2 = ReParse(ans2);
1.8 takayama 202: return(Sminimal(ans2,["homogenized"]));
1.4 takayama 203: }
204:
1.7 takayama 205: def test15c() {
206: Println("test15c try to construct a minimal free resolution ");
207: Println("of a GKZ system [[1,2,3]] by -1,1");
208: ww2 = [["Dx1",1,"Dx2",1,"Dx3",1,"x1",-1,"x2",-1,"x3",-1]];
209: ans2 = GKZ([[1,2,3]],[0]);
210: Sweyl("x1,x2,x3",ww2);
211: ans2 = ReParse(ans2[0]);
212: a = Sminimal(ans2);
213: Println("Minimal Resolution is "); sm1_pmat(a[0]);
214: Sweyl("x1,x2,x3");
215: ans3 = ReParse(a[0]);
216: r= IsExact_h(ans3,[x1,x2,x3]);
217: Println(r);
218: return(a);
219: }
1.4 takayama 220: def test16() {
221: Println("test16 try to construct a minimal free resolution");
222: Println("of a GKZ system [[1,2,3,5]] by the order filt. 6/12, 2000.");
223: ww2 = [["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1]];
224: Sweyl("x1,x2,x3,x4",ww2);
225: ans2 = GKZ([[1,2,3,5]],[0]);
226: ans2 = ReParse(ans2[0]);
227: return(Sminimal(ans2));
228: }
229:
230: def test16b() {
231: Println("test16b try to construct a minimal free resolution");
232: Println("of a toric [[1,2,3,5]] by the order filt. 6/12, 2000.");
233: ww2 = [["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1]];
234: Sweyl("x1,x2,x3,x4",ww2);
235: ans2 = GKZ([[1,2,3,5]],[0]);
236: ans3 = Rest(ans2[0]);
237: ans3 = ReParse(ans3);
238: Println("Toric variety:");
239: Println(ans3);
240: return(Sminimal(ans3));
241: }
242:
1.9 takayama 243:
244: def test17() {
245: a=Sannfs3("x^3-y^2*z^2");
246: b=a[0]; w = ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1];
247: Sweyl("x,y,z",[w]); b = Reparse(b);
248: c=Sinit_w(b,w);
249: Println("Resolution (b)----");
250: sm1_pmat(b);
251: Println("Initial (c)----");
252: sm1_pmat(c);
253: Println(IsExact_h(c,"x,y,z"));
254: }
1.10 takayama 255:
256: def test_if_v_strict(resmat,w,v) {
1.11 ! takayama 257: local b,c,g,cc;
1.10 takayama 258: Sweyl(v,[w]); b = Reparse(resmat);
1.9 takayama 259: c=Sinit_w(b,w);
260: Println("Resolution (b)----");
261: sm1_pmat(b);
262: Println("Initial (c)----");
1.11 ! takayama 263: sm1_pmat(c); cc=c;
1.10 takayama 264: Println("Exactness of the resolution ---");
1.11 ! takayama 265: Println(IsExact_h(b,v)); /* IsExact_h breaks the variable c.
! 266: THIS BUG SHOULD BE FIXED. */
! 267: Println("Why is the initial c rewritten by b? (buggy) ");sm1_pmat(c[0]);
1.10 takayama 268: Println("Exactness of the initial complex.---");
1.11 ! takayama 269: Println(IsExact_h(cc,v));
1.9 takayama 270: g = Sinvolutive(b[0],w);
1.10 takayama 271: /* Println("Involutive basis ---");
1.11 ! takayama 272: sm1_pmat(g);
! 273: Println(Sinvolutive(cc[0],w));
! 274: sm1(" /gb.verbose 1 def "); */
1.9 takayama 275: Println("Is same ideal?");
1.11 ! takayama 276: Println(IsSameIdeal_h(g,cc[0],v));
1.10 takayama 277: }
278: def test17b() {
279: a=Sannfs3("x^3-y^2*z^2");
1.11 ! takayama 280: b=a[0]; w = ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1];
1.10 takayama 281: test_if_v_strict(b,w,"x,y,z");
282: return(a);
1.9 takayama 283: }
284:
285: def test18() {
286: a=Sannfs2("x^3-y^2");
287: b=a[0]; w = ["x",-1,"y",-1,"Dx",1,"Dy",1];
1.10 takayama 288: test_if_v_strict(b,w,"x,y");
289: return(a);
1.9 takayama 290: }
1.4 takayama 291:
1.10 takayama 292: def test19() {
293: Println("test19 try to construct a minimal free resolution and check if it is v-strict.");
294: Println("of a GKZ system [[1,2,3]] by -1,1");
295: ww2 = ["Dx1",1,"Dx2",1,"Dx3",1,"x1",-1,"x2",-1,"x3",-1];
296: ans2 = GKZ([[1,2,3]],[0]);
297: Sweyl("x1,x2,x3",[ww2]);
298: ans2 = ReParse(ans2[0]);
299: a = Sminimal(ans2);
300: Println("Minimal Resolution is "); sm1_pmat(a[0]);
301: b = a[0];
302: test_if_v_strict(b,ww2,"x1,x2,x3");
303: return(a);
304: }
305:
306: def test20() {
307: w = ["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1,"x1",-1,"x2",-1,"x3",-1,"x4",-1];
308: ans2 = GKZ([[1,1,1,1],[0,1,3,4]],[0,0]);
309: Sweyl("x1,x2,x3,x4",[w]);
310: ans2 = ReParse(ans2[0]);
311: a = Sminimal(ans2);
312: Println("Minimal Resolution is "); sm1_pmat(a[0]);
313: b = a[0];
314: /* test_if_v_strict(b,w,"x1,x2,x3,x4"); */
315: return(a);
316: }
317: def test20b() {
318: w = ["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1,"x1",-1,"x2",-1,"x3",-1,"x4",-1];
319: ans2 = GKZ([[1,1,1,1],[0,1,3,4]],[1,2]);
320: Sweyl("x1,x2,x3,x4",[w]);
321: ans2 = ReParse(ans2[0]);
322: a = Sminimal(ans2);
323: Println("Minimal Resolution is "); sm1_pmat(a[0]);
324: b = a[0];
325: /* test_if_v_strict(b,w,"x1,x2,x3,x4"); */
326: return(a);
327: }
1.3 takayama 328:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>