Changeset 8893c4 in git


Ignore:
Timestamp:
Dec 12, 2000, 2:50:46 PM (22 years ago)
Author:
Anne Frühbis-Krüger <anne@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
c3a77ffc93a105d674670a6432c0deddfbc49872
Parents:
5909989d37a53ff85938a4254092415537555abb
Message:
*anne: moved mod2id id2mod and subrInterred to poly.lib


git-svn-id: file:///usr/local/Singular/svn/trunk@4876 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/spcurve.lib

    r590998 r8893c4  
    1 // $Id: spcurve.lib,v 1.10 2000-12-07 14:29:52 Singular Exp $
     1// $Id: spcurve.lib,v 1.11 2000-12-12 13:50:46 anne Exp $
    22// (anne, last modified 31.5.99)
    33/////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: spcurve.lib,v 1.10 2000-12-07 14:29:52 Singular Exp $";
     5version="$Id: spcurve.lib,v 1.11 2000-12-12 13:50:46 anne Exp $";
    66info="
    77LIBRARY: spcurve.lib    PROCEDURES FOR CM CODIMENSION 2 SINGULARITIES
     
    1818 posweight(M,T1,i);      deformation of coker(M) of non-negative weight
    1919 KSpencerKernel(M);      kernel of the Kodaira-Spencer map
    20  mod2id(M,iv);           conversion of a module M to an ideal
    21  id2mod(i,iv);           conversion inverse to mod2id
    22  subrInterred(i1,i2,iv)  interred w.r.t. a subset of variables
    2320";
    2421
     
    10891086///////////////////////////////////////////////////////////////////////////
    10901087
    1091 proc mod2id(matrix M,intvec vpos)
    1092 "USAGE:     mod2id(M,vpos); M matrix, vpos intvec
    1093 ASSUME:    vpos is an integer vector such that gen(i) corresponds
    1094            to var(vpos[i])
    1095            the basering contains variables var(vpos[i]) which do not occur
    1096            in M
    1097 NOTE:      this procedure should be used in the following situation:
    1098            one wants to pass to a ring with new variables, say e(1),..,e(s),
    1099            which correspond to the components gen(1),..,gen(s) of the
    1100            module M such that e(i)*e(j)=0 for all i,j
    1101            the new ring should already exist and be the current ring
    1102 RETURN:    ideal i in which each gen(i) from the module is replaced by
    1103            var(vpos[i]) and all monomials var(vpos[i])*var(vpos[j]) have
    1104            been added to the generating set of i
    1105 EXAMPLE:   example mod2id; shows an example"
    1106 {
    1107   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    1108 //----------------------------------------------------------------------
    1109 // define the ideal generated by the var(vpos[i]) and set up the matrix
    1110 // for the multiplication
    1111 //----------------------------------------------------------------------
    1112   ideal vars=var(vpos[1]);
    1113   for(int i=2;i<=size(vpos);i++)
    1114   {
    1115     vars=vars,var(vpos[i]);
    1116   }
    1117   matrix varm[1][size(vpos)]=vars;
    1118   if (size(vpos) > nrows(M))
    1119   {
    1120     matrix Mt[size(vpos)][ncols(M)];
    1121     Mt[1..nrows(M),1..ncols(M)]=M;
    1122     kill M;
    1123     matrix M=Mt;
    1124   }
    1125 //----------------------------------------------------------------------
    1126 // define the desired ideal
    1127 //----------------------------------------------------------------------
    1128   ideal ret=vars^2,varm*M;
    1129   return(ret);
    1130 }
    1131 example
    1132 { "EXAMPLE:"; echo=2;
    1133   ring r=0,(e(1),e(2),x,y,z),(dp(2),ds(3));
    1134   module mo=x*gen(1)+y*gen(2);
    1135   intvec iv=2,1;
    1136   mod2id(mo,iv);
    1137 }
    1138 ////////////////////////////////////////////////////////////////////////
    1139 
    1140 proc id2mod(ideal i,intvec vpos)
    1141 "USAGE:     id2mod(I,vpos); I ideal, vpos intvec
    1142 NOTE:      * use this procedure only makes sense if the ideal contains
    1143              all var(vpos[i])*var(vpos[j]) as monomial generators and
    1144              all other generators are linear combinations of the
    1145              var(vpos[i]) over the ring in the other variables
    1146            * this is the inverse procedure to mod2id and should be applied
    1147              only to ideals created by mod2id using the same intvec vpos
    1148              (possibly after a standard basis computation)
    1149 RETURN:    module corresponding to the ideal by replacing var(vpos[i]) by
    1150            gen(i) and omitting all generators var(vpos[i])*var(vpos[j])
    1151 EXAMPLE:   example id2mod; shows an example"
    1152 {
    1153   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    1154 //---------------------------------------------------------------------
    1155 // Initialization
    1156 //---------------------------------------------------------------------
    1157   int n=size(i);
    1158   int v=size(vpos);
    1159   matrix tempmat;
    1160   matrix mm[v][n];
    1161 //---------------------------------------------------------------------
    1162 // Conversion
    1163 //---------------------------------------------------------------------
    1164   for(int j=1;j<=v;j++)
    1165   {
    1166     tempmat=coeffs(i,var(vpos[j]));
    1167     mm[j,1..n]=tempmat[2,1..n];
    1168   }
    1169   for(j=1;j<=v;j++)
    1170   {
    1171     mm=subst(mm,var(vpos[j]),0);
    1172   }
    1173   module ret=simplify(mm,10);
    1174   return(ret);
    1175 }
    1176 example
    1177 { "EXAMPLE:"; echo=2;
    1178   ring r=0,(e(1),e(2),x,y,z),(dp(2),ds(3));
    1179   ideal i=e(2)^2,e(1)*e(2),e(1)^2,e(1)*y+e(2)*x;
    1180   intvec iv=2,1;
    1181   id2mod(i,iv);
    1182 }
    1183 ///////////////////////////////////////////////////////////////////////
    1184 
    1185 proc subrInterred(ideal mon, ideal sm, intvec iv)
    1186 "USAGE:    subrInterred(mon,sm,iv);
    1187           sm:   ideal in a ring r with n + s variables,
    1188                 e.g. x_1,..,x_n and t_1,..,t_s
    1189           mon:  ideal with monomial generators (not divisible by
    1190                 one of the t_i) such that sm is contained in the module
    1191                 k[t_1,..,t_s]*mon[1]+..+k[t_1,..,t_s]*mon[size(mon)]
    1192           iv:   intvec listing the variables which are supposed to be used
    1193                 as x_i
    1194 RETURN:   interreduced system of generators of sm seen as a submodule
    1195           of k[t_1,..,t_s]*mon[1]+..+k[t_1,..,t_s]*mon[size(mon)]
    1196 EXAMPLE:  example subrInterred; shows an example"
    1197 {
    1198   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    1199 //-----------------------------------------------------------------------
    1200 // check that mon is really generated by monomials
    1201 // and sort its generators with respect to the monomial ordering
    1202 //-----------------------------------------------------------------------
    1203   int err;
    1204   for(int i=1;i<=ncols(mon);i++)
    1205   {
    1206     if ( size(mon[i]) > 1 )
    1207     {
    1208       err=1;
    1209     }
    1210   }
    1211   if (err==1)
    1212   {
    1213     ERROR("mon has to be generated by monomials");
    1214   }
    1215   intvec sv=sortvec(mon);
    1216   ideal mons;
    1217   for(i=1;i<=size(sv);i++)
    1218   {
    1219     mons[i]=mon[sv[i]];
    1220   }
    1221   ideal itemp=maxideal(1);
    1222   for(i=1;i<=size(iv);i++)
    1223   {
    1224     itemp=subst(itemp,var(iv[i]),0);
    1225   }
    1226   itemp=simplify(itemp,10);
    1227   def r=basering;
    1228   string tempstr="ring rtemp=" + charstr(basering) + ",(" + string(itemp)
    1229                                + "),(C,dp);";
    1230 //-----------------------------------------------------------------------
    1231 // express m in terms of the generators of mon and check whether m
    1232 // can be considered as a submodule of k[t_1,..,t_n]*mon
    1233 //-----------------------------------------------------------------------
    1234   module motemp;
    1235   motemp[ncols(sm)]=0;
    1236   poly ptemp;
    1237   int j;
    1238   for(i=1;i<=ncols(mons);i++)
    1239   {
    1240     for(j=1;j<=ncols(sm);j++)
    1241     {
    1242       ptemp=sm[j]/mons[i];
    1243       motemp[j]=motemp[j]+ptemp*gen(i);
    1244     }
    1245   }
    1246   for(i=1;i<=size(iv);i++)
    1247   {
    1248     motemp=subst(motemp,var(iv[i]),0);
    1249   }
    1250   matrix monmat[1][ncols(mons)]=mons;
    1251   ideal dummy=monmat*motemp;
    1252   for(i=1;i<=size(sm);i++)
    1253   {
    1254     if(sm[i]-dummy[i]!=0)
    1255     {
    1256       ERROR("the second argument is not a submodule of the assumed structure");
    1257     }
    1258   }
    1259 //----------------------------------------------------------------------
    1260 // do the interreduction and convert back
    1261 //----------------------------------------------------------------------
    1262   execute(tempstr);
    1263   def motemp=imap(r,motemp);
    1264   motemp=interred(motemp);
    1265   setring r;
    1266   kill motemp;
    1267   def motemp=imap(rtemp,motemp);
    1268   list ret=monmat,motemp,monmat*motemp;
    1269   for(i=1;i<=ncols(ret[2]);i++)
    1270   {
    1271     ret[2][i]=cleardenom(ret[2][i]);
    1272   }
    1273   for(i=1;i<=ncols(ret[3]);i++)
    1274   {
    1275     ret[3][i]=cleardenom(ret[3][i]);
    1276   }
    1277   return(ret);
    1278 }
    1279 example
    1280 { "EXAMPLE:"; echo=2;
    1281   ring r=0,(x,y,z),dp;
    1282   ideal i=x^2+x*y^2,x*y+x^2*y,z;
    1283   ideal j=x^2+x*y^2,x*y,z;
    1284   ideal mon=x^2,z,x*y;
    1285   intvec iv=1,3;
    1286   subrInterred(mon,i,iv);
    1287   subrInterred(mon,j,iv);
    1288 }
    1289 ////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.