Changeset 9f79aa in git


Ignore:
Timestamp:
Aug 27, 1999, 4:14:21 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
34e5b70c93d1bcb01424a357ccf699f0141d25c4
Parents:
2244d82c47e474fe1afdfedde1939f9d8ff39771
Message:
*hannes: Agnes version from 23. Aug. 98


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/finvar.lib

    r2244d82 r9f79aa  
    1 // $Id: finvar.lib,v 1.20 1999-07-30 10:37:56 obachman Exp $
     1// $Id: finvar.lib,v 1.21 1999-08-27 14:14:21 Singular Exp $
    22// author: Agnes Eileen Heydtmann, email:agnes@math.uni-sb.de
    33// last change: 98/11/05
    4 //////////////////////////////////////////////////////////////////////////////
    5 version="$Id: finvar.lib,v 1.20 1999-07-30 10:37:56 obachman Exp $"
     4///////////////////////////////////////////////////////////////////////////////
     5version="$Id: finvar.lib,v 1.21 1999-08-27 14:14:21 Singular Exp $"
    66info="
    77LIBRARY:  finvar.lib       LIBRARY TO CALCULATE INVARIANT RINGS & MORE
     
    4343 secondary_and_irreducibles_no_molien() s.i. & irreducible s.i., without M.s.
    4444 secondary_not_cohen_macaulay()    s.i. when invariant ring not Cohen-Macaulay
     45 algebra_containment()             query of algebra containment
     46 module_containment()              query of module containment
    4547 orbit_variety()                   ideal of the orbit variety
    4648 relative_orbit_variety()          ideal of a relative orbit variety
     
    6466LIB "elim.lib";
    6567LIB "general.lib";
    66 LIB "algebra.lib";
     68
    6769///////////////////////////////////////////////////////////////////////////////
    6870// Checks whether the last parameter, being a matrix, is among the previous
     
    7779  return(1);
    7880}
    79 //////////////////////////////////////////////////////////////////////////////
     81///////////////////////////////////////////////////////////////////////////////
    8082
    8183proc cyclotomic (int i)
     
    127129          print(cyclotomic(25));
    128130}
    129 //////////////////////////////////////////////////////////////////////////////
    130131
    131132proc group_reynolds (list #)
     
    139140         characteristic is >0, minpoly==0 and the finite group non-cyclic the
    140141         second list element is an <int> giving the lowest common multiple of
    141          the matrix group elements (used in molien); in general all other list
    142          elements are nxn <matrices> listing all elements of the finite group
     142         the matrix group elements' order (used in molien); in general all
     143         other list elements are nxn <matrices> listing all elements of the
     144         finite group
    143145DISPLAY: information if v does not equal 0
    144146THEORY:  The entire matrix group is generated by getting all left products of
     
    146148         (or the generators themselves during the first run). All the ones that
    147149         have been generated before are thrown out and the program terminates
    148          when no new elements were found in one run. Additionally each time
    149          a new group element is found the corresponding ring mapping of which
    150          the Reynolds operator is made up is generated. They are stored in the
    151          rows of the first return value.
     150         when no new elements found in one run. Additionally each time a new
     151         group element is found the corresponding ring mapping of which the
     152         Reynolds operator is made up is generated. They are stored in the rows
     153         of the first return value.
    152154EXAMPLE: example group_reynolds; shows an example
    153155"
    154 { int ch=char(basering);            // the existance of the Reynolds operator
    155                                     // is dependent on the characteristic of
    156                                     // the base field
    157   int gen_num;                      // number of generators
     156{ int ch=char(basering);               // the existance of the Reynolds operator
     157                                       // is dependent on the characteristic of
     158                                       // the base field
     159  int gen_num;                         // number of generators
    158160 //------------------------ making sure the input is okay ---------------------
    159161  if (typeof(#[size(#)])=="int")
     
    170172  }
    171173  if (typeof(#[1])<>"matrix")
    172   { "ERROR:   the parameters must be a list of matrices and maybe an <int>";
     174  { "ERROR:   The parameters must be a list of matrices and maybe an <int>";
    173175    return();
    174176  }
     
    189191                                       // operator -
    190192  matrix G(1)=#[1];                    // G(k) are elements of the group -
    191   if (ch<>0 && minpoly==0 && gen_num<>1) //finding out of which order the group
     193  if (ch<>0 && minpoly==0 && gen_num<>1) // finding out of which order the group
    192194  { matrix I=diag(1,n);                // element is
    193195    matrix TEST=G(1);
     
    207209                                       // procedure
    208210    if (not(typeof(#[j])=="matrix"))
    209     { "ERROR:   the parameters must be a list of matrices and maybe an <int>";
     211    { "ERROR:   The parameters must be a list of matrices and maybe an <int>";
    210212      return();
    211213    }
     
    246248    for (m=g-j+1;m<=g;m++)
    247249    { for (k=1;k<=i;k++)
    248       { l++;
     250      { l=l+1;
    249251        matrix P(l)=G(k)*G(m);         // possible new element
    250252      }
     
    256258        g++;
    257259        matrix G(g)=P(k);              // a new group element -
    258         if (ch<>0 && minpoly==0 && i<>1) //finding out of which order the group
     260        if (ch<>0 && minpoly==0 && i<>1) // finding out of which order the group
    259261        { TEST=G(g);                   // element is
    260262          o2=1;
     
    282284    "";
    283285  }
    284   REY=transpose(REY);                  //when we evaluate the Reynolds operator
     286  REY=transpose(REY);                  // when we evaluate the Reynolds operator
    285287                                       // later on, we actually want 1xn
    286288                                       // matrices
     
    316318}
    317319example
    318 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";echo=2;
     320{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    319321         ring R=0,(x,y,z),dp;
    320322         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    334336   return(i);
    335337}
    336 //////////////////////////////////////////////////////////////////////////////
     338///////////////////////////////////////////////////////////////////////////////
    337339
    338340proc molien (list #)
    339341"USAGE:   molien(G1,G2,...[,ringname,lcm,flags]);
    340          G1,G2,...: nxn <matrices> generating a finite matrix group, ringname:
    341          a <string> giving a name for a new ring of characteristic 0 for the
    342          Molien series in case of prime characteristic, lcm: an <int> giving
    343          the lowest common multiple of the elements' orders in case of prime
    344          characteristic, minpoly==0 and a non-cyclic group, flags: an optional
    345          <intvec> with three components: if the first element is not equal to 0
    346          characteristic 0 is simulated, i.e. the Molien series is computed as
    347          if the base field were characteristic 0 (the user must choose a field
    348          of large characteristic, e.g. 32003), the second component should
    349          give the size of intervals between canceling common factors in the
    350          expansion of the Molien series, 0 (the default) means only once after
    351          generating all terms, in prime characteristic also a negative number
    352          can be given to indicate that common factors should always be canceled
    353          when the expansion is simple (the root of the extension field does not
    354          occur among the coefficients)
     342         G1,G2,...: nxn <matrices>, all elements of a finite matrix group,
     343         ringname: a <string> giving a name for a new ring of characteristic 0
     344         for the Molien series in case of prime characteristic, lcm: an <int>
     345         giving the lowest common multiple of the elements' orders in case of
     346         prime characteristic, minpoly==0 and a non-cyclic group, flags: an
     347         optional <intvec> with three components: if the first element is not
     348         equal to 0 characteristic 0 is simulated, i.e. the Molien series is
     349         computed as if the base field were characteristic 0 (the user must
     350         choose a field of large prime characteristic, e.g. 32003), the second
     351         component should give the size of intervals between canceling common
     352         factors in the expansion of the Molien series, 0 (the default) means
     353         only once after generating all terms, in prime characteristic also a
     354         negative number can be given to indicate that common factors should
     355         always be canceled when the expansion is simple (the root of the
     356         extension field does not occur among the coefficients)
    355357ASSUME:  n is the number of variables of the basering, G1,G2... are the group
    356358         elements generated by group_reynolds(), lcm is the second return value
     
    391393      { int r=#[size(#)-1];
    392394        if (typeof(#[size(#)-2])<>"string")
    393         { "ERROR:   in characteristic p>0 a <string> must be given for the name of a new";
     395        { "ERROR:   In characteristic p>0 a <string> must be given for the name of a new";
    394396          "         ring where the Molien series can be stored";
    395397          return();
     
    406408      else
    407409      { if (typeof(#[size(#)-1])<>"string")
    408         { "ERROR:   in characteristic p>0 a <string> must be given for the name of a new";
     410        { "ERROR:   In characteristic p>0 a <string> must be given for the name of a new";
    409411          "         ring where the Molien series can be stored";
    410412          return();
     
    670672//           { break;
    671673//           }
    672 //           k++;
     674//           k=k+1;
    673675//         }
    674676        setring `newring`;
     
    902904         (or the generators themselves during the first run). All the ones that
    903905         have been generated before are thrown out and the program terminates
    904          when no new elements were found in one run. Additionally each time
    905          a new group element is found the corresponding ring mapping of which
    906          the Reynolds operator is made up is generated. They are stored in the
    907          rows of the first return value. In characteristic 0 the terms
    908          1/det(1-xE) is computed whenever a new element E is found. In prime
    909          characteristic a Brauer lift is involved and the terms are only
    910          computed after the entire matrix group is generated (to avoid the
    911          modular case). The returned matrix gives enumerator and denominator of
    912          the expanded version where common factors have been canceled.
     906         when are no new elements found in one run. Additionally each time a
     907         new group element is found the corresponding ring mapping of which the
     908         Reynolds operator is made up is generated. They are stored in the rows
     909         of the first return value. In characteristic 0 the terms 1/det(1-xE)
     910         is computed whenever a new element E is found. In prime characteristic
     911         a Brauer lift is involved and the terms are only computed after the
     912         entire matrix group is generated (to avoid the modular case). The
     913         returned matrix gives enumerator and denominator of the expanded
     914         version where common factors have been canceled.
    913915EXAMPLE: example reynolds_molien; shows an example
    914916"
     
    10961098    { l=0;                             // l is the number of products we get in
    10971099                                       // one going
    1098       for (m=g-j+1;m<=g;m++)
     1100      for (m=g-j+1;m<=g;m=m+1)
    10991101      { for (k=1;k<=i;k++)
    11001102        { l++;
     
    12421244                                       // new term of the Molien series
    12431245    i=1;
    1244     for (int j=2;j<=gen_num;j++)     // this loop adds the parameters to the
     1246    for (int j=2;j<=gen_num;j++)       // this loop adds the parameters to the
    12451247    {                                  // group, leaving out doubles and
    12461248                                       // checking whether the parameters are
     
    14341436         next run of partial_molien
    14351437THEORY:  The following calculation is implemented:
    1436 @format
    1437 (1+a1x+a2x^2+...+anx^n)/(1+b1x+b2x^2+...+bmx^m)=(1+(a1-b1)x+...
    1438 (1+b1x+b2x^2+...+bmx^m)
    1439 -----------------------
    1440 (a1-b1)x+(a2-b2)x^2+...
    1441 (a1-b1)x+b1(a1-b1)x^2+...
    1442 @end format
     1438         (1+a1x+a2x^2+...+anx^n)/(1+b1x+b2x^2+...+bmx^m)=(1+(a1-b1)x+...
     1439         (1+b1x+b2x^2+...+bmx^m)
     1440         -----------------------
     1441            (a1-b1)x+(a2-b2)x^2+...
     1442            (a1-b1)x+b1(a1-b1)x^2+...
    14431443EXAMPLE: example partial_molien; shows an example
    14441444"
     
    14801480    poly A(2)=fetch(br,A(2));          // fetching A(2) and M[1,2] into R
    14811481    poly den=fetch(br,A(1));
    1482     for (int i=1; i<=n; i++)         // getting n terms and adding them up
     1482    for (int i=1; i<=n; i++)           // getting n terms and adding them up
    14831483    { min=lead(A(2));
    14841484      A(1)=A(1)+min;
     
    15081508         p(1);
    15091509}
    1510 ///////////////////////////////////////////////////////////////////////////////
    15111510
    15121511proc evaluate_reynolds (matrix REY, ideal I)
     
    15571556         print(evaluate_reynolds(L[1],I));
    15581557}
    1559 ///////////////////////////////////////////////////////////////////////////////
    15601558
    15611559proc invariant_basis (int g,list #)
     
    16051603  ideal mon=imap(br,mon);
    16061604  poly P=0;
    1607   for (i=m;i>=1;i=i-1)
     1605  for (i=m;i>=1;i--)
    16081606  { P=P+p(i)*mon[i];                   // P is the general polynomial
    16091607  }
     
    17571755example
    17581756{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    1759    ring R=0,(x,y,z),dp;
    1760    matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
    1761    intvec flags=0,1,0;
    1762    matrix REY,M=reynolds_molien(A,flags);
    1763    flags=8,6;
    1764    print(invariant_basis_reynolds(REY,6,flags));
     1757           ring R=0,(x,y,z),dp;
     1758           matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     1759           intvec flags=0,1,0;
     1760           matrix REY,M=reynolds_molien(A,flags);
     1761           flags=8,6;
     1762           print(invariant_basis_reynolds(REY,6,flags));
    17651763}
    17661764
    17671765///////////////////////////////////////////////////////////////////////////////
    1768 //This procedure generates linearly independent invariant polynomials of degree
    1769 // d that do not reduce to 0 modulo the primary invariants. It does this by
    1770 // applying the Reynolds operator to the monomials returned by kbase(sP,d). The
    1771 // result is used when computing secondary invariants.
     1766// This procedure generates linearly independent invariant polynomials of
     1767// degree d that do not reduce to 0 modulo the primary invariants. It does this
     1768// by applying the Reynolds operator to the monomials returned by kbase(sP,d).
     1769// The result is used when computing secondary invariants.
    17721770///////////////////////////////////////////////////////////////////////////////
    17731771proc sort_of_invariant_basis (ideal sP,matrix REY,int d,int step_fac)
    17741772{ ideal mon=kbase(sP,d);
    1775   int DEGB = degBound;
     1773  int DEGB=degBound;
    17761774  degBound=d;
    17771775  int j=ncols(mon);
     
    20642062         generated by the previously found invariants (see paper \"Generating a
    20652063         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    2066          Decker, Heydtmann, Schreyer (1997) to appear in JSC).
     2064         Decker, Heydtmann, Schreyer (1998)).
    20672065EXAMPLE: example primary_char0; shows an example
    20682066"
    20692067{ degBound=0;
    20702068  if (char(basering)<>0)
    2071   { "ERROR: primary_char0 should only be used with rings of characteristic 0.";
     2069  { "ERROR:   primary_char0 should only be used with rings of characteristic 0.";
    20722070    return();
    20732071  }
     
    22072205         generated by the previously found invariants (see paper \"Generating a
    22082206         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    2209          Decker, Heydtmann, Schreyer (1997) to appear in JSC).
     2207         Decker, Heydtmann, Schreyer (1998)).
    22102208EXAMPLE: example primary_charp; shows an example
    22112209"
     
    23322330}
    23332331example
    2334 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2;
     2332{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into char 3)"; echo=2;
    23352333         ring R=3,(x,y,z),dp;
    23362334         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    23592357         generated by the previously found invariants (see paper \"Generating a
    23602358         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    2361          Decker, Heydtmann, Schreyer (1997) to appear in JSC).
     2359         Decker, Heydtmann, Schreyer (1998)).
    23622360EXAMPLE: example primary_char0_no_molien; shows an example
    23632361"
     
    24792477}
    24802478example
    2481 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";echo=2;
     2479{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    24822480         ring R=0,(x,y,z),dp;
    24832481         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    24862484         print(l[1]);
    24872485}
    2488 ///////////////////////////////////////////////////////////////////////////////
    24892486
    24902487proc primary_charp_no_molien (matrix REY, list #)
     
    25022499         generated by the previously found invariants (see paper \"Generating a
    25032500         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    2504          Decker, Heydtmann, Schreyer (1997) to appear in JSC).
     2501         Decker, Heydtmann, Schreyer (1998)).
    25052502EXAMPLE: example primary_charp_no_molien; shows an example
    25062503"
     
    26232620}
    26242621example
    2625 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2;
     2622{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into char 3)"; echo=2;
    26262623         ring R=3,(x,y,z),dp;
    26272624         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    26432640         generated by the previously found invariants (see paper \"Generating a
    26442641         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    2645          Decker, Heydtmann, Schreyer (1997) to appear in JSC). No Reynolds
     2642         Decker, Heydtmann, Schreyer (1998)). No Reynolds
    26462643         operator or Molien series is used.
    26472644EXAMPLE: example primary_charp_without; shows an example
     
    27642761}
    27652762example
    2766 {"EXAMPLE:";echo=2;
     2763{ "EXAMPLE:" echo=2;
    27672764         ring R=2,(x,y,z),dp;
    27682765         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    27932790RETURN:  primary invariants (type <matrix>) of the invariant ring and if
    27942791         computable Reynolds operator (type <matrix>) and Molien series (type
    2795          <matrix>), if the first flag is 1 and we are in the non-modular case
    2796          then an <intvec> is returned giving some of the degrees where no
    2797          non-trivial homogeneous invariants can be found
     2792         <matrix>) or ring name (type string) where the Molien series
     2793         can be found in the char p case; if the first flag is 1 and we are in
     2794         the non-modular case then an <intvec> is returned giving some of the
     2795         degrees where no non-trivial homogeneous invariants can be found
    27982796THEORY:  Bases of homogeneous invariants are generated successively and those
    27992797         are chosen as primary invariants that lower the dimension of the ideal
    28002798         generated by the previously found invariants (see paper \"Generating a
    28012799         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    2802          Decker, Heydtmann, Schreyer (1997) to appear in JSC).
     2800         Decker, Heydtmann, Schreyer (1998)).
    28032801EXAMPLE: example primary_invariants; shows an example
    28042802"
     
    31963194         linear combinations are chosen as primary invariants that lower the
    31973195         dimension of the ideal generated by the previously found invariants
    3198          (see \"Generating a Noetherian Normalization of the Invariant Ring
    3199          of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in
    3200          JSC).
     3196         (see \"Generating a Noetherian Normalization of the Invariant Ring of
     3197         a Finite Group\" by Decker, Heydtmann, Schreyer (1998)).
    32013198EXAMPLE: example primary_char0_random; shows an example
    32023199"
     
    33203317}
    33213318example
    3322 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";echo=2;
     3319{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    33233320         ring R=0,(x,y,z),dp;
    33243321         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    33443341         linear combinations are chosen as primary invariants that lower the
    33453342         dimension of the ideal generated by the previously found invariants
    3346          (see  \"Generating a Noetherian Normalization of the Invariant Ring
    3347          of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in
    3348          JSC).
     3343         (see \"Generating a Noetherian Normalization of the Invariant Ring of
     3344         a Finite Group\" by Decker, Heydtmann, Schreyer (1998)).
    33493345EXAMPLE: example primary_charp_random; shows an example
    33503346"
     
    34743470}
    34753471example
    3476 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2;
     3472{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into char 3)"; echo=2;
    34773473         ring R=3,(x,y,z),dp;
    34783474         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    35013497         linear combinations are chosen as primary invariants that lower the
    35023498         dimension of the ideal generated by the previously found invariants
    3503          (see \"Generating a Noetherian Normalization of the Invariant Ring
    3504          of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in
    3505          JSC).
     3499         (see \"Generating a Noetherian Normalization of the Invariant Ring of
     3500         a Finite Group\" by Decker, Heydtmann, Schreyer (1998)).
    35063501EXAMPLE: example primary_char0_no_molien_random; shows an example
    35073502"
     
    36263621}
    36273622example
    3628 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";  echo=2;
     3623{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    36293624         ring R=0,(x,y,z),dp;
    36303625         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    36493644         linear combinations are chosen as primary invariants that lower the
    36503645         dimension of the ideal generated by the previously found invariants
    3651          (see \"Generating a Noetherian Normalization of the Invariant Ring
    3652          of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in
    3653          JSC).
     3646         (see \"Generating a Noetherian Normalization of the Invariant Ring of
     3647         a Finite Group\" by Decker, Heydtmann, Schreyer (1998)).
    36543648EXAMPLE: example primary_charp_no_molien_random; shows an example
    36553649"
     
    37743768}
    37753769example
    3776 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2;
     3770{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into char 3)"; echo=2;
    37773771         ring R=3,(x,y,z),dp;
    37783772         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    37943788         linear combinations are chosen as primary invariants that lower the
    37953789         dimension of the ideal generated by the previously found invariants
    3796          (see \"Generating a Noetherian Normalization of the Invariant Ring
    3797          of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in
    3798          JSC). No Reynolds operator or Molien series is used.
     3790         (see \"Generating a Noetherian Normalization of the Invariant Ring of
     3791         a Finite Group\" by Decker, Heydtmann, Schreyer (1998)). No Reynolds
     3792         operator or Molien series is used.
    37993793EXAMPLE: example primary_charp_without_random; shows an example
    38003794"
     
    39263920}
    39273921example
    3928 {  "EXAMPLE:"; echo=2;
     3922{ "EXAMPLE:"; echo=2;
    39293923         ring R=2,(x,y,z),dp;
    39303924         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    39633957         linear combinations are chosen as primary invariants that lower the
    39643958         dimension of the ideal generated by the previously found invariants
    3965          (see \"Generating a Noetherian Normalization of the Invariant Ring
    3966          of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in
    3967          JSC).
     3959         (see \"Generating a Noetherian Normalization of the Invariant Ring of
     3960         a Finite Group\" by Decker, Heydtmann, Schreyer (1998)).
    39683961EXAMPLE: example primary_invariants_random; shows an example
    39693962"
     
    40464039          { "  We are dealing with the non-modular case.";
    40474040          }
    4048           molien(L[2..size(L)],newring,intvec(0,interval,v));
     4041          if (typeof(L[2])=="int")
     4042          { molien(L[3..size(L)],newring,L[2],intvec(0,interval,v));
     4043          }
     4044          else
     4045          { molien(L[2..size(L)],newring,intvec(0,interval,v));
     4046          }
    40494047          matrix P=primary_charp_random(L[1],newring,max,v);
    40504048          return(P,L[1],newring);
     
    41154113    list L=group_reynolds(#[1..gen_num],v);
    41164114    string newring="aksldfalkdsflkj";
    4117     molien(L[2..size(L)],newring,intvec(1,interval,v));
     4115    if (typeof(L[2])=="int")
     4116    { molien(L[3..size(L)],newring,L[2],intvec(0,interval,v));
     4117    }
     4118    else
     4119    { molien(L[2..size(L)],newring,intvec(0,interval,v));
     4120    }
    41184121    matrix P=primary_charp_random(L[1],newring,max,v);
    41194122    return(P,L[1],newring);
     
    41314134}
    41324135example
    4133 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";  echo=2;
     4136{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    41344137         ring R=0,(x,y,z),dp;
    41354138         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    42014204}
    42024205example
    4203 {  "EXAMPLE:"; echo=2;
     4206{ "EXAMPLE:"; echo=2;
    42044207         intvec dv=5,5,5,10,10;
    42054208         print(power_products(dv,10));
     
    42244227         of monomials) of the basering modulo the primary invariants, mapping
    42254228         those to invariants with the Reynolds operator and using these images
    4226          or their power products s. t. they are linearly independent modulo
    4227          primary invariants (see paper \"Some Algorithms in Invariant Theory of
    4228          Finite Groups\" by Kemper and Steel (1997)).
     4229         or their power products such that they are linearly independent modulo
     4230         the primary invariants (see paper \"Some Algorithms in Invariant
     4231         Theory of Finite Groups\" by Kemper and Steel (1997)).
    42294232EXAMPLE: example secondary_char0; shows an example
    42304233"
     
    44254428         REY is the 1st return value of group_reynolds(), reynolds_molien() or
    44264429         the second one of primary_invariants(), `ringname` is a ring of
    4427          char 0 that has been created by molien() or reynolds_molien()
    4428          or primary_invariants()
     4430         char 0 that has been created by molien() or reynolds_molien() or
     4431         primary_invariants()
    44294432RETURN:  secondary invariants of the invariant ring (type <matrix>) and
    44304433         irreducible secondary invariants (type <matrix>)
     
    44334436         monomials) of the basering modulo primary invariants, mapping those
    44344437         to invariants with the Reynolds operator and using these images or
    4435          their power products s. t. they are linearly independent modulo the
    4436          primary invariants (see paper \"Some Algorithms in Invariant Theory of
    4437          Finite Groups\" by Kemper and Steel (1997)).
     4438         their power products such that they are linearly independent modulo
     4439         the primary invariants (see paper \"Some Algorithms in Invariant
     4440         Theory of Finite Groups\" by Kemper and Steel (1997)).
    44384441EXAMPLE: example secondary_charp; shows an example
    44394442"
     
    46294632}
    46304633example
    4631 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2;
     4634{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into char 3)"; echo=2;
    46324635         ring R=3,(x,y,z),dp;
    46334636         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    46534656DISPLAY: information if v does not equal 0
    46544657THEORY:  Secondary invariants are calculated by finding a basis (in terms of
    4655          monomials) of the basering modulo primary invariants, mapping those
    4656          to invariants with the Reynolds operator and using these images as
     4658         monomials) of the basering modulo primary invariants, mapping those to
     4659         invariants with the Reynolds operator and using these images as
    46574660         candidates for secondary invariants.
    46584661EXAMPLE: example secondary_no_molien; shows an example
     
    48094812DISPLAY: information if v does not equal 0
    48104813THEORY:  Secondary invariants are calculated by finding a basis (in terms of
    4811          monomials) of the basering modulo primary invariants, mapping those
    4812          to invariants with the Reynolds operator and using these images or
    4813          their power products s.t. they are linearly independent modulo the
     4814         monomials) of the basering modulo primary invariants, mapping those to
     4815         invariants with the Reynolds operator and using these images or their
     4816         power products such that they are linearly independent modulo the
    48144817         primary invariants (see paper \"Some Algorithms in Invariant Theory of
    48154818         Finite Groups\" by Kemper and Steel (1997)).
     
    50035006DISPLAY: information if v does not equal 0
    50045007THEORY:  Secondary invariants are generated following \"Generating Invariant
    5005          Rings of Finite Groups over Arbitrary Fields\" by Kemper (1996, to
    5006          appear in JSC).
     5008         Rings of Finite Groups over Arbitrary Fields\" by Kemper (1996).
    50075009EXAMPLE: example secondary_not_cohen_macaulay; shows an example
    50085010"
     
    50805082    "";
    50815083  }
    5082   matrix trivialS=secondary_charp(P,REY,"alskdfalkdsj",v);
     5084  matrix trivialS, trivialSI=secondary_charp(P,REY,"alskdfalkdsj",v);
     5085  kill trivialSI;
    50835086  kill alskdfalkdsj;
    50845087  // now we have those secondary invariants
     
    50965099  ideal B;
    50975100  for (i=1;i<=gen_num;i++)
    5098   { B=ideal(matrix(maxideal(1))*transpose(#[i]));   // image of the various
     5101  { B=ideal(matrix(maxideal(1))*transpose(#[i])); // image of the various
    50995102                                       // variables under the i-th generator -
    51005103    f=br,B;                            // the corresponding mapping -
     
    51355138                                       // invariants
    51365139  for (i=1; i<=m;i++)
    5137   { S[1,i]=S[1,i]/leadcoef(S[1,i]); // making elements nice
     5140  { S[1,i]=S[1,i]/leadcoef(S[1,i]);    // making elements nice
    51385141  }
    51395142  S=sort(ideal(S))[1];
     
    51555158}
    51565159example
    5157 {  "EXAMPLE:"; echo=2;
     5160{ "EXAMPLE:"; echo=2;
    51585161           ring R=2,(x,y,z),dp;
    51595162           matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    51775180         not even be attempted to compute the Reynolds operator or Molien
    51785181         series), the second component should give the size of intervals
    5179          between canceling common factors in the expansion of Molien series,
    5180          0 (the default) means only once after generating all terms, in prime
     5182         between canceling common factors in the expansion of Molien series, 0
     5183         (the default) means only once after generating all terms, in prime
    51815184         characteristic also a negative number can be given to indicate that
    51825185         common factors should always be canceled when the expansion is simple
    51835186         (the root of the extension field occurs not among the coefficients)
    5184 RETURN:  primary and secondary invariants (both of type matrix) generating the
    5185          invariant ring with respect to the matrix group generated by the
     5187RETURN:  primary and secondary invariants (both of type <matrix>) generating
     5188         the invariant ring with respect to the matrix group generated by the
    51865189         matrices in the input and irreducible secondary invariants (type
    51875190         <matrix>) if the Molien series was available
     
    51905193THEORY:  Bases of homogeneous invariants are generated successively and those
    51915194         are chosen as primary invariants that lower the dimension of the ideal
    5192          generated by the previously found invariants (see paper \"Generating a
     5195         generated by the previously found invariants (see \"Generating a
    51935196         Noetherian Normalization of the Invariant Ring of a Finite Group\" by
    5194          Decker, Heydtmann, Schreyer (1997) to appear in JSC). In the
     5197         Decker, Heydtmann, Schreyer (1998)). In the
    51955198         non-modular case secondary invariants are calculated by finding a
    51965199         basis (in terms of monomials) of the basering modulo the primary
     
    52005203         Theory of Finite Groups\" by Kemper and Steel (1997)). In the modular
    52015204         case they are generated according to \"Generating Invariant Rings of
    5202          Finite Groups over Arbitrary Fields\" by Kemper (1996, to appear in
    5203          JSC).
     5205         Finite Groups over Arbitrary Fields\" by Kemper (1996).
    52045206EXAMPLE: example invariant_ring; shows an example
    52055207"
     
    52565258          { "  We are dealing with the non-modular case.";
    52575259          }
    5258           molien(L[3..size(L)],newring,L[2],intvec(0,interval,v));
     5260          if (typeof(L[2])=="int")
     5261          { molien(L[3..size(L)],newring,L[2],intvec(0,interval,v));
     5262          }
     5263          else
     5264          { molien(L[2..size(L)],newring,intvec(0,interval,v));
     5265          }
    52595266          matrix P=primary_charp(L[1],newring,v);
    52605267          matrix S,IS=secondary_charp(P,L[1],newring,v);
     
    53395346    list L=group_reynolds(#[1..gen_num],v);
    53405347    string newring="aksldfalkdsflkj";
    5341     molien(L[2..size(L)],newring,intvec(1,interval,v));
     5348    if (typeof(L[2])=="int")
     5349    { molien(L[3..size(L)],newring,L[2],intvec(1,interval,v));
     5350    }
     5351    else
     5352    { molien(L[2..size(L)],newring,intvec(1,interval,v));
     5353    }
    53425354    matrix P=primary_charp(L[1],newring,v);
    53435355    matrix S,IS=secondary_charp(P,L[1],newring,v);
     
    53605372}
    53615373example
    5362 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";
    5363   echo=2;
     5374{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
    53645375         ring R=0,(x,y,z),dp;
    53655376         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     
    53765387         where -|r| to |r| is the range of coefficients of random
    53775388         combinations of bases elements that serve as primary invariants,
    5378          flags: an optional <intvec> with three entries: if the first equals
    5379          0, the program attempts to compute the Molien series and Reynolds
     5389         flags: an optional <intvec> with three entries: if the first equals 0,
     5390         the program attempts to compute the Molien series and Reynolds
    53805391         operator, if it equals 1, the program is told that the Molien series
    53815392         should not be computed, if it equals -1 characteristic 0 is simulated,
    53825393         i.e. the Molien series is computed as if the base field were
    53835394         characteristic 0 (the user must choose a field of large prime
    5384          characteristic, e.g.  32003) and if the first one is anything else, it
     5395         characteristic, e.g.  32003) and if the first one is anything else,
    53855396         then the characteristic of the base field divides the group order
    53865397         (i.e. we will not even attempt to compute the Reynolds operator or
    53875398         Molien series), the second component should give the size of intervals
    53885399         between canceling common factors in the expansion of the Molien
    5389          series,
    5390          0 (the default) means only once after generating all terms, in prime
    5391          characteristic also a negative number can be given to indicate that
    5392          common factors should always be canceled when the expansion is simple
    5393          (the root of the extension field occurs not among the coefficients)
    5394 RETURN:  primary and secondary invariants (both of type matrix) generating the
     5400         series, 0 (the default) means only once after generating all terms,
     5401         in prime characteristic also a negative number can be given to
     5402         indicate that common factors should always be canceled when the
     5403         expansion is simple (the root of the extension field does not occur
     5404         among the coefficients)
     5405RETURN:  primary and secondary invariants (both of type <matrix>) generating
    53955406         invariant ring with respect to the matrix group generated by the
    53965407         matrices in the input and irreducible secondary invariants (type
     
    54825493          { "  We are dealing with the non-modular case.";
    54835494          }
    5484           molien(L[3..size(L)],newring,L[2],intvec(0,interval,v));
     5495          if (typeof(L[2])=="int")
     5496          { molien(L[3..size(L)],newring,L[2],intvec(0,interval,v));
     5497          }
     5498          else
     5499          { molien(L[2..size(L)],newring,intvec(0,interval,v));
     5500          }
    54855501          matrix P=primary_charp_random(L[1],newring,max,v);
    54865502          matrix S,IS=secondary_charp(P,L[1],newring,v);
     
    55195535        matrix P=primary_charp_without_random(#[1..gen_num],max,v);
    55205536        matrix S=secondary_not_cohen_macaulay(P,#[1..gen_num],v);
    5521         return(L[1],S);
     5537        return(P,S);
    55225538      }
    55235539    }
     
    55655581    list L=group_reynolds(#[1..gen_num],v);
    55665582    string newring="aksldfalkdsflkj";
    5567     molien(L[2..size(L)],newring,intvec(1,v));
     5583    if (typeof(L[2])=="int")
     5584    { molien(L[3..size(L)],newring,L[2],intvec(mol_flag,interval,v));
     5585    }
     5586    else
     5587    { molien(L[2..size(L)],newring,intvec(mol_flag,interval,v));
     5588    }
    55685589    matrix P=primary_charp_random(L[1],newring,max,v);
    55695590    matrix S,IS=secondary_charp(P,L[1],newring,v);
     
    55935614         print(S);
    55945615         print(IS);
     5616}
     5617///////////////////////////////////////////////////////////////////////////////
     5618
     5619proc algebra_containment (poly p, ideal A)
     5620"USAGE:   algebra_containment(p,A); p <poly>, A <ideal> giving generators, say
     5621         f1,...,fm, subalgebra of the basering
     5622RETURN:  1 (TRUE) (type <int>) if p is contained in the subalgebra K[f1,...,fm]
     5623         0 (FALSE) (type <int>) if p is not contained
     5624DISPLAY: a representation of p in terms of algebra generators fi=y(i) if p
     5625         is contained in the subalgebra, provided printlevel>=1
     5626         (default: printlevel=0)
     5627THEORY:  The ideal of algebraic relations of the algebra generators f1,...,fm
     5628         given by A is computed introducing new variables y(i) and the product
     5629         order with x(i) >> y(i) where x(i) are the variable of the basering.
     5630         p reduces to a polynomial only in the y(i) <=> p is contained in the
     5631         subring generated by the polynomials f1,...,fm in A.
     5632EXAMPLE: example algebra_containment; shows an example
     5633"
     5634{ int DEGB = degBound;
     5635  degBound=0;
     5636  def br=basering;
     5637  int n=nvars(br);
     5638  int m=ncols(A);
     5639  string mp=string(minpoly);
     5640  execute "ring R=("+charstr(br)+"),(x(1..n),y(1..m)),(dp(n),dp(m));";
     5641  execute "minpoly=number("+mp+");";
     5642  ideal vars=x(1..n);
     5643  map emb=br,vars;
     5644  ideal A=ideal(emb(A));
     5645  poly check=emb(p);
     5646  for (int i=1;i<=m;i++)
     5647  { A[i]=A[i]-y(i);
     5648  }
     5649  A=std(A);
     5650  check=reduce(check,A);
     5651  degBound = DEGB;
     5652  if( sum(leadexp(check),1..n) == 0 )
     5653  { dbprint(printlevel-voice+2,"// "+string(check));
     5654    return(1);
     5655  }
     5656  else
     5657  { return(0);
     5658  }
     5659}
     5660example
     5661{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
     5662         ring R=0,(x,y,z),dp;
     5663         matrix A[1][7]=x2+y2,z2,x4+y4,1,x2z-1y2z,xyz,x3y-1xy3;
     5664         poly p1=x10z3-x8y2z3+2x6y4z3-2x4y6z3+x2y8z3-y10z3+x6z4+3x4y2z4+3x2y4z4+y6z4;
     5665         printlevel=2;
     5666         algebra_containment(p1,A);
     5667         poly p2=z;
     5668         algebra_containment(p2,A);
     5669}
     5670///////////////////////////////////////////////////////////////////////////////
     5671
     5672proc module_containment(poly p, matrix P, matrix S)
     5673"USAGE:  module_containment(p,P,S); p <poly>, P <ideal>, generators of an
     5674         algebra, S <ideal>, generators of a module over the algebra generated
     5675         by P
     5676ASSUME:  ncols(P)=number of variables in the basering and the generators in P
     5677RETURNS: 1 (TRUE) (type <int>) if p is contained in the module
     5678         0 (FALSE) type <int>) if p is not contained
     5679DISPLAY: the representation of p in terms of algebra generators P[i]=z(i) and
     5680         module generators S[j]=y(j) if p is contained in the module
     5681THEORY:  The ideal of algebraic relations of all the generators p1,...,pn,
     5682         s1,...,st given by P and S is computed introducing new variables y(j),
     5683         z(i) and the product order: x^a*y^b*z^c > x^d*y^e*z^f if x^a > x^d
     5684         with respect to the lp ordering or else if z^c > z^f with respect to
     5685         the dp ordering or else if y^b > y^e with respect to the lp ordering
     5686         again. p reduces to a polynomial only in the y(j) and z(i), linear in
     5687         the z(i) <=> p is contained in the module.
     5688EXAMPLE: example module_containment; shows an example
     5689"
     5690{ def br=basering;
     5691  int DEGB=degBound;
     5692  degBound=0;
     5693  int n=nvars(br);
     5694  if (ncols(P)==n)
     5695  { int m=ncols(S);
     5696    string mp=string(minpoly);
     5697    execute "ring R=("+charstr(br)+"),(x(1..n),y(1..m),z(1..n)),(lp(n),dp(m),lp(n));";
     5698    execute "minpoly=number("+mp+");";
     5699    ideal vars=x(1..n);
     5700    map emb=br,vars;
     5701    matrix P=emb(P);
     5702    matrix S=emb(S);
     5703    ideal check=emb(p);
     5704    ideal I;
     5705    for (int i=1;i<=m;i++)
     5706    { I[i]=S[1,i]-y(i);
     5707    }
     5708    for (i=1;i<=n;i++)
     5709    { I[m+i]=P[1,i]-z(i);
     5710    }
     5711    I=std(I);
     5712    check[1]=reduce(check[1],I);
     5713    I=elim(check,1,n);                 // checking whether all variables from
     5714    if (I[1]<>0)                       // the former ring have disappeared
     5715    { dbprint(printlevel-voice+2,"// "+string(check));
     5716      return(1);
     5717    }
     5718    else
     5719    { return(0);
     5720    }
     5721  }
     5722  else
     5723   { "ERROR: the first ideal must have nvars(basering) entries";
     5724    return();
     5725  }
     5726}
     5727example
     5728{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
     5729         ring R=0,(x,y,z),dp;
     5730         matrix P[1][3]=x2+y2,z2,x4+y4;
     5731         matrix S[1][4]=1,x2z-1y2z,xyz,x3y-1xy3;
     5732         poly p1=x10z3-x8y2z3+2x6y4z3-2x4y6z3+x2y8z3-y10z3+x6z4+3x4y2z4+3x2y4z4+y6z4;
     5733         printlevel=2;
     5734         module_containment(p1,P,S);
     5735         poly p2=z;
     5736         module_containment(p2,P,S);
    55955737}
    55965738///////////////////////////////////////////////////////////////////////////////
     
    56895831    J=std(J);
    56905832    ideal vars;
    5691     //for (i=1;i<=n;i++)
     5833    //for (i=1;i<=n;i=i+1)
    56925834    //{ vars[i]=0;
    56935835    //}
     
    57725914         print(image_of_variety(I,F));
    57735915}
    5774 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.