Changeset d70bc7 in git


Ignore:
Timestamp:
Nov 5, 2001, 2:58:38 PM (22 years ago)
Author:
Mathias Schulze <mschulze@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5b3302cc6f7c9964ee19073aca0b273ad9e606a9
Parents:
1f8111cd2acad6f5a631540b24272cf5aca44000
Message:
*** empty log message ***


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gaussman.lib

    r1f8111c rd70bc7  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: gaussman.lib,v 1.55 2001-11-05 09:16:48 mschulze Exp $";
     2version="$Id: gaussman.lib,v 1.56 2001-11-05 13:58:38 mschulze Exp $";
    33category="Singularities";
    44
     
    2323 saito(t);                  matrix A0+A1*s of t on H''
    2424 endvfilt(V);               endomorphism V-filtration
    25  spprint(Sp);               print spectrum Sp
    26  sppprint(Spp);             print spectral pairs Spp
    27  spadd(Sp1,Sp2);            sum of spectra Sp1 and Sp2
    28  spsub(Sp1,Sp2);            difference of spectra Sp1 and Sp2
    29  spmul(Sp,k);               product of spectrum Sp and integer k
    30  spmul(Sp,k);               linear combination of spectra Sp with coeffs k
    31  spissemicont(Sp[,opt]);    test spectrum Sp for semicontinuity
    32  spsemicont(Sp0,Sp[,opt]);  semicontinuity of spectra Sp0 and Sp
    33  spmilnor(Sp);              milnor number of spectrum Sp
    34  spgeomgenus(Sp);           geometrical genus of spectrum Sp
    35  spgamma(Sp);               gamma invariant of spectrum Sp
     25 spprint(sp);               print spectrum sp
     26 sppprint(spp);             print spectral pairs spp
     27 spadd(sp1,sp2);            sum of spectra sp1 and sp2
     28 spsub(sp1,sp2);            difference of spectra sp1 and sp2
     29 spmul(sp,k);               product of spectrum sp and integer k
     30 spmul(sp,k);               linear combination of spectra sp with coeffs k
     31 spissemicont(sp[,opt]);    test spectrum sp for semicontinuity
     32 spsemicont(sp0,sp[,opt]);  semicontinuity of spectra sp0 and sp
     33 spmilnor(sp);              milnor number of spectrum sp
     34 spgeomgenus(sp);           geometrical genus of spectrum sp
     35 spgamma(sp);               gamma invariant of spectrum sp
    3636
    3737SEE ALSO: mondromy_lib, spectrum_lib
     
    3939KEYWORDS: singularities; Gauss-Manin connection; Brieskorn lattice;
    4040          monodromy; spectrum; spectral pairs;
    41           Hodge filtration; V-filtration; weight filtration
     41          mixed Hodge structure; V-filtration; weight filtration
    4242";
    4343
     
    572572{ "EXAMPLE:"; echo=2;
    573573  ring R=0,(x,y),ds;
    574   poly f=x5+x2y2+y5;
    575   print(monodromy(f));
     574  poly t=x5+x2y2+y5;
     575  monodromy(t);
    576576}
    577577///////////////////////////////////////////////////////////////////////////////
     
    583583RETURN:
    584584@format
    585 list Sp: spectrum of t
    586   ideal Sp[1]: V-filtration indices in increasing order
    587   intvec Sp[2]: weight filtration indices in decreasing order
    588   intvec Sp[3]:
    589     int Sp[3][i]: multiplicity of spectral number Sp[1][i]
     585list sp: spectrum of t
     586  ideal sp[1]: V-filtration indices in increasing order
     587  intvec sp[2]: weight filtration indices in decreasing order
     588  intvec sp[3]:
     589    int sp[3][i]: multiplicity of spectral number sp[1][i]
    590590@end format
    591591SEE ALSO: spectrum_lib
    592592KEYWORDS: singularities; Gauss-Manin connection; Brieskorn lattice;
    593           mixed Hodge structure; spectrum
     593          mixed Hodge structure; V-filtration; spectrum
    594594EXAMPLE:  example spectrum; shows examples
    595595"
     
    612612RETURN:
    613613@format
    614 list Spp: spectrum of t
    615   ideal Spp[1],intvec Spp[2]: spectral pairs in in-/decreasing lex. order
    616   intvec Spp[3]:
    617     int Spp[3][i]: multiplicity of spectral pair (Spp[1][i],Spp[2][i])
     614list spp: spectrum of t
     615  ideal spp[1],intvec spp[2]: spectral pairs in in-/decreasing lex. order
     616  intvec spp[3]:
     617    int spp[3][i]: multiplicity of spectral pair (spp[1][i],spp[2][i])
    618618@end format
    619619SEE ALSO: spectrum_lib
    620620KEYWORDS: singularities; Gauss-Manin connection; Brieskorn lattice;
    621           mixed Hodge structure; spectrum; spectral pairs
     621          mixed Hodge structure; V-filtration; weight filtration;
     622          spectrum; spectral pairs
    622623EXAMPLE:  example sppairs; shows examples
    623624"
     
    638639RETURN:
    639640@format
    640 list Spp: normalized spectral pairs (a,w,m[,V])
    641   ideal Spp[1]: numbers in a in increasing order
    642   intvec Spp[2]: integers in w in decreasing order
    643   intvec Spp[3]:
    644     int Spp[3][i]: multiplicity of pair (Spp[1][i],Spp[2][i]) in (a,w)
    645   list Spp[4]:
    646     module Spp[4][i]: module associated to pair (Spp[1][i],Spp[2][i])
     641list spp: normalized spectral pairs (a,w,m[,V])
     642  ideal spp[1]: numbers in a in increasing order
     643  intvec spp[2]: integers in w in decreasing order
     644  intvec spp[3]:
     645    int spp[3][i]: multiplicity of pair (spp[1][i],spp[2][i]) in (a,w)
     646  list spp[4]:
     647    module spp[4][i]: module associated to pair (spp[1][i],spp[2][i])
    647648@end format
    648649EXAMPLE:  example sppnorm; shows examples
     
    771772ASSUME:   basering with characteristic 0 and local degree ordering,
    772773          t with isolated citical point 0
    773 RETURN:
     774RETURN:t
    774775@format
    775 list V: V-filtration on H''/H'
    776   ideal V[1]: spectral numbers in increasing order
    777   intvec V[2]:
    778     int V[2][i]: multiplicity of spectral number V[1][i]
    779   list V[4]:
    780     module V[4][i]: vector space basis of V[1][i]-th graded part
    781                     in terms of V[4]
    782   ideal V[4]: monomial vector space basis of H''/H'
    783   ideal V[5]: standard basis of Jacobian ideal
     776list v: V-filtration on H''/H'
     777  ideal v[1]: spectral numbers in increasing order
     778  intvec v[2]:
     779    int v[2][i]: multiplicity of spectral number v[1][i]
     780  list v[4]:
     781    module v[4][i]: vector space basis of v[1][i]-th graded part
     782                    in terms of v[4]
     783  ideal v[4]: monomial vector space basis of H''/H'
     784  ideal v[5]: standard basis of Jacobian ideal
    784785@end format
    785786SEE ALSO: spectrum_lib
     
    806807RETURN:
    807808@format
    808 list VW: weight refined V-filtration on H''/H'
    809   ideal VW[1]: spectral numbers in increasing order
    810   intvec VW[2]: weights in decreasing order
    811   intvec VW[3]:
    812     int VW[3][i]: multiplicity of spectral pair (VW[1][i],VW[2][i])
    813   list VW[4]:
    814     module VW[4][i]: vector space basis of (VW[1][i],VW[2][i])-th graded part
    815                      in terms of VW[5]
    816   ideal VW[5]: monomial vector space basis of H''/H'
    817   ideal VW[6]: standard basis of Jacobian ideal
     809list vw: weight refined V-filtration on H''/H'
     810  ideal vw[1]: spectral numbers in increasing order
     811  intvec vw[2]: weights in decreasing order
     812  intvec vw[3]:
     813    int vw[3][i]: multiplicity of spectral pair (vw[1][i],vw[2][i])
     814  list vw[4]:
     815    module vw[4][i]: vector space basis of (vw[1][i],vw[2][i])-th graded part
     816                     in terms of vw[5]
     817  ideal vw[5]: monomial vector space basis of H''/H'
     818  ideal vw[6]: standard basis of Jacobian ideal
    818819@end format
    819820SEE ALSO: spectrum_lib
     
    879880  }
    880881  kill v;
    881   module v=simplify(grmat(H*U0*H0,2*k0),1);
     882  module v=simplify(jet(H*U0*H0,2*k0)/s^(2*k0),1);
    882883
    883884  setring(R);
     
    891892  poly t=x5+x2y2+y5;
    892893  vwfilt(t);
    893 }
    894 ///////////////////////////////////////////////////////////////////////////////
    895 
    896 proc vfilt1(poly t,list #)
    897 "USAGE:    vfilt1(t[,opt]); poly t, int opt
    898 ASSUME:   basering with characteristic 0 and local degree ordering,
    899           t with isolated citical point 0
    900 RETURN:
    901 @format
    902 list V: V-filtration of t on H''/H'
    903   intvec V[1]: spectral numbers in increasing order
    904   intvec V[2]:
    905     int V[2][i]: multiplicity of spectral number V[1][i]/V[2][i]
    906 if opt>=1:
    907   list V[4]:
    908     module V[3][i]: vector space basis of V[1][i]/V[2][i]-th graded part
    909                     in terms of V[5]
    910   ideal V[4]: monomial vector space basis of H''/H'
    911   ideal V[5]: standard basis of Jacobian ideal
    912 default: opt=1
    913 @end format
    914 NOTE:     H' and H'' denote the Brieskorn lattices
    915 SEE ALSO: spectrum_lib
    916 KEYWORDS: singularities; Gauss-Manin connection; Brieskorn lattice;
    917           Hodge filtration; V-filtration; spectrum
    918 EXAMPLE:  example vfilt1; shows examples
    919 "
    920 {
    921   int opt=1;
    922   if(size(#)>0)
    923   {
    924     if(typeof(#[1])=="int")
    925     {
    926       opt=#[1];
    927     }
    928   }
    929 
    930   def R=basering;
    931   int n=nvars(R)-1;
    932   def G=gmsring(t,"s");
    933   setring G;
    934 
    935   int mu=ncols(gmsbasis);
    936   ideal r=gmspoly*gmsbasis;
    937   list l;
    938   matrix A[mu][mu],C;
    939   module H,H1=freemodule(mu),freemodule(mu);
    940   module H0;
    941   int k=-1;
    942   int N=n+1;
    943 
    944   while(size(reduce(H,std(H0*s)))>0)
    945   {
    946     k++;
    947     dbprint(printlevel-voice+2,"// k="+string(k));
    948     dbprint(printlevel-voice+2,"// compute matrix A of t");
    949     l=gmscoeffs(r,k);
    950     C,r=l[1..2];
    951     A=A+C;
    952 
    953     dbprint(printlevel-voice+2,"// compute saturation of H''");
    954     H0=H;
    955     H1=jet(module(A*H1+s^2*diff(matrix(H1),s)),k);
    956     H=H*s+H1;
    957   }
    958   A=A-k*s;
    959 
    960   dbprint(printlevel-voice+2,"// compute basis of saturation of H''");
    961   H=std(H0);
    962   int d0=maxdeg1(H);
    963   dbprint(printlevel-voice+2,"// k="+string(d0+N));
    964   dbprint(printlevel-voice+2,"// compute matrix A of t");
    965   l=gmscoeffs(r,d0+N,d0+N);
    966   C,r=l[1..2];
    967   A=A+C;
    968 
    969   dbprint(printlevel-voice+2,"// transform H'' to saturation of H''");
    970   l=division(H,freemodule(mu)*s^k);
    971   H0=jet(l[1],l[2],N-1);
    972 
    973   dbprint(printlevel-voice+2,"// compute vector spaces");
    974   poly p;
    975   int i0,j0,i1,j1;
    976   matrix V0[mu*N][mu*N];
    977   matrix V1[mu*N][mu*(N-1)];
    978   for(i0=mu;i0>=1;i0--)
    979   {
    980     for(i1=mu;i1>=1;i1--)
    981     {
    982       p=H0[i1,i0];
    983       while(p!=0)
    984       {
    985         j1=leadexp(p)[1];
    986         for(j0=N-j1-1;j0>=0;j0--)
    987         {
    988           V0[i1+(j1+j0)*mu,i0+j0*mu]=V0[i1+(j1+j0)*mu,i0+j0*mu]+leadcoef(p);
    989           if(j1+j0+1<N)
    990           {
    991             V1[i1+(j1+j0+1)*mu,i0+j0*mu]=
    992             V1[i1+(j1+j0+1)*mu,i0+j0*mu]+leadcoef(p);
    993           }
    994         }
    995         p=p-lead(p);
    996       }
    997     }
    998   }
    999 
    1000   dbprint(printlevel-voice+2,"// transform A to saturation of H''");
    1001   l=division(H*s,A*H+s^2*diff(matrix(H),s));
    1002   A=jet(l[1],l[2],N-1);
    1003 
    1004   dbprint(printlevel-voice+2,"// compute matrix M of A");
    1005   matrix M[mu*N][mu*N];
    1006   for(i0=mu;i0>=1;i0--)
    1007   {
    1008     for(i1=mu;i1>=1;i1--)
    1009     {
    1010       p=A[i1,i0];
    1011       while(p!=0)
    1012       {
    1013         j1=leadexp(p)[1];
    1014         for(j0=N-j1-1;j0>=0;j0--)
    1015         {
    1016           M[i1+(j0+j1)*mu,i0+j0*mu]=leadcoef(p);
    1017         }
    1018         p=p-lead(p);
    1019       }
    1020     }
    1021   }
    1022   for(i0=mu;i0>=1;i0--)
    1023   {
    1024     for(j0=N-1;j0>=0;j0--)
    1025     {
    1026       M[i0+j0*mu,i0+j0*mu]=M[i0+j0*mu,i0+j0*mu]+j0;
    1027     }
    1028   }
    1029 
    1030   dbprint(printlevel-voice+2,"// compute eigenvalues eA of A");
    1031   ideal eA=eigenvalues(jet(A,0))[1];
    1032   dbprint(printlevel-voice+2,"// eA="+string(eA));
    1033 
    1034   dbprint(printlevel-voice+2,"// compute eigenvalues eM of M");
    1035   ideal eM;
    1036   k=0;
    1037   intvec u;
    1038   for(int i=N;i>=1;i--)
    1039   {
    1040     u[i]=1;
    1041   }
    1042   i0=1;
    1043   while(u[N]<=ncols(eA))
    1044   {
    1045     for(i,i1=i0+1,i0;i<=N;i++)
    1046     {
    1047       if(eA[u[i]]+i<eA[u[i1]]+i1)
    1048       {
    1049         i1=i;
    1050       }
    1051     }
    1052     k++;
    1053     eM[k]=eA[u[i1]]+i1-1;
    1054     u[i1]=u[i1]+1;
    1055     if(u[i1]>ncols(eA))
    1056     {
    1057       i0=i1+1;
    1058     }
    1059   }
    1060   dbprint(printlevel-voice+2,"// eM="+string(eM));
    1061 
    1062   dbprint(printlevel-voice+2,"// compute V-filtration on H''/sH''");
    1063   ideal a;
    1064   k=0;
    1065   list V;
    1066   V[ncols(eM)+1]=interred(V1);
    1067   intvec d;
    1068   if(opt<=0)
    1069   {
    1070     for(i=ncols(eM);number(eM[i])-1>number(n-1)/2;i--)
    1071     {
    1072       dbprint(printlevel-voice+2,"// compute V["+string(i)+"]");
    1073       V1=module(V1)+syz(power(M-eM[i],n+1));
    1074       V[i]=interred(intersect(V1,V0));
    1075 
    1076       if(size(V[i])>size(V[i+1]))
    1077       {
    1078         k++;
    1079         a[k]=eM[i]-1;
    1080         d[k]=size(V[i])-size(V[i+1]);
    1081       }
    1082     }
    1083 
    1084     dbprint(printlevel-voice+2,"// symmetry index found");
    1085     int j=k;
    1086 
    1087     if(number(eM[i])-1==number(n-1)/2)
    1088     {
    1089       dbprint(printlevel-voice+2,"// compute V["+string(i)+"]");
    1090       V1=module(V1)+syz(power(M-eM[i],n+1));
    1091       V[i]=interred(intersect(V1,V0));
    1092 
    1093       if(size(V[i])>size(V[i+1]))
    1094       {
    1095         k++;
    1096         a[k]=eM[i]-1;
    1097         d[k]=size(V[i])-size(V[i+1]);
    1098       }
    1099     }
    1100 
    1101     dbprint(printlevel-voice+2,"// apply symmetry");
    1102     while(j>=1)
    1103     {
    1104       k++;
    1105       a[k]=a[j];
    1106       a[j]=n-1-a[k];
    1107       d[k]=d[j];
    1108       j--;
    1109     }
    1110 
    1111     setring(R);
    1112     ideal a=imap(G,a);
    1113     return(list(a,d));
    1114   }
    1115   else
    1116   {
    1117     list v;
    1118     int j=-1;
    1119     for(i=ncols(eM);i>=1;i--)
    1120     {
    1121       dbprint(printlevel-voice+2,"// compute V["+string(i)+"]");
    1122       V1=module(V1)+syz(power(M-eM[i],n+1));
    1123       V[i]=interred(intersect(V1,V0));
    1124 
    1125       if(size(V[i])>size(V[i+1]))
    1126       {
    1127         if(number(eM[i]-1)>=number(n-1)/2)
    1128         {
    1129           k++;
    1130           a[k]=eM[i]-1;
    1131           v[k]=matrix(freemodule(ncols(V[i])),mu,mu*N)*division(V0,V[i])[1];
    1132         }
    1133         else
    1134         {
    1135           if(j<0)
    1136           {
    1137             if(a[k]==number(n-1)/2)
    1138             {
    1139               j=k-1;
    1140             }
    1141             else
    1142             {
    1143               j=k;
    1144             }
    1145           }
    1146           k++;
    1147           a[k]=a[j];
    1148           a[j]=eM[i]-1;
    1149           v[k]=v[j];
    1150           v[j]=matrix(freemodule(ncols(V[i])),mu,mu*N)*division(V0,V[i])[1];
    1151           j--;
    1152         }
    1153       }
    1154     }
    1155 
    1156     dbprint(printlevel-voice+2,"// compute graded parts");
    1157     for(k=1;k<size(v);k++)
    1158     {
    1159       v[k]=interred(reduce(v[k],std(v[k+1])));
    1160       d[k]=size(v[k]);
    1161     }
    1162     v[k]=interred(v[k]);
    1163     d[k]=size(v[k]);
    1164 
    1165     setring(R);
    1166     ideal a=imap(G,a);
    1167     list v=imap(G,v);
    1168     ideal m=imap(G,gmsbasis);
    1169     ideal g=imap(G,gmsstd);
    1170     attrib(g,"isSB",1);
    1171     return(list(a,d,v,m,g));
    1172   }
    1173 }
    1174 example
    1175 { "EXAMPLE:"; echo=2;
    1176   ring R=0,(x,y),ds;
    1177   poly t=x5+x2y2+y5;
    1178   vfilt1(t);
    1179 }
    1180 ///////////////////////////////////////////////////////////////////////////////
    1181 
    1182 static proc grmat(matrix A,int k)
    1183 {
    1184   int i,j;
    1185   for(i=1;i<=ncols(A);i++)
    1186   {
    1187     for(j=1;j<=nrows(A);j++)
    1188     {
    1189       A[i,j]=jet(A[i,j]/var(1)^k,0);
    1190     }
    1191   }
    1192   return(A);
    1193894}
    1194895///////////////////////////////////////////////////////////////////////////////
     
    1199900          t with isolated citical point 0
    1200901RETURN:   list A: matrix A[1]+A[2]*s of t on H''
    1201 SEE ALSO: spectrum_lib
    1202902KEYWORDS: singularities; Gauss-Manin connection; Brieskorn lattice;
    1203           mixed Hodge structure; V-filtration; weight filtration;
    1204           spectrum; spectral pairs
     903          mixed Hodge structure; opposite Hodge filtration; V-filtration;
    1205904EXAMPLE:  example saito; shows examples
    1206905"
     
    1238937    for(j=0;j<k;j++)
    1239938    {
    1240       V=matrix(V)-grmat(A,k-j)*grmat(U,j);
     939      V=matrix(V)-(jet(A,k-j)/s^(k-j))*(jet(U,j)/s^j);
    1241940    }
    1242941    v=V[1..mu,1..mu];
     
    13631062  list l=division(H,s*A*H+s^2*diff(matrix(H),s));
    13641063  A=jet(l[1],l[2],k0+k1+1);
    1365   A0=grmat(A,0);
    1366   A=grmat(A,1);
     1064  A0=jet(A,0);
     1065  A=jet(A,1)/s;
    13671066
    13681067  setring(R);
     
    13941093  ideal EV[5]: standard basis of Jacobian ideal
    13951094@end format
    1396 SEE ALSO: spectrum_lib
    13971095KEYWORDS: singularities; Gauss-Manin connection; Brieskorn lattice;
    1398           mixed Hodge structure; V-filtration; weight filtration;
    1399           endomorphism filtration
     1096          mixed Hodge structure; V-filtration; endomorphism filtration
    14001097EXAMPLE: example endvwfilt; shows examples
    14011098"
     
    15351232///////////////////////////////////////////////////////////////////////////////
    15361233
    1537 proc spprint(list Sp)
    1538 "USAGE:   spprint(Sp); list Sp
    1539 RETURN:  string: spectrum Sp
     1234proc spprint(list sp)
     1235"USAGE:   spprint(sp); list sp
     1236RETURN:  string: spectrum sp
    15401237EXAMPLE: example spprint; shows examples
    15411238"
    15421239{
    15431240  string s;
    1544   for(int i=1;i<size(Sp[2]);i++)
    1545   {
    1546     s=s+"("+string(Sp[1][i])+","+string(Sp[2][i])+"),";
    1547   }
    1548   s=s+"("+string(Sp[1][i])+","+string(Sp[2][i])+")";
     1241  for(int i=1;i<size(sp[2]);i++)
     1242  {
     1243    s=s+"("+string(sp[1][i])+","+string(sp[2][i])+"),";
     1244  }
     1245  s=s+"("+string(sp[1][i])+","+string(sp[2][i])+")";
    15491246  return(s);
    15501247}
     
    15521249{ "EXAMPLE:"; echo=2;
    15531250  ring R=0,(x,y),ds;
    1554   list Sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1555   spprint(Sp);
    1556 }
    1557 ///////////////////////////////////////////////////////////////////////////////
    1558 
    1559 proc sppprint(list Spp)
    1560 "USAGE:   sppprint(Sp); list Spp
    1561 RETURN:  string: spectral pairs Spp
     1251  list sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1252  spprint(sp);
     1253}
     1254///////////////////////////////////////////////////////////////////////////////
     1255
     1256proc sppprint(list spp)
     1257"USAGE:   sppprint(spp); list spp
     1258RETURN:  string: spectral pairs spp
    15621259EXAMPLE: example sppprint; shows examples
    15631260"
    15641261{
    15651262  string s;
    1566   for(int i=1;i<size(Spp[3]);i++)
    1567   {
    1568     s=s+"(("+string(Spp[1][i])+","+string(Spp[2][i])+"),"+string(Spp[3][i])+"),";
    1569   }
    1570   s=s+"(("+string(Spp[1][i])+","+string(Spp[2][i])+"),"+string(Spp[3][i])+")";
     1263  for(int i=1;i<size(spp[3]);i++)
     1264  {
     1265    s=s+"(("+string(spp[1][i])+","+string(spp[2][i])+"),"+string(spp[3][i])+"),";
     1266  }
     1267  s=s+"(("+string(spp[1][i])+","+string(spp[2][i])+"),"+string(spp[3][i])+")";
    15711268  return(s);
    15721269}
     
    15741271{ "EXAMPLE:"; echo=2;
    15751272  ring R=0,(x,y),ds;
    1576   list Spp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(2,1,1,1,1,1,0),intvec(1,2,2,1,2,2,1));
    1577   sppprint(Spp);
    1578 }
    1579 ///////////////////////////////////////////////////////////////////////////////
    1580 
    1581 proc spadd(list Sp1,list Sp2)
    1582 "USAGE:   spadd(Sp1,Sp2); list Sp1,Sp2
    1583 RETURN:  list: sum of spectra Sp1 and Sp2
     1273  list spp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(2,1,1,1,1,1,0),intvec(1,2,2,1,2,2,1));
     1274  sppprint(spp);
     1275}
     1276///////////////////////////////////////////////////////////////////////////////
     1277
     1278proc spadd(list sp1,list sp2)
     1279"USAGE:   spadd(sp1,sp2); list sp1,sp2
     1280RETURN:  list: sum of spectra sp1 and sp2
    15841281EXAMPLE: example spadd; shows examples
    15851282"
     
    15881285  intvec m;
    15891286  int i,i1,i2=1,1,1;
    1590   while(i1<=size(Sp1[2])||i2<=size(Sp2[2]))
    1591   {
    1592     if(i1<=size(Sp1[2]))
    1593     {
    1594       if(i2<=size(Sp2[2]))
    1595       {
    1596         if(number(Sp1[1][i1])<number(Sp2[1][i2]))
     1287  while(i1<=size(sp1[2])||i2<=size(sp2[2]))
     1288  {
     1289    if(i1<=size(sp1[2]))
     1290    {
     1291      if(i2<=size(sp2[2]))
     1292      {
     1293        if(number(sp1[1][i1])<number(sp2[1][i2]))
    15971294        {
    1598           s[i]=Sp1[1][i1];
    1599           m[i]=Sp1[2][i1];
     1295          s[i]=sp1[1][i1];
     1296          m[i]=sp1[2][i1];
    16001297          i++;
    16011298          i1++;
     
    16031300        else
    16041301        {
    1605           if(number(Sp1[1][i1])>number(Sp2[1][i2]))
     1302          if(number(sp1[1][i1])>number(sp2[1][i2]))
    16061303          {
    1607             s[i]=Sp2[1][i2];
    1608             m[i]=Sp2[2][i2];
     1304            s[i]=sp2[1][i2];
     1305            m[i]=sp2[2][i2];
    16091306            i++;
    16101307            i2++;
     
    16121309          else
    16131310          {
    1614             if(Sp1[2][i1]+Sp2[2][i2]!=0)
     1311            if(sp1[2][i1]+sp2[2][i2]!=0)
    16151312            {
    1616               s[i]=Sp1[1][i1];
    1617               m[i]=Sp1[2][i1]+Sp2[2][i2];
     1313              s[i]=sp1[1][i1];
     1314              m[i]=sp1[2][i1]+sp2[2][i2];
    16181315              i++;
    16191316            }
     
    16251322      else
    16261323      {
    1627         s[i]=Sp1[1][i1];
    1628         m[i]=Sp1[2][i1];
     1324        s[i]=sp1[1][i1];
     1325        m[i]=sp1[2][i1];
    16291326        i++;
    16301327        i1++;
     
    16331330    else
    16341331    {
    1635       s[i]=Sp2[1][i2];
    1636       m[i]=Sp2[2][i2];
     1332      s[i]=sp2[1][i2];
     1333      m[i]=sp2[2][i2];
    16371334      i++;
    16381335      i2++;
     
    16441341{ "EXAMPLE:"; echo=2;
    16451342  ring R=0,(x,y),ds;
    1646   list Sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1647   spprint(Sp1);
    1648   list Sp2=list(ideal(-1/6,1/6),intvec(1,1));
    1649   spprint(Sp2);
    1650   spprint(spadd(Sp1,Sp2));
    1651 }
    1652 ///////////////////////////////////////////////////////////////////////////////
    1653 
    1654 proc spsub(list Sp1,list Sp2)
    1655 "USAGE:   spsub(Sp1,Sp2); list Sp1,Sp2
    1656 RETURN:  list: difference of spectra Sp1 and Sp2
     1343  list sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1344  spprint(sp1);
     1345  list sp2=list(ideal(-1/6,1/6),intvec(1,1));
     1346  spprint(sp2);
     1347  spprint(spadd(sp1,sp2));
     1348}
     1349///////////////////////////////////////////////////////////////////////////////
     1350
     1351proc spsub(list sp1,list sp2)
     1352"USAGE:   spsub(sp1,sp2); list sp1,sp2
     1353RETURN:  list: difference of spectra sp1 and sp2
    16571354EXAMPLE: example spsub; shows examples
    16581355"
    16591356{
    1660   return(spadd(Sp1,spmul(Sp2,-1)));
    1661 }
    1662 example
    1663 { "EXAMPLE:"; echo=2;
    1664   ring R=0,(x,y),ds;
    1665   list Sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1666   spprint(Sp1);
    1667   list Sp2=list(ideal(-1/6,1/6),intvec(1,1));
    1668   spprint(Sp2);
    1669   spprint(spsub(Sp1,Sp2));
     1357  return(spadd(sp1,spmul(sp2,-1)));
     1358}
     1359example
     1360{ "EXAMPLE:"; echo=2;
     1361  ring R=0,(x,y),ds;
     1362  list sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1363  spprint(sp1);
     1364  list sp2=list(ideal(-1/6,1/6),intvec(1,1));
     1365  spprint(sp2);
     1366  spprint(spsub(sp1,sp2));
    16701367}
    16711368///////////////////////////////////////////////////////////////////////////////
     
    16741371"USAGE:
    16751372@format
    1676 1) spmul(Sp,k); list Sp, int k
    1677 2) spmul(Sp,k); list Sp, intvec k
     13731) spmul(sp,k); list sp, int k
     13742) spmul(sp,k); list sp, intvec k
    16781375@end format
    16791376RETURN:
    16801377@format
    1681 1) list: product of spectrum Sp and integer k
    1682 2) list: linear combination of spectra Sp with coefficients k
     13781) list: product of spectrum sp and integer k
     13792) list: linear combination of spectra sp with coefficients k
    16831380@end format
    16841381EXAMPLE: example spmul; shows examples
     
    16951392      if(typeof(#[2])=="intvec")
    16961393      {
    1697         list Sp0=list(ideal(),intvec(0));
     1394        list sp0=list(ideal(),intvec(0));
    16981395        for(int i=size(#[2]);i>=1;i--)
    16991396        {
    1700           Sp0=spadd(Sp0,spmul(#[1][i],#[2][i]));
     1397          sp0=spadd(sp0,spmul(#[1][i],#[2][i]));
    17011398        }
    1702         return(Sp0);
     1399        return(sp0);
    17031400      }
    17041401    }
     
    17091406{ "EXAMPLE:"; echo=2;
    17101407  ring R=0,(x,y),ds;
    1711   list Sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1712   spprint(Sp);
    1713   spprint(spmul(Sp,2));
    1714   list Sp1=list(ideal(-1/6,1/6),intvec(1,1));
    1715   spprint(Sp1);
    1716   list Sp2=list(ideal(-1/3,0,1/3),intvec(1,2,1));
    1717   spprint(Sp2);
    1718   spprint(spmul(list(Sp1,Sp2),intvec(1,2)));
    1719 }
    1720 ///////////////////////////////////////////////////////////////////////////////
    1721 
    1722 proc spissemicont(list Sp,list #)
    1723 "USAGE:   spissemicont(Sp[,opt]); list Sp, int opt
     1408  list sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1409  spprint(sp);
     1410  spprint(spmul(sp,2));
     1411  list sp1=list(ideal(-1/6,1/6),intvec(1,1));
     1412  spprint(sp1);
     1413  list sp2=list(ideal(-1/3,0,1/3),intvec(1,2,1));
     1414  spprint(sp2);
     1415  spprint(spmul(list(sp1,sp2),intvec(1,2)));
     1416}
     1417///////////////////////////////////////////////////////////////////////////////
     1418
     1419proc spissemicont(list sp,list #)
     1420"USAGE:   spissemicont(sp[,opt]); list sp, int opt
    17241421RETURN:
    17251422@format
    17261423int k=
    17271424if opt=0:
    1728   1, if sum of spectrum Sp over all intervals [a,a+1) is positive
    1729   0, if sum of spectrum Sp over some interval [a,a+1) is negative
     1425  1, if sum of spectrum sp over all intervals [a,a+1) is positive
     1426  0, if sum of spectrum sp over some interval [a,a+1) is negative
    17301427if opt=1:
    1731   1, if sum of spectrum Sp over all intervals [a,a+1) and (a,a+1) is positive
    1732   0, if sum of spectrum Sp over some interval [a,a+1) or (a,a+1) is negative
     1428  1, if sum of spectrum sp over all intervals [a,a+1) and (a,a+1) is positive
     1429  0, if sum of spectrum sp over some interval [a,a+1) or (a,a+1) is negative
    17331430default: opt=0
    17341431@end format
     
    17451442  }
    17461443  int i,j,k=1,1,0;
    1747   while(j<=size(Sp[2]))
    1748   {
    1749     while(j+1<=size(Sp[2])&&Sp[1][j]<Sp[1][i]+1)
    1750     {
    1751       k=k+Sp[2][j];
     1444  while(j<=size(sp[2]))
     1445  {
     1446    while(j+1<=size(sp[2])&&sp[1][j]<sp[1][i]+1)
     1447    {
     1448      k=k+sp[2][j];
    17521449      j++;
    17531450    }
    1754     if(j==size(Sp[2])&&Sp[1][j]<Sp[1][i]+1)
    1755     {
    1756       k=k+Sp[2][j];
     1451    if(j==size(sp[2])&&sp[1][j]<sp[1][i]+1)
     1452    {
     1453      k=k+sp[2][j];
    17571454      j++;
    17581455    }
     
    17611458      return(0);
    17621459    }
    1763     k=k-Sp[2][i];
     1460    k=k-sp[2][i];
    17641461    if(k<0&&opt==1)
    17651462    {
     
    17731470{ "EXAMPLE:"; echo=2;
    17741471  ring R=0,(x,y),ds;
    1775   list Sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1776   spprint(Sp1);
    1777   list Sp2=list(ideal(-1/6,1/6),intvec(1,1));
    1778   spprint(Sp2);
    1779   spissemicont(spsub(Sp1,spmul(Sp2,5)));
    1780   spissemicont(spsub(Sp1,spmul(Sp2,5)),1);
    1781   spissemicont(spsub(Sp1,spmul(Sp2,6)));
    1782 }
    1783 ///////////////////////////////////////////////////////////////////////////////
    1784 
    1785 proc spsemicont(list Sp0,list Sp,list #)
    1786 "USAGE:   spsemicont(Sp,k[,opt]); list Sp0, list Sp, int opt
     1472  list sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1473  spprint(sp1);
     1474  list sp2=list(ideal(-1/6,1/6),intvec(1,1));
     1475  spprint(sp2);
     1476  spissemicont(spsub(sp1,spmul(sp2,5)));
     1477  spissemicont(spsub(sp1,spmul(sp2,5)),1);
     1478  spissemicont(spsub(sp1,spmul(sp2,6)));
     1479}
     1480///////////////////////////////////////////////////////////////////////////////
     1481
     1482proc spsemicont(list sp0,list sp,list #)
     1483"USAGE:   spsemicont(sp,k[,opt]); list sp0, list sp, int opt
    17871484RETURN:  list of intvecs l:
    1788          spissemicont(sub(Sp0,spmul(Sp,k)),opt)==1 iff k<=l[i] for some i
    1789 NOTE:    if the spectra Sp occur with multiplicities k in a deformation
    1790          of the [quasihomogeneous] spectrum Sp0 then
    1791          spissemicont(sub(Sp0,spmul(Sp,k))[,1])==1
     1485         spissemicont(sub(sp0,spmul(sp,k)),opt)==1 iff k<=l[i] for some i
     1486NOTE:    if the spectra sp occur with multiplicities k in a deformation
     1487         of the [quasihomogeneous] spectrum sp0 then
     1488         spissemicont(sub(sp0,spmul(sp,k))[,1])==1
    17921489EXAMPLE: example spsemicont; shows examples
    17931490"
     
    17951492  list l,l0;
    17961493  int i,j,k;
    1797   while(spissemicont(Sp0,#))
    1798   {
    1799     if(size(Sp)>1)
    1800     {
    1801       l0=spsemicont(Sp0,list(Sp[1..size(Sp)-1]));
     1494  while(spissemicont(sp0,#))
     1495  {
     1496    if(size(sp)>1)
     1497    {
     1498      l0=spsemicont(sp0,list(sp[1..size(sp)-1]));
    18021499      for(i=1;i<=size(l0);i++)
    18031500      {
     
    18111508          if(l[j]==l0[i])
    18121509          {
    1813             l[j][size(Sp)]=k;
     1510            l[j][size(sp)]=k;
    18141511          }
    18151512          else
    18161513          {
    1817             l0[i][size(Sp)]=k;
     1514            l0[i][size(sp)]=k;
    18181515            l=l+list(l0[i]);
    18191516          }
     
    18251522      }
    18261523    }
    1827     Sp0=spsub(Sp0,Sp[size(Sp)]);
     1524    sp0=spsub(sp0,sp[size(sp)]);
    18281525    k++;
    18291526  }
    1830   if(size(Sp)>1)
     1527  if(size(sp)>1)
    18311528  {
    18321529    return(l);
     
    18401537{ "EXAMPLE:"; echo=2;
    18411538  ring R=0,(x,y),ds;
    1842   list Sp0=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1843   spprint(Sp0);
    1844   list Sp1=list(ideal(-1/6,1/6),intvec(1,1));
    1845   spprint(Sp1);
    1846   list Sp2=list(ideal(-1/3,0,1/3),intvec(1,2,1));
    1847   spprint(Sp2);
    1848   list Sp=Sp1,Sp2;
    1849   list l=spsemicont(Sp0,Sp);
     1539  list sp0=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1540  spprint(sp0);
     1541  list sp1=list(ideal(-1/6,1/6),intvec(1,1));
     1542  spprint(sp1);
     1543  list sp2=list(ideal(-1/3,0,1/3),intvec(1,2,1));
     1544  spprint(sp2);
     1545  list sp=sp1,sp2;
     1546  list l=spsemicont(sp0,sp);
    18501547  l;
    1851   spissemicont(spsub(Sp0,spmul(Sp,l[1])));
    1852   spissemicont(spsub(Sp0,spmul(Sp,l[1]-1)));
    1853   spissemicont(spsub(Sp0,spmul(Sp,l[1]+1)));
    1854 }
    1855 ///////////////////////////////////////////////////////////////////////////////
    1856 
    1857 proc spmilnor(list Sp)
    1858 "USAGE:   spmilnor(Sp); list Sp
    1859 RETURN:  int: Milnor number of spectrum Sp
     1548  spissemicont(spsub(sp0,spmul(sp,l[1])));
     1549  spissemicont(spsub(sp0,spmul(sp,l[1]-1)));
     1550  spissemicont(spsub(sp0,spmul(sp,l[1]+1)));
     1551}
     1552///////////////////////////////////////////////////////////////////////////////
     1553
     1554proc spmilnor(list sp)
     1555"USAGE:   spmilnor(sp); list sp
     1556RETURN:  int: Milnor number of spectrum sp
    18601557EXAMPLE: example spmilnor; shows examples
    18611558"
    18621559{
    1863   return(sum(Sp[2]));
    1864 }
    1865 example
    1866 { "EXAMPLE:"; echo=2;
    1867   ring R=0,(x,y),ds;
    1868   list Sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1869   spprint(Sp);
    1870   spmilnor(Sp);
    1871 }
    1872 ///////////////////////////////////////////////////////////////////////////////
    1873 
    1874 proc spgeomgenus(list Sp)
    1875 "USAGE:   spgeomgenus(Sp); list Sp
    1876 RETURN:  int: geometrical genus of spectrum Sp
     1560  return(sum(sp[2]));
     1561}
     1562example
     1563{ "EXAMPLE:"; echo=2;
     1564  ring R=0,(x,y),ds;
     1565  list sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1566  spprint(sp);
     1567  spmilnor(sp);
     1568}
     1569///////////////////////////////////////////////////////////////////////////////
     1570
     1571proc spgeomgenus(list sp)
     1572"USAGE:   spgeomgenus(sp); list sp
     1573RETURN:  int: geometrical genus of spectrum sp
    18771574EXAMPLE: example spgeomgenus; shows examples
    18781575"
     
    18801577  int g=0;
    18811578  int i=1;
    1882   while(i+1<=size(Sp[2])&&number(Sp[1][i])<=number(0))
    1883   {
    1884     g=g+Sp[2][i];
     1579  while(i+1<=size(sp[2])&&number(sp[1][i])<=number(0))
     1580  {
     1581    g=g+sp[2][i];
    18851582    i++;
    18861583  }
    1887   if(i==size(Sp[2])&&number(Sp[1][i])<=number(0))
    1888   {
    1889     g=g+Sp[2][i];
     1584  if(i==size(sp[2])&&number(sp[1][i])<=number(0))
     1585  {
     1586    g=g+sp[2][i];
    18901587  }
    18911588  return(g);
     
    18941591{ "EXAMPLE:"; echo=2;
    18951592  ring R=0,(x,y),ds;
    1896   list Sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1897   spprint(Sp);
    1898   spgeomgenus(Sp);
    1899 }
    1900 ///////////////////////////////////////////////////////////////////////////////
    1901 
    1902 proc spgamma(list Sp)
    1903 "USAGE:   spgamma(Sp); list Sp
    1904 RETURN:  number: gamma invariant of spectrum Sp
     1593  list sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1594  spprint(sp);
     1595  spgeomgenus(sp);
     1596}
     1597///////////////////////////////////////////////////////////////////////////////
     1598
     1599proc spgamma(list sp)
     1600"USAGE:   spgamma(sp); list sp
     1601RETURN:  number: gamma invariant of spectrum sp
    19051602EXAMPLE: example spgamma; shows examples
    19061603"
     
    19081605  int i,j;
    19091606  number g=0;
    1910   for(i=1;i<=ncols(Sp[1]);i++)
    1911   {
    1912     for(j=1;j<=Sp[2][i];j++)
    1913     {
    1914       g=g+(number(Sp[1][i])-number(nvars(basering)-2)/2)^2;
    1915     }
    1916   }
    1917   g=-g/4+sum(Sp[2])*number(Sp[1][ncols(Sp[1])]-Sp[1][1])/48;
     1607  for(i=1;i<=ncols(sp[1]);i++)
     1608  {
     1609    for(j=1;j<=sp[2][i];j++)
     1610    {
     1611      g=g+(number(sp[1][i])-number(nvars(basering)-2)/2)^2;
     1612    }
     1613  }
     1614  g=-g/4+sum(sp[2])*number(sp[1][ncols(sp[1])]-sp[1][1])/48;
    19181615  return(g);
    19191616}
     
    19211618{ "EXAMPLE:"; echo=2;
    19221619  ring R=0,(x,y),ds;
    1923   list Sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
    1924   spprint(Sp);
    1925   spgamma(Sp);
    1926 }
    1927 ///////////////////////////////////////////////////////////////////////////////
     1620  list sp=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
     1621  spprint(sp);
     1622  spgamma(sp);
     1623}
     1624///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.