Changeset e0e0e2 in git for Singular/LIB/finvar.lib


Ignore:
Timestamp:
Dec 14, 2007, 11:12:31 AM (16 years ago)
Author:
Simon King <king@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
4f818c4604d3f8dd7bb40260971c1bdd9f709746
Parents:
d617b278e0d4576d32b4c6f260fd73bae2daa907
Message:
Improvements of various details of secondary_not_cohen_macaulay. New (experimental) option for Hilbert driven computation. Still, magma is *much* faster. This ought to change!


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/finvar.lib

    rd617b27 re0e0e2  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: finvar.lib,v 1.70 2007-12-12 15:02:46 king Exp $"
     2version="$Id: finvar.lib,v 1.71 2007-12-14 10:12:31 king Exp $"
    33category="Invariant theory";
    44info="
     
    69476947
    69486948proc secondary_not_cohen_macaulay (matrix P, list #)
    6949 "USAGE:   secondary_not_cohen_macaulay(P,G1,G2,...[,v]);
     6949"USAGE:   secondary_not_cohen_macaulay(P,G1,G2,...[,v,h]);
    69506950         P: a 1xn <matrix> with primary invariants, G1,G2,...: nxn <matrices>
    6951          generating a finite matrix group, v: an optional <int>
     6951         generating a finite matrix group, v,h: optional <int>
    69526952ASSUME:  n is the number of variables of the basering
    69536953RETURN:  secondary invariants of the invariant ring (type <matrix>)
     
    69556955THEORY:  Secondary invariants are generated following \"Generating Invariant
    69566956         Rings of Finite Groups over Arbitrary Fields\" by Kemper (1996).
     6957         Hilbert driven computation is used if h does not equal 0
    69576958EXAMPLE: example secondary_not_cohen_macaulay; shows an example
    69586959"
    69596960{ int i, j;
     6961  int v, useH;
    69606962  degBound=0;
    69616963  def br=basering;
     
    69666968  if (size(#)>0)                       // checking input and setting verbose
    69676969  { if (typeof(#[size(#)])=="int")
    6968     { int gen_num=size(#)-1;
     6970    { if ((size(#)>1) and (typeof(#[size(#)-1])=="int"))
     6971      { int gen_num=size(#)-2;
     6972        v=#[size(#)-1];
     6973        useH=#[size(#)];
     6974      }
     6975      else
     6976      { int gen_num=size(#)-1;
     6977        v=#[size(#)];
     6978      }
    69696979      if (gen_num==0)
    69706980      { "ERROR:   There are no generators of the finite matrix group given.";
    69716981        return();
    69726982      }
    6973       int v=#[size(#)];
    69746983      for (i=1;i<=gen_num;i++)
    69756984      { if (typeof(#[i])<>"matrix")
     
    69846993    }
    69856994    else
    6986     { int v=0;
    6987       int gen_num=size(#);
     6995    { int gen_num=size(#);
    69886996      for (i=1;i<=gen_num;i++)
    69896997      { if (typeof(#[i])<>"matrix")
     
    70107018  { "";
    70117019  }
    7012   ring alskdfalkdsj=0,x,dp;
    7013   matrix M[1][2]=1,(1-x)^n;           
    7014   export alskdfalkdsj;
    7015   export M;                            // we look at our primary invariants as
    7016   setring br;                          // such of the subgroup that only
    7017   matrix REY=matrix(maxideal(1));      // contains the identity, this means that
     7020  // ring alskdfalkdsj=0,x,dp;
     7021  // matrix M[1][2]=1,(1-x)^n;           
     7022  // export alskdfalkdsj;
     7023  // export M;                            // we look at our primary invariants as
     7024  // setring br;                          // such of the subgroup that only
     7025  // matrix REY=matrix(maxideal(1));      // contains the identity, this means that
    70187026                                       // ch does not divide the order anymore,
    70197027                                       // this means that we can make use of the
     
    70257033                                       // ones from the bigger group
    70267034  if (v)
    7027   { "  The procedure secondary_charp() is called to calculate secondary invariants";
    7028     "  of the invariant ring of the trivial group with respect to the primary";
    7029     "  invariants found previously.";
     7035  { "  First, get secondary invariants for the trivial action, with respect to";
     7036    "  the primary invariants found previously. By the graded Nakayama lemma,";
     7037    "  this means to compute the standard monomials for the ideal generated by";
     7038    "  the primary invariants.";
    70307039    "";
    70317040  }
    7032   matrix trivialS, trivialIS=secondary_charp(P,REY,"alskdfalkdsj",v);
    7033   kill trivialIS;
    7034   kill alskdfalkdsj;
     7041  ideal GP = groebner(ideal(P));
     7042  if (dim(GP)<>0)
     7043  { "ERROR:   The ideal spanned by primary invariants of a finite group";
     7044    "         always is of dimension zero.";
     7045    return();
     7046  }
     7047  matrix trivialS = matrix(kbase(GP));// , trivialIS=secondary_charp(P,REY,"alskdfalkdsj",v);
     7048  // kill trivialIS;
     7049  // kill alskdfalkdsj;
    70357050  // now we have those secondary invariants
    70367051  int k=ncols(trivialS);               // k is the number of the secondary
     
    70577072//  module M(2)=syz(M(1));               // nres(M(1),2)[2];
    70587073//  option(set,save_opts);
     7074  if (v)
     7075  { "Syzygies of the \"trivial\" secondaries"; }
    70597076  module M(2)=nres(M(1),2)[2];
    70607077  int m=ncols(M(2));                   // number of generators of the module
     
    70637080  // the algebra A^k where A denote the subalgebra of the usual polynomial
    70647081  // ring, generated by the primary invariants
    7065   string mp=string(minpoly);           // generating a ring where we can do
    7066                                        // elimination
    7067   execute("ring R=("+charstr(br)+"),(x(1..n),y(1..n),h),dp;");
    7068   execute("minpoly=number("+mp+");");
    7069   // map f=br,maxideal(1);                // canonical mapping
    7070   matrix M[k][m+k*n];
    7071   M[1..k,1..m]=matrix(fetch(br,M(2)));        // will contain a module -
     7082
     7083  // generate a ring where we can do elimination 
     7084  // in order to make it weighted homogeneous, we choose appropriate weights
     7085  if (v)
     7086  { "By elimination: Intersect with the invariant ring"; }
     7087  intvec dv = degvec(ideal(P)),1;
     7088  ring newR = char(br), (y(1..n),h),(a(dv),dp);
     7089  def R = br + newR;
     7090  setring R;
    70727091  matrix P=fetch(br,P);                       // primary invariants in the new ring
     7092  ideal ElimP;
    70737093  for (i=1;i<=n;i++)
     7094  { ElimP[i]=y(i)-P[1,i]; }
     7095  def RHilb = newR+br; // the new variables only appear linearly, so that block order wouldn't hurt
     7096  setring RHilb;
     7097  ideal ElimP=imap(R,ElimP);
     7098  intvec EPvec = hilb(groebner(ElimP),1,degvec(maxideal(1)));
     7099  setring R;
     7100  ideal GElimP = std(ElimP,EPvec,degvec(maxideal(1)));
     7101  attrib(GElimP,"isSB",1);
     7102  int newN = ncols(GElimP); 
     7103  matrix M[k][m+k*newN];
     7104  M[1..k,1..m]=matrix(imap(br,M(2)));        // will contain a module -
     7105  for (i=1;i<=newN;i++)
    70747106  { for (j=1;j<=k;j++)
    7075     { M[j,m+(i-1)*k+j]=y(i)-P[1,i];
    7076     }
    7077   }
    7078   M=elim(module(M),1,n);               // eliminating x(1..n), std-calculation
    7079                                        // is done internally -
    7080   M=homog(module(M),h);                // homogenize for 'minbase'
     7107    { M[j,m+(i-1)*k+j]=GElimP[i]; // y(i)-P[1,i];
     7108    }
     7109  }
     7110
     7111  if (not useH)                             
     7112  { M=elim(module(M),1,n);               // eliminating x(1..n), std-calculation
     7113                                         // is done internally -
     7114    M=homog(module(M),h);            // homogenize for 'minbase'
     7115  }
     7116  else
     7117  {
     7118    // Manually, as long as Hilbert driven eliminations are not supported for modules.
     7119    // ----- Compute the Hilbert function, using an "easy" ordering ----
     7120    if (v)
     7121    { "   Compute Hilbert Function"; }
     7122    setring RHilb;
     7123    matrix M=imap(R,M);
     7124    module GM=groebner(module(M));
     7125    intvec hv = hilb(GM,1,degvec(maxideal(1)));
     7126    setring R;
     7127    module GM=imap(RHilb,GM);
     7128    kill RHilb;
     7129    // ----- Hilbert driven standard basis is hopefully reasonably fast ----
     7130    if (v)
     7131    { "   Hilbert driven standard basis computation"; }
     7132    module MGb = std(module(GM),hv,degvec(maxideal(1)));
     7133    ideal vars;
     7134    vars[n]=0;
     7135    vars=vars,y(1..n),h;
     7136    map emb=R,vars;
     7137    module MElim=emb(MGb);
     7138    MGb = MGb - MElim;
     7139    for (j=1;j<=ncols(MGb);j++)
     7140    { if (MGb[j]<>0)
     7141      { MElim[j]=0;
     7142      }
     7143    }
     7144    M=homog(module(MElim),h);                // homogenize for 'minbase'
     7145  }
     7146
    70817147  M=minbase(module(M));
    7082   setring br;
    7083   ideal substitute=maxideal(1),ideal(P),1;
    7084   f=R,substitute;                      // replacing y(1..n) by primary
     7148  ideal substitute;
     7149  for (i=1;i<=n;i++)
     7150  { substitute[i]=var(i);
     7151  }
     7152  substitute = substitute,ideal(P),1;
     7153  map f=R,substitute;                      // replacing y(1..n) by primary
    70857154                                       // invariants and h by 1 -
    7086   M(2)=f(M);                           // M(2) is the new module
    7087   m=ncols(M(2));
     7155  M=f(M);                              // we can't directly map from R to br
     7156  setring br;                          // if there is a minpoly.
     7157  module M(3)=imap(R,M);                     // M(2) is the new module
     7158  m=ncols(M(3));
    70887159  matrix S[1][m];
    7089   S=matrix(trivialS)*matrix(M(2));     // S now contains the secondary
     7160  S=matrix(trivialS)*matrix(M(3));     // S now contains the secondary
    70907161                                       // invariants
    70917162  for (i=1; i<=m;i++)
Note: See TracChangeset for help on using the changeset viewer.