Changeset 8893c4 in git
- Timestamp:
- Dec 12, 2000, 2:50:46 PM (22 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
- Children:
- c3a77ffc93a105d674670a6432c0deddfbc49872
- Parents:
- 5909989d37a53ff85938a4254092415537555abb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/spcurve.lib
r590998 r8893c4 1 // $Id: spcurve.lib,v 1.1 0 2000-12-07 14:29:52 SingularExp $1 // $Id: spcurve.lib,v 1.11 2000-12-12 13:50:46 anne Exp $ 2 2 // (anne, last modified 31.5.99) 3 3 ///////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: spcurve.lib,v 1.1 0 2000-12-07 14:29:52 SingularExp $";5 version="$Id: spcurve.lib,v 1.11 2000-12-12 13:50:46 anne Exp $"; 6 6 info=" 7 7 LIBRARY: spcurve.lib PROCEDURES FOR CM CODIMENSION 2 SINGULARITIES … … 18 18 posweight(M,T1,i); deformation of coker(M) of non-negative weight 19 19 KSpencerKernel(M); kernel of the Kodaira-Spencer map 20 mod2id(M,iv); conversion of a module M to an ideal21 id2mod(i,iv); conversion inverse to mod2id22 subrInterred(i1,i2,iv) interred w.r.t. a subset of variables23 20 "; 24 21 … … 1089 1086 /////////////////////////////////////////////////////////////////////////// 1090 1087 1091 proc mod2id(matrix M,intvec vpos)1092 "USAGE: mod2id(M,vpos); M matrix, vpos intvec1093 ASSUME: vpos is an integer vector such that gen(i) corresponds1094 to var(vpos[i])1095 the basering contains variables var(vpos[i]) which do not occur1096 in M1097 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 the1100 module M such that e(i)*e(j)=0 for all i,j1101 the new ring should already exist and be the current ring1102 RETURN: ideal i in which each gen(i) from the module is replaced by1103 var(vpos[i]) and all monomials var(vpos[i])*var(vpos[j]) have1104 been added to the generating set of i1105 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 matrix1110 // for the multiplication1111 //----------------------------------------------------------------------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 ideal1127 //----------------------------------------------------------------------1128 ideal ret=vars^2,varm*M;1129 return(ret);1130 }1131 example1132 { "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 intvec1142 NOTE: * use this procedure only makes sense if the ideal contains1143 all var(vpos[i])*var(vpos[j]) as monomial generators and1144 all other generators are linear combinations of the1145 var(vpos[i]) over the ring in the other variables1146 * this is the inverse procedure to mod2id and should be applied1147 only to ideals created by mod2id using the same intvec vpos1148 (possibly after a standard basis computation)1149 RETURN: module corresponding to the ideal by replacing var(vpos[i]) by1150 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 // Initialization1156 //---------------------------------------------------------------------1157 int n=size(i);1158 int v=size(vpos);1159 matrix tempmat;1160 matrix mm[v][n];1161 //---------------------------------------------------------------------1162 // Conversion1163 //---------------------------------------------------------------------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 example1177 { "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_s1189 mon: ideal with monomial generators (not divisible by1190 one of the t_i) such that sm is contained in the module1191 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 used1193 as x_i1194 RETURN: interreduced system of generators of sm seen as a submodule1195 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 monomials1201 // and sort its generators with respect to the monomial ordering1202 //-----------------------------------------------------------------------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 m1232 // can be considered as a submodule of k[t_1,..,t_n]*mon1233 //-----------------------------------------------------------------------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 back1261 //----------------------------------------------------------------------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 example1280 { "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.