Changeset af0ef6 in git


Ignore:
Timestamp:
Jan 22, 2008, 10:17:19 AM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
a8107357ac68111e1051981bf688474782ef2671
Parents:
0ffce332c594302f017fa7d64d16013e1ef8c724
Message:
*hannes: 1.75 and 1.74  crashed in Tst/Short/finvar_s.tst


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/finvar.lib

    r0ffce33 raf0ef6  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: finvar.lib,v 1.75 2007-12-20 13:56:21 king Exp $"
     2version="$Id: finvar.lib,v 1.76 2008-01-22 09:17:19 Singular Exp $"
    33category="Invariant theory";
    44info="
     
    7878LIB "general.lib";
    7979LIB "algebra.lib";
    80 LIB "ring.lib";
    8180
    8281///////////////////////////////////////////////////////////////////////////////
     
    15921591  }
    15931592  def br=basering;
     1593  ideal vars = maxideal(1);
     1594  ideal mon=sort(maxideal(g))[1];      // needed for constructing a general
     1595  int m=ncols(mon);                    // homogeneous polynomial of degree g
     1596  mon=sort(mon,intvec(m..1))[1];
     1597  int a=size(#);
     1598  int i;
    15941599  int n=nvars(br);
    1595   matrix vars=matrix(maxideal(1));
    1596   map f;
    1597   ideal I;
    1598   matrix mon=matrix(maxideal(g));      // needed for constructing
    1599   int m=ncols(mon);                    // invariants of degree g
    1600   int gen_num=size(#);
    1601   int i;
     1600  int DGB = degBound;
    16021601 //---------------------- checking that the input is ok -----------------------
    1603   for (i=1;i<=gen_num;i++)
     1602  for (i=1;i<=a;i++)
    16041603  { if (typeof(#[i])=="matrix")
    16051604    { if (nrows(#[i])==n && ncols(#[i])==n)
     
    16171616    }
    16181617  }
     1618 //----------------------------------------------------------------------------
     1619  ring tmpR = char(br),(p(1..m)),dp;
     1620  def T = br+tmpR;
     1621  setring T;
     1622  // execute("ring T=("+charstr(br)+"),("+varstr(br)+",p(1..m)),lp;");
     1623  // p(1..m) are the general coefficients of the general polynomial of degree g
     1624  ideal vars = fetch(br,vars);
     1625  map f;
     1626  ideal mon=imap(br,mon);
     1627  poly P=0;
     1628  for (i=m;i>=1;i--)
     1629  { P=P+p(i)*mon[i];                   // P is the general polynomial
     1630  }
     1631  ideal I;                             // will help substituting variables in P
     1632                                       // by linear combinations of variables -
     1633  poly Pnew,temp;                      // Pnew is P with substitutions -
     1634  matrix S[m*a][m];                    // will contain system of linear
     1635                                       // equations
     1636  int j,k;
    16191637 //------------------- building the system of linear equations ----------------
    1620   matrix Eq[gen_num][m];               // will contain system of linear equations
    1621   for (i=1;i<=gen_num;i++) {
    1622     f=br,ideal(vars*transpose(G(i)));
    1623     Eq[i,1..m] = mon - f(mon);
    1624   }
    1625  
    1626  //------------------- solving the system of linear equations -----------------
    1627   module S = linear_relations(Eq);
    1628   if (S[1]==0) {
    1629     return(I);
    1630   }
    1631   I=ideal(mon*matrix(S,ncols(mon),ncols(S)));   // I contains a basis of homogeneous
    1632                                                 // invariants of degree g
    1633   ideal OUT;
    1634   int sz;
    1635   for (i=1;i<=ncols(I);i++) {
    1636     if (I[i]<>0) {
    1637       sz++;
    1638       OUT[sz]=I[i]/leadcoef(I[i]);        // setting leading coefficients to 1
    1639     }
    1640   }
    1641   return(OUT);
     1638  for (i=1;i<=a;i++)
     1639  { I=ideal(matrix(vars)*transpose(imap(br,G(i))));
     1640    I=I,p(1..m);
     1641    f=T,I;
     1642    Pnew=f(P);
     1643    for (j=1;j<=m;j++)
     1644    { temp=P/mon[j]-Pnew/mon[j];
     1645      for (k=1;k<=m;k++)
     1646      { S[m*(i-1)+j,k]=temp/p(k);
     1647      }
     1648    }
     1649  }
     1650 //----------------------------------------------------------------------------
     1651  setring br;
     1652  map f=T,ideal(0);
     1653  matrix S=f(S);
     1654  degBound=1;
     1655  matrix s=matrix(syz(S));             // s contains a basis of the space of
     1656                                       // solutions -
     1657  ideal I=ideal(matrix(mon)*s);        // I contains a basis of homogeneous
     1658  if (I[1]<>0)                         // invariants of degree d
     1659  { for (i=1;i<=ncols(I);i++)
     1660    { I[i]=I[i]/leadcoef(I[i]);        // setting leading coefficients to 1
     1661    }
     1662  }
     1663  degBound=DGB;
     1664  return(I);
    16421665}
    16431666example
     
    16471670           print(invariant_basis(2,A));
    16481671}
    1649 
    16501672///////////////////////////////////////////////////////////////////////////////
    16511673
     
    69947016  { "";
    69957017  }
    6996  
    6997   // we look at our primary invariants as such of the subgroup that only
    6998   // contains the identity, this means that ch does not divide the order anymore,
    6999   // this means that we can make use of the Molien series again - M[1,1]/M[1,2] is
    7000   // the Molien series of that group, we now calculate the secondary invariants
    7001   // of this subgroup in the usual fashion where the primary invariants are the
    7002   // ones from the bigger group.
     7018  // ring alskdfalkdsj=0,x,dp;
     7019  // matrix M[1][2]=1,(1-x)^n;           
     7020  // export alskdfalkdsj;
     7021  // export M;                            // we look at our primary invariants as
     7022  // setring br;                          // such of the subgroup that only
     7023  // matrix REY=matrix(maxideal(1));      // contains the identity, this means that
     7024                                       // ch does not divide the order anymore,
     7025                                       // this means that we can make use of the
     7026                                       // Molien series again - M[1,1]/M[1,2] is
     7027                                       // the Molien series of that group, we
     7028                                       // now calculate the secondary invariants
     7029                                       // of this subgroup in the usual fashion
     7030                                       // where the primary invariants are the
     7031                                       // ones from the bigger group
    70037032  if (v)
    70047033  { "  First, get secondary invariants for the trivial action, with respect to";
    7005     "  the primary invariants found previously.";
     7034    "  the primary invariants found previously. By the graded Nakayama lemma,";
     7035    "  this means to compute the standard monomials for the ideal generated by";
     7036    "  the primary invariants.";
    70067037    "";
    70077038  }
     
    70127043    return();
    70137044  }
    7014   matrix trivialS = matrix(kbase(GP)); // Now we have those secondary invariants!
    7015                                        // Simply they are standard monomials.
    7016   int k=ncols(trivialS);               // k is the number of trivial s.i.
     7045  matrix trivialS = matrix(kbase(GP));// , trivialIS=secondary_charp(P,REY,"alskdfalkdsj",v);
     7046  // kill trivialIS;
     7047  // kill alskdfalkdsj;
     7048  // now we have those secondary invariants
     7049  int k=ncols(trivialS);               // k is the number of the secondary
     7050                                       // invariants, we just calculated
    70177051  if (v)
    70187052  { "  We calculate secondary invariants from the ones found for the trivial";
     
    70327066    M(1)[i,1..k]=B[1..k];              // we will look for the syzygies of M(1)
    70337067  }
     7068//  intvec save_opts=option(get);
     7069//  option(returnSB,redSB);
     7070//  module M(2)=syz(M(1));               // nres(M(1),2)[2];
     7071//  option(set,save_opts);
    70347072  if (v)
    7035   { "  Compute syzygies of the \"trivial\" secondaries"; }
     7073  { "Syzygies of the \"trivial\" secondaries"; }
    70367074  module M(2)=nres(M(1),2)[2];
    70377075  int m=ncols(M(2));                   // number of generators of the module
     
    70447082  // in order to make it weighted homogeneous, we choose appropriate weights
    70457083  if (v)
    7046   { "  By elimination: Intersect syzygies with the algebra of primary invariants"; }
     7084  { "By elimination: Intersect with the invariant ring"; }
    70477085  intvec dv = degvec(ideal(P)),1;
    70487086  ring newR = char(br), (y(1..n),h),(a(dv),dp);
    7049   def tmpR = br + newR;
    7050   setring tmpR;
    7051   intvec newdv=degvec(maxideal(1));
    7052   def R = changeord("a("+string(newdv)+"),dp");
     7087  def R = br + newR;
    70537088  setring R;
    7054   kill tmpR;
    70557089  matrix P=fetch(br,P);                       // primary invariants in the new ring
    70567090  ideal ElimP;
    70577091  for (i=1;i<=n;i++)
    70587092  { ElimP[i]=y(i)-P[1,i]; }
    7059   // def RHilb = newR+br; // the new variables only appear linearly, so that block order wouldn't hurt
    7060   // setring RHilb;
    7061   // ideal ElimP=imap(R,ElimP);
    7062   // intvec EPvec = hilb(groebner(ElimP),1,degvec(maxideal(1)));
    7063   // setring R;
    7064   // ideal GElimP = std(ElimP,EPvec,degvec(maxideal(1)));
    7065   // attrib(GElimP,"isSB",1);
    7066   // int newN = ncols(GElimP); 
    7067   int newN = ncols(ElimP); 
     7093  def RHilb = newR+br; // the new variables only appear linearly, so that block order wouldn't hurt
     7094  setring RHilb;
     7095  ideal ElimP=imap(R,ElimP);
     7096  intvec EPvec = hilb(groebner(ElimP),1,degvec(maxideal(1)));
     7097  setring R;
     7098  ideal GElimP = std(ElimP,EPvec,degvec(maxideal(1)));
     7099  attrib(GElimP,"isSB",1);
     7100  int newN = ncols(GElimP); 
    70687101  matrix M[k][m+k*newN];
    70697102  M[1..k,1..m]=matrix(imap(br,M(2)));        // will contain a module -
    7070   for (i=1;i<=newN;i++){
    7071     for (j=1;j<=k;j++) {
    7072     // M[j,m+(i-1)*k+j]=GElimP[i]; // y(i)-P[1,i];
    7073       M[j,m+(i-1)*k+j]=ElimP[i];
    7074     }
    7075   }
    7076 
    7077   M=elim(module(M),1,n);           // eliminating x(1..n), std-calculation is done internally -
     7103  for (i=1;i<=newN;i++)
     7104  { for (j=1;j<=k;j++)
     7105    { M[j,m+(i-1)*k+j]=GElimP[i]; // y(i)-P[1,i];
     7106    }
     7107  }
     7108
     7109  M=elim(module(M),1,n);               // eliminating x(1..n), std-calculation
     7110                                         // is done internally -
    70787111  M=homog(module(M),h);            // homogenize for 'minbase'
    70797112  M=minbase(module(M));
     
    70837116  }
    70847117  substitute = substitute,ideal(P),1;
    7085   map f=R,substitute;                  // replacing y(1..n) by primary
     7118  map f=R,substitute;                      // replacing y(1..n) by primary
    70867119                                       // invariants and h by 1 -
    70877120  M=f(M);                              // we can't directly map from R to br
    70887121  setring br;                          // if there is a minpoly.
    7089   module M(3)=imap(R,M);               // M(2) is the new module
     7122  module M(3)=imap(R,M);                     // M(2) is the new module
    70907123  m=ncols(M(3));
    70917124  matrix S[1][m];
Note: See TracChangeset for help on using the changeset viewer.