Changeset 6f2edc in git for Singular/LIB/deform.lib
- Timestamp:
- Apr 28, 1997, 9:27:25 PM (27 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- 8c5a578cc8481c8a133a58030c4c4c8227d82bb1
- Parents:
- 6d09c564c80f079b501f7187cf6984d040603849
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/deform.lib
r6d09c56 r6f2edc 1 // $Id: deform.lib,v 1. 1.1.1 1997-04-25 15:13:25 obachman Exp $2 //(BM +GMG)1 // $Id: deform.lib,v 1.2 1997-04-28 19:27:15 obachman Exp $ 2 //(BM/GMG, last modified 22.06.96) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 LIBRARY: deform.lib PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION 5 5 6 6 miniversal(id[,deg]); miniversal deformation of an isolated singularity id 7 7 8 8 SUB-PROCEDURES used by main procedure: 9 9 apply_col(A,B); put A into col-nf and apply same col-operations to B … … 15 15 LIB "inout.lib"; 16 16 LIB "general.lib"; 17 LIB "sing.lib"; 17 LIB "sing.lib"; 18 18 LIB "matrix.lib"; 19 19 /////////////////////////////////////////////////////////////////////////////// 20 20 21 21 proc miniversal (ideal id,list #) 22 USAGE: miniversal(id[,d,na,va,o,iv]); id=ideal, d=integer, 22 USAGE: miniversal(id[,d,na,va,o,iv]); id=ideal, d=integer, 23 23 na,va,o=strings, iv=intvec of positive integers 24 24 COMUPTE: miniversal deformation of id up to degree d (default d=100) … … 26 26 the basering by new variables given by va (deformation parameters). 27 27 -- The new vars come before the old vars 28 -- The characteristic of `na` is the characteristic of the basering.29 -- The new vars are derived from va. If va is a single letter, say 30 va="T", and if n<=26 then T and the following n-1 letters from 31 T..Z..T (resp. T(1..n) if n>26) are taken as additional variables. 32 If va is a single letter followed by (, say va="x(", the new 28 -- The characteristic of `na` is the characteristic of the basering. 29 -- The new vars are derived from va. If va is a single letter, say 30 va="T", and if n<=26 then T and the following n-1 letters from 31 T..Z..T (resp. T(1..n) if n>26) are taken as additional variables. 32 If va is a single letter followed by (, say va="x(", the new 33 33 variables are x(1),...,x(n) (default va="A"). 34 34 -- The ordering is the product ordering between the ordering of r and 35 an ordering derived from `o`, which has to be local!! (default: 36 o="ds") [and iv (a weight vector)]. 35 an ordering derived from `o`, which has to be local!! (default: 36 o="ds") [and iv (a weight vector)]. 37 37 Type 'help extendring' for a more detailed explanation of the 38 ordering 39 -- Even if na,va,o are given, d and/or iv may be ommited. Then the 38 ordering 39 -- Even if na,va,o are given, d and/or iv may be ommited. Then the 40 40 default values d=100, iv=0 (i.e. all weights = 1) are used. 41 41 The procedure creates also two ideals: 42 42 ideal jetJ - defining the miniversal base space (in `na`) 43 43 ideal jetF - defining miniversal total space (in `na`) 44 NOTE: int printlevel=2; shows what is going on 45 int printlevel=3; shows also memory usage 46 This proc uses 'execute' or calls a procedure using 'execute'. 47 If you use it in your own proc, let the local names of your proc 44 NOTE: printlevel >=0: display dimT1,T2 and explain created objects (default) 45 printlevel >=1: show partial + final result during computation 46 printlevel >=2: show also memory and time usage 47 printlevel >=3: test and show obstructions 48 printlevel >=4: create a file 'minbaseout' and (over) write part of 49 ideal of miniversal base up to current degree into it 50 This proc uses 'execute' or calls a procedure using 'execute'. 51 If you use it in your own proc, let the local names of your proc 48 52 start with @ (see the file HelpForProc) 49 EXAMPLE: example miniversal; shows an example 53 EXAMPLE: example miniversal; shows an example 50 54 { 51 55 //------- initialisation ------------------------------------------------------ 52 int @d,@deg,@t1,@t2,@colR,@noObstr; 56 int @d,@deg,@t1,@t2,@colR,@noObstr,@j; 57 int p = printlevel-voice+3; // p=printlevel+1 (default: p=1) 53 58 intvec @iv,@jv; 54 59 string @na,@va,@o; … … 60 65 if( size(#)==4 ) { @deg=#[1]; @na=#[2]; @va=#[3]; @o=#[4];} 61 66 if( size(#)==5 ) { @deg=#[1]; @na=#[2]; @va=#[3]; @o=#[4]; @iv=#[5]; } 62 if( find(@o,"s")==0 ) 67 if( find(@o,"s")==0 ) 63 68 { "// ordering must be an s-ordering, please change!"; return();} 64 65 def @Pn = basering; 66 string @ords = ordstr(@Pn); 69 70 def @Pn = basering; 71 string @ords = ordstr(@Pn); 67 72 id = simplify(id,10); 68 73 int @rowR = size(id); 69 74 if( @rowR<=1 ) 70 { 75 { 71 76 "// hypersurface, use proc deform from sing.lib"; 72 77 return(); 73 } 78 } 74 79 //------- change ordering if not correct -------------------------------------- 75 80 @t1=1; 76 for( @d=1;@d<=nvars(@Pn);@d ++) { @t1=@t1*(lead(1+var(@d))==var(@d)); }81 for( @d=1;@d<=nvars(@Pn);@d=@d+1 ) { @t1=@t1*(lead(1+var(@d))==var(@d)); } 77 82 if( @t1==0 ) 78 83 { 79 if( @ords[size(@ords)]!="c" and @ords[size(@ords)]!="C" ) 80 { 84 if( @ords[size(@ords)]!="c" and @ords[size(@ords)]!="C" ) 85 { 81 86 if( @ords[1]=="c" ) { @ords=@ords[3,size(@ords)-2]+",c"; @t1=1;} 82 87 if( @ords[1]=="C" ) { @ords=@ords[3,size(@ords)-2]+",C"; @t1=1;} 83 88 } 84 if( @t1==1 ) 85 { 89 if( @t1==1 ) 90 { 86 91 changeord("@On",@ords,@Pn); 87 92 ideal id = imap(@Pn,id); … … 90 95 if( defined(@On)==0 ) { def @On=@Pn; setring @On; } 91 96 //------- reproduce T12 ------------------------------------------------------- 92 list Ls = T12(id,1); 93 matrix Ro = Ls[ 4]; //syz(i)94 matrix InfD = Ls[ 3]; //matrix of inf. deformations95 matrix PreO = Ls[ 5]; //present. mat of Syz/Kos^*96 module PreT = Ls[ 2]; //present. module of modT297 @t1 = Ls[ 8]; //vdim of T198 @t2 = Ls[ 9]; //vdim of T297 list Ls = T12(id,1); 98 matrix Ro = Ls[6]; //syz(i) 99 matrix InfD = Ls[5]; //matrix of inf. deformations 100 matrix PreO = Ls[7]; //present. mat of Syz/Kos^* 101 module PreT = Ls[9]; //present. module of modT2 102 @t1 = Ls[3]; //vdim of T1 103 @t2 = Ls[4]; //vdim of T2 99 104 kill Ls; 100 dbpri (2,"","// ___ matrix of infinitesimal deformations:",InfD);101 @colR = ncols(Ro); 105 dbprint(p-1,"","// ___ matrix of infinitesimal deformations:",InfD); 106 @colR = ncols(Ro); 102 107 ideal i0 = std(id); 103 108 qring @Ox = i0; //ring of singularity to deform 104 matrix Cup,lCup; module PreT;109 matrix Cup,lCup; 105 110 ideal testid; 106 111 matrix Ro = fetch(@On,Ro); 107 112 matrix PreO = fetch(@On,PreO); 113 module PreT = fetch(@On,PreT); 108 114 //---- create new ring with @t1=dim T1 additional variables and initialize ---- 109 115 … … 116 122 export jetF; 117 123 matrix Fo = matrix(jetF); //initial equations 118 matrix Rs = imap(@On,Ro); //deformed syzygies 124 matrix Ro = imap(@On,Ro); 125 matrix Rs = imap(@On,Ro); //deformed syzygies 119 126 ideal jetJ; //(jet)ideal of minversal defor 120 127 export jetJ; … … 132 139 jetF= Fs; 133 140 F_R = Fs*Rs; 134 if (@t2<=0) { @d=0; } //finished, if "T2=0" 141 if (@t2<=0) { @d=0; } //finished, if "T2=0" 135 142 //------- start the loop ------------------------------------------------------ 136 for (@d=1;@d<=@deg;@d ++)137 { 138 dbpri (2,"","// ___ start computation in degree "+string(@d)+":");139 dbpri (3,"memory="+string(kmemory())+"k");143 for (@d=1;@d<=@deg;@d=@d+1) 144 { 145 dbprint(p-1,"","// ___ start computation in degree "+string(@d)+":"); 146 dbprint(p-2,"// memory = "+string(kmemory())+"k"); 140 147 //------- lift relation to next degree ---------------------------------------- 141 F_r = reduce_s(F_R,Jo,@d+1); 148 F_r = reduce_s(F_R,Jo,@d+1); 142 149 Cup = matrix(jet(F_r,@d,@jv),1,@colR); 143 150 Rn = (-1)*lift(Fo,Cup); 144 151 Rs = Rs + Rn; 145 F_R = F_R + Fs*Rn; 152 F_R = F_R + Fs*Rn; 146 153 //------- test: already finished? --------------------------------------------- 147 154 testid = simplify(reduce(ideal(F_R),Jo),10); 148 155 if (testid[1]==0) 149 { 150 "// computation finished in degree "+string(@d); 151 if( @d==@deg ) 152 {"// degree bound reached, result may not yet be complete!";} 156 { dbprint(p,"// ___ computation finished in degree "+string(@d)); 157 if( @d==@deg ) 158 { dbprint(p,"// ___ degree bound reached, result may not yet be complete!");} 153 159 break; 154 160 } 155 161 //------- compute obstruction-matrix ----------------------------------------- 156 F_r = reduce_s(F_R,Jo,@d+1); 157 Cup = matrix(jet(F_r,@d+1,@jv),1,@colR); 162 F_r = reduce_s(F_R,Jo,@d+1); 163 Cup = matrix(jet(F_r,@d+1,@jv),1,@colR); 158 164 Test= Cup; 159 dbpri (2,"","// ___ obstruction vector:",ideal(Cup));165 dbprint(p-3,"","// ___ obstruction vector:",ideal(Cup)); 160 166 Cup,Mon = coef_ideal(Cup,@t1); 161 167 //------- express obstructions in kbase of T2 -------------------------------- … … 163 169 Cup = imap(`@na`,Cup); 164 170 lCup = lift(PreO,Cup); 165 PreT = fetch(@On,PreT);166 171 lCup = lift_kbase(lCup,PreT); 167 172 @t2 = nrows(lCup); 168 dbpri (2,"","// ___ obstructions in kbase of T2:",lCup);169 testid = simplify(ideal(lCup),10); // test no obstructions173 dbprint(p-3,"","// ___ obstructions in kbase of T2:",lCup); 174 testid = simplify(ideal(lCup),10); // test no obstructions 170 175 if (testid[1]==0) 171 { @noObstr=1; } else { @noObstr=0; } 172 //------- compute ideal of minversal(its k-jet) ------------------------------- 176 { @noObstr=1;dbprint(p-3,"// ___ no obstruction"); } else { @noObstr=0; } 177 @j=size(module(gauss_col(lCup))); // test:full obstruction 178 if (@j==ncols(lCup)) 179 { dbprint(p,"","// nothing to lift!", 180 "// ___ miniversal base, defined by jetJ, is a fat point!"); 181 break; 182 } 183 //------- compute ideal of minversal base (its k-jet) ------------------------- 173 184 setring `@na`; 174 if (@noObstr==0) //case of non-zero obstr. 185 if (@noObstr==0) //case of non-zero obstr. 175 186 { 176 187 lCup = imap(@Ox,lCup); 177 188 Jo = lCup*transpose(Mon); 178 jetJ = matrix(jetJ,1,@t2)+matrix(Jo,1,@t2); 179 dbpri(2,"","// ___ degree-"+string(@d+1)+"-part of ideal of miniversal base"+":",Jo); 189 jetJ = matrix(jetJ,1,@t2)+matrix(Jo,1,@t2); 190 dbprint(p-1,"","// ___ degree-"+string(@d+1)+"-part of ideal of miniversal base"+":",Jo); 191 if( p-1>=4 ) 192 { write (">minbaseout","// part of ideal of miniversal base up to degree <= "+string(@d+1)+":",jetJ); } 180 193 Jo = std(jetJ); 181 //------- choose a defining system -------------------------------------------- 182 @iv,Cup = defining_system(lCup,Cup); 183 dbpri(2,"","// ___ number of cols of defining system:",@iv); 184 //------- lift the equations -------------------------------------------------- 185 if (sum(@iv)==0) 186 { 187 "// nothing to lift!"; 188 "// miniversal base, defined by jetJ, is a fat point!";break; 189 } 190 setring @Ox; 191 Cup = imap(`@na`,Cup); 192 Cup = submat(Cup,1..nrows(Cup),@iv); 193 dbpri(2,"","// ___ matrix of defining system:",Cup); 194 } 195 else // case of zero obstructions 196 { 197 setring @Ox; 198 Cup = imap(`@na`,Cup); 199 } 200 Cup = lift(transpose(Ro),module(Cup)); 201 setring `@na`; 202 Cup = imap(@Ox,Cup); 203 if (@noObstr==0) 204 { Mon = submat(Mon,1..nrows(Mon),@iv); } 205 Fn = (-1)*transpose(Cup*transpose(Mon)); 194 } 195 F_r = reduce_s(F_R,Jo,@d+1); 196 Cup = matrix(jet(F_r,@d+1,@jv),1,@colR); 197 //---------------- repeat test: jetJ ok in deg d+1? -------------------------- 198 if( (p-1>=3) && (@noObstr==0) ) 199 { 200 lCup,Mon = coef_ideal(Cup,@t1); 201 setring @Ox; 202 Cup = imap(`@na`,Cup); 203 lCup = lift(PreO,Cup); 204 lCup = lift_kbase(lCup,PreT); 205 dbprint(p-3,"","// ____ test: jetJ ok iff all entries are 0",lCup); 206 setring `@na`; 207 } 208 //---------------- lift equations F ----------------------------------------- 209 if (defined(Qrg)) {kill Qrg;} 210 qring Qrg = std(ideal(Fo)); 211 def Ro=fetch(`@na`,Ro); 212 def Cup=fetch(`@na`,Cup); 213 def Fn = lift(transpose(Ro),transpose(Cup)); 214 Fn=(-1)*transpose(Fn); 215 setring `@na`; 216 Fn = fetch(Qrg,Fn); 206 217 Fs = Fs+Fn; 207 F_R = F_R+Fn*Rs; 218 F_R = F_R+Fn*Rs; 208 219 jetF = matrix(Fs); 209 dbpri (2,"","// ___ degree-"+string(@d+1)+"-part of deformed equations:",Fn);210 } 220 dbprint(p-1,"","// ___ degree-"+string(@d+1)+"-part of deformed equations:",Fn); 221 } 211 222 //--------- end loop and final output --------------------------------------- 212 ""; 213 "// ___ Equations of miniversal base space ___";jetJ; "";214 "// ___ Equations of miniversal total space ___";jetF; ""; 215 "// Result belongs to ring",@na,"(total space of miniversal deformation).";216 "// Make",@na,"the basering and list objects defined in",@na,"by typing:";217 " setring",@na,"; show("+@na+");";218 " listvar(ideal);";219 kill @On; 223 dbprint(p-1,"","// ___ Equations of miniversal base space ___",jetJ, 224 "","// ___ Equations of miniversal total space ___",jetF); 225 dbprint(p,"","// Result belongs to ring "+@na+".", 226 "// Equations of total space of miniversal deformation are ", 227 "// given by jetF, equations of miniversal base space by jetJ.", 228 "// Make "+@na+" the basering and list objects defined in "+@na+" by typing:", 229 " setring "+@na+"; show("+@na+");"," listvar(ideal);"); 230 kill @On; 220 231 return(); 221 232 } 222 example 233 example 223 234 { "EXAMPLE:"; echo = 2; 224 ring r1=0,(x,y,z,u,v),ds; 225 matrix m[2][4]=x,y,z,u,y,z,u,v; 226 ideal i=minor(m,2); //cone over rational normal curve of degree 4 235 int p = printlevel; 236 ring r1 = 0,(x,y,z,u,v),ds; 237 matrix m[2][4] = x,y,z,u,y,z,u,v; 238 ideal i = minor(m,2); //cone over rational normal curve of degree 4 227 239 miniversal(i,"R","T("); 228 // hit return-key to continue; 229 // pause; 230 ring r = 0,(x,y,z),ds; 231 ideal i = x2,xy,yz,zx; 232 printlevel = 2; 233 miniversal(i);""; 234 kill printlevel; 235 // NOTE: rings R and Ont are still alive! 236 } 237 /////////////////////////////////////////////////////////////////////////////// 238 239 proc apply_col (matrix A, matrix B) 240 setring R;""; 241 // ___ Equations of miniversal base space ___: 242 jetJ;""; 243 // ___ Equations of miniversal total space ___: 244 jetF;""; 245 ring r = 0,(x,y,z),ds; 246 ideal i = x2,xy,yz,zx; 247 printlevel = 3; 248 miniversal(i);""; 249 printlevel = p; 250 // NOTE: rings R and Ont are still alive! 251 } 252 /////////////////////////////////////////////////////////////////////////////// 253 254 proc apply_col (matrix A, matrix B) 240 255 USAGE: apply_col(A,B); A,B=matrices 241 ASSUME: A = constant matrix in row-reduced (upper triangular) normal form, 256 ASSUME: A = constant matrix in row-reduced (upper triangular) normal form, 242 257 B = matrix of same size 243 258 COMUPTE: apply to B those col-operations which reduce A into col-reduced nf 244 259 RETURN: two transformed matrices: col-reduced A, transformed B 245 EXAMPLE: example apply_col; shows an example 260 EXAMPLE: example apply_col; shows an example 246 261 { 247 262 int i,j,k; … … 251 266 matrix C = concat(transpose(A),transpose(B)); 252 267 module mC = transpose(C); 253 for( k=1;k<=r;k ++)268 for( k=1;k<=r;k=k+1 ) 254 269 { 255 270 j=1; 256 while( C[j,k]==0 && j<c ) { j ++; }257 for( i=j+1;i<=c;i ++)271 while( C[j,k]==0 && j<c ) { j=j+1; } 272 for( i=j+1;i<=c;i=i+1 ) 258 273 { 259 274 m = C[i,k]; 260 mC[i] = mC[i]-m*mC[j]; 275 mC[i] = mC[i]-m*mC[j]; 261 276 } 262 277 } … … 266 281 return(transpose(a),transpose(b)); 267 282 } 268 example 283 example 269 284 { "EXAMPLE:"; echo = 2; 270 285 ring R=0,(x,y,z),dp; … … 279 294 /////////////////////////////////////////////////////////////////////////////// 280 295 281 proc defining_system (matrix A,matrix B) 296 proc defining_system (matrix A,matrix B) 282 297 USAGE: defining_system(A,B); A,B=matrices 283 298 ASSUME: A a constant matrix … … 287 302 RETURN: two objects: intvec iv, matrix M (the transformed matrix B) 288 303 The columns of M with index from iv are a defining sytem 289 EXAMPLE: example defining_system; shows an example 304 EXAMPLE: example defining_system; shows an example 290 305 { 291 306 int k,l; … … 295 310 int rg = ncols(A); 296 311 A,B = apply_col(A,B); // special columne-reduction 297 for( k=1;k<=rg;k ++) // collect zero-cols of B298 { 299 if( A[k]==0) {l ++;iv[l]=k;} // test if kth column is 0312 for( k=1;k<=rg;k=k+1 ) // collect zero-cols of B 313 { 314 if( A[k]==0) {l=l+1;iv[l]=k;} // test if kth column is 0 300 315 } // collect indices of 0-columns in iv 301 316 return(iv,B); 302 317 } 303 example 318 example 304 319 { "EXAMPLE:"; echo = 2; 305 320 ring R=0,(x,y,z),dp; … … 323 338 int d,k; 324 339 ideal j0 = std(j); 325 for (k=1;k<=m;k ++)340 for (k=1;k<=m;k=k+1) 326 341 { 327 342 if (deg(i[k])>=0) … … 333 348 return(i); 334 349 } 335 example 350 example 336 351 { "EXAMPLE:"; echo = 2; 337 352 ring r = 0,(x,y),ds; 338 353 poly f = x7+y7+(x-y)^2*x^2*y^2; 339 354 ideal j = jacob(f); 340 reduce_s(f,j,10); 355 reduce_s(f,j,10); 341 356 } 342 357 /////////////////////////////////////////////////////////////////////////////// … … 344 359 proc lift_kbase (N, M) 345 360 USAGE: lift_kbase(N,M); N,M=poly/ideal/vector/module 346 RETURN: matrix A, coefficient matrix expressing N as linear combination of 347 k-basis of M. Let the k-basis have k elements and A c columns.361 RETURN: matrix A, coefficient matrix expressing N as linear combination of 362 k-basis of M. Let the k-basis have k elements and size(N)=c columns. 348 363 Then A satisfies: 349 364 matrix(reduce(N,std(M)),k,c) = matrix(kbase(std(M)))*A 350 ASSUME: dim(M)=0 and the monomial ordering is a well ordering or the last 365 ASSUME: dim(M)=0 and the monomial ordering is a well ordering or the last 351 366 block of the ordering is c or C 352 367 EXAMPLE: example lift_kbase; shows an example … … 360 375 //------- check wether ordering is correct ------------------------------------ 361 376 k=1; 362 for( l=1;l<=nvars(basering);l ++) { k=k*(lead(1+var(l))==var(l)); }377 for( l=1;l<=nvars(basering);l=l+1 ) { k=k*(lead(1+var(l))==var(l)); } 363 378 if( k==0 ) 364 379 { 365 if( ords[size(ords)]!="c" and ords[size(ords)]!="C" ) 366 { 380 if( ords[size(ords)]!="c" and ords[size(ords)]!="C" ) 381 { 367 382 "// change ordering!"; 368 "// ordering "+ordstr(basering)+" not implemented for this proc"; 369 return(); 383 "// ordering "+ordstr(basering)+" not implemented for this proc"; 384 return(); 370 385 } 371 386 } … … 377 392 if( d<1 ) 378 393 { "// second argument in `lift_kbase` has vdim",d; return(); } 379 //---------- compute kbase and reduce(N,M) ----------------------------------- 394 //---------- compute kbase and reduce(N,M) ----------------------------------- 380 395 kb = kbase(M); 381 396 col = ncols(N); 382 397 N = reduce(N,M); 398 N = matrix(N,nrows(N),col); 383 399 //---------- collecting coefficients of reduce(N,M) -------------------------- 384 400 matrix result[d][col]; … … 389 405 { 390 406 for( k=1;k<=d;k=k+1 ) 391 { 407 { 392 408 p = kb[k]; 393 q = lead(v); 409 q = lead(v); 394 410 if( size(p-q)<2 ) 395 411 { … … 399 415 else { k=0; } 400 416 } 401 } 417 } 402 418 } 403 419 } 404 420 //--------- final test ------------------------------------------------------- 405 421 testm = matrix(N,nrows(kb),ncols(result))- matrix(kb)*result; 406 if( size(module(testm))!=0 ) 407 { 422 if( size(module(testm))!=0 ) 423 { 408 424 "// proc `lift_kbase` did'nt work correctly!"; 409 425 "// Please inform tthe authors"; … … 413 429 } 414 430 example 415 { 416 "EXAMPLE:"; echo=2; 431 {"EXAMPLE:"; echo=2; 417 432 ring R=0,(x,y),ds; 418 433 module M=[x2,xy],[y2,xy],[0,xx],[0,yy]; … … 432 447 ASSUME: M=matrix with only one row and without any constant term 433 448 COMPUTE: coef_matrices with respect to first s variables 434 RETURN: 2 matrices: 449 RETURN: 2 matrices: 435 450 matrix of coefficients (each column is formed by the coefficients 436 of M with respect to some monomial) 437 row-matrix of corresponding monomials 451 of M with respect to some monomial) 452 row-matrix of corresponding monomials 438 453 EXAMPLE: example coef_ideal; shows an example 439 454 { 440 455 int k,l,n,z; 441 456 int cM = ncols(M); 442 ideal flatM = M; 457 ideal flatM = M; 443 458 ideal monId,flat; 444 459 poly mon = product(maxideal(1),1..s); 445 460 //--------- collect all monomials (!=1) --------------------------------------- 446 for (k=1;k<=cM;k ++)461 for (k=1;k<=cM;k=k+1) 447 462 { 448 463 matrix mci(k) = coef(flatM[k],mon); … … 450 465 if (flat[1]!=1) 451 466 { monId = monId,flat;} 452 } 467 } 453 468 monId = monId+ideal(0); 454 469 k=size(monId); 455 470 matrix BIG[cM][k]; 456 471 //--------- create coef_matrices -------------------------------------------- 457 for (n=1;n<=k;n ++)472 for (n=1;n<=k;n=n+1) 458 473 { 459 for (l=1;l<=cM;l ++)474 for (l=1;l<=cM;l=l+1) 460 475 { 461 for (z=1;z<=ncols(mci(l));z ++)476 for (z=1;z<=ncols(mci(l));z=z+1) 462 477 { 463 478 if(mci(l)[1,z]==monId[n]) 464 479 { BIG[l,n] = mci(l)[2,z];} 465 } 480 } 466 481 } 467 } 482 } 468 483 return(BIG,matrix(monId)); 469 } 470 example 484 } 485 example 471 486 { "EXAMPLE:"; echo = 2; 472 487 ring Z = 0,(A,B,C,x,y,z),ds; 473 int s = 3; 488 int s = 3; 474 489 matrix M[1][4]=A+yB,2C,3AA,4BB+5CC; 475 490 print(M); … … 480 495 } 481 496 /////////////////////////////////////////////////////////////////////////////// 482 ----------483 484 "example in r1: i=cone rational normal curve d=4";485 int d=4;486 ring r1=0,(x,y,z,u,v),ds;487 matrix m[2][4]=x,y,z,u,y,z,u,v;488 ideal i=minor(m,2);489 i=minbase(i);490 i;pause;491 int t=timer;miniversal(i);timer-t;492 ----------493 494 "example: in r4 i=cone rational normal curve d=5";495 int d=5;496 ring s=0,(x,y,z,u,v,w),ds;497 matrix m[2][5]=x,y,z,u,v,y,z,u,v,w;498 ideal i=minor(m,2);499 i=minbase(i);500 i;pause;501 502 ----------503 504 "Example: in r5 i=L_n^n, n=4;";505 ring r5=0,(x,y,z,u),ds;506 ideal i;507 i=xy,xz,xu,yz,yu,zu;508 i;pause;509 510 ----------511 512 "Example 1 : cyclic quotient in ws513 (type setring r1;sud(i);)";514 ring r1=0,(x,y,z,u,v),ws(4,3,2,3,4);515 ideal i=xz-y2,yz2-xu,xv-yzu,yu-z3,z2u-yv,zv-u2;516 i;517 518 "Example 2: same in wp519 (ringr r2)";520 ring r2=0,(x,y,z,u,v),wp(4,3,2,3,4);521 ideal i=xz-y2,yz2-xu,xv-yzu,yu-z3,z2u-yv,zv-u2;522 i;523 524 "Example 3: same in ls";525 ring r3=0,(x,y,z,u,v),ls;526 ideal i=xz-y2,yz2-xu,xv-yzu,yu-z3,z2u-yv,zv-u2;527 i;528 529 "Example 4: by chance for testing";530 ring r4=0,(x,y,z),ds;531 ideal i=xy,yz,xz+y3,x2+y2+z3;532 i;533
Note: See TracChangeset
for help on using the changeset viewer.