Changeset 2abb041 in git for Singular/LIB/finvar.lib


Ignore:
Timestamp:
Feb 24, 2007, 4:08:04 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
bd7468e27c17b2493beec0180f366c438528745d
Parents:
b863e9dd32456f975a36c9963618660981b3bdb9
Message:
*hannes: fixed doc.


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/finvar.lib

    rb863e9 r2abb041  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: finvar.lib,v 1.64 2007-02-21 13:39:21 king Exp $"
     2version="$Id: finvar.lib,v 1.65 2007-02-24 15:08:04 Singular Exp $"
    33category="Invariant theory";
    44info="
     
    47694769                { ISSort[i-1] = ideal(B[j]);
    47704770                }
    4771                 if (v) 
    4772                 { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1; 
     4771                if (v)
     4772                { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1;
    47734773                }
    47744774                Reductor = ideal(helpP);
     
    47884788        else  // use fast algorithm
    47894789        { B=sort_of_invariant_basis(sP_Reductor,REY,i-1,int(dimmat[i,1])*6);
    4790                                        // B contains 
     4790                                       // B contains
    47914791                                       // images of kbase(sP,i-1) under the
    47924792                                       // Reynolds operator that are linearly
     
    48254825                { ISSort[i-1] = ideal(B[j]);
    48264826                }
    4827                 if (v) 
    4828                 { "    We found", irrcounter,"of", NrIS,"irr. sec. inv. in degree ",i-1; 
     4827                if (v)
     4828                { "    We found", irrcounter,"of", NrIS,"irr. sec. inv. in degree ",i-1;
    48294829                }
    48304830                Reductor = ideal(helpP);
     
    49004900@*          \"PP\": if this string occurs as (optional) parameter, then in
    49014901               all degrees power products of irr. sec. inv. will be computed.
    4902 RETURN:   Irreducible homogeneous secondary invariants of the invariant ring 
     4902RETURN:   Irreducible homogeneous secondary invariants of the invariant ring
    49034903          (type <matrix>)
    49044904ASSUME:   We are in the non-modular case, i.e., the characteristic of the basering
     
    49154915          independent modulo the primary invariants using Groebner basis techniques
    49164916          (see paper \"Fast Computation of Secondary Invariants\" by S. King).
    4917           The size of this set can be read off from the Molien series. Here, only 
    4918           irreducible secondary invariants are explicitly computed, which saves time and 
     4917          The size of this set can be read off from the Molien series. Here, only
     4918          irreducible secondary invariants are explicitly computed, which saves time and
    49194919          memory.
    49204920@*        Moreover, if no irr. sec. inv. in degree d-1 have been found and unless the last
    4921           optional paramter \"PP\" is used, a Groebner basis of primary invariants and 
    4922           irreducible secondary invariants up to degree d-2 is computed, which allows to 
    4923           detect irr. sec. inv. in degree d without computing power products. 
     4921          optional paramter \"PP\" is used, a Groebner basis of primary invariants and
     4922          irreducible secondary invariants up to degree d-2 is computed, which allows to
     4923          detect irr. sec. inv. in degree d without computing power products.
    49244924@*        There are three internal parameters \"pieces\", \"MonStep\" and \"IrrSwitch\".
    49254925          The default values of the parameters should be fine in most cases. However,
     
    49374937                     // If this parameter is small, the memory consumption will decrease.
    49384938  int IrrSwitch = 7; // Up to degree #IrrSwitch#-1, or if there are few monomials in kbase(sP,i-1),
    4939                      // we use a method for generating irreducible secondaries that tends to 
    4940                      // produce a smaller output (which is good for subsequent computations). 
    4941                      // However, this method needs to much memory in high degrees, and so we 
     4939                     // we use a method for generating irreducible secondaries that tends to
     4940                     // produce a smaller output (which is good for subsequent computations).
     4941                     // However, this method needs to much memory in high degrees, and so we
    49424942                     // use a sparser method from degree #IrrSwitch# upwards.
    49434943  def br=basering;
     
    50105010                                       // of a certain degree -
    50115011  m=nrows(dimmat);                     // m-1 is the highest degree
    5012   if (v) 
     5012  if (v)
    50135013  { "There are";
    50145014    for (j=1;j<=m;j++)
     
    50695069  { if ((LastNewIS == i-3) and (UsePP==0))  // We guess that all irreducibles have been found!
    50705070    { if (v) {"Computing Groebner basis for primaries and previously found irreducibles...";}
    5071       TotalReductor = groebner(sP+IS); 
    5072       TotalSet = 1; 
     5071      TotalReductor = groebner(sP+IS);
     5072      TotalSet = 1;
    50735073    }
    50745074    if (int(dimmat[i,1])<>0)           // when it is == 0 we need to find no
     
    51565156                    attrib(RedSSort[i-1][k],"size",saveAttr);
    51575157                    if (v)
    5158                     { 
     5158                    {
    51595159                      "    We found reducible sec. inv. number "+string(counter);
    51605160                    }
     
    51875187      }
    51885188    } // if TotalSet==0
    5189     else 
     5189    else
    51905190    { if (v) {"  We don't compute Power Products!"; }
    51915191// Instead of computing Power Products, we can compute a Groebner basis of the ideal
     
    51935193// polynomial of degree i-1 belongs to this ideal if and only if it belongs to the sub-algebra
    51945194// generated by primary and irreducible secondary invariants up to degree i-2.
    5195 // Hence, if we find an invariant outside this ideal, it is an irreducible secondary 
     5195// Hence, if we find an invariant outside this ideal, it is an irreducible secondary
    51965196// invariant of degree i-1.
    51975197}
     
    52315231// Compare the comments on the computation of reducible sec. inv.!
    52325232              while (j < ii) // we will break the loop if counter==int(dimmat[i,1])
    5233               { if ((j mod MonStep) == 0) 
     5233              { if ((j mod MonStep) == 0)
    52345234                { if ((j+MonStep) <= ii)
    52355235                  { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[j+1..j+MonStep])));
     
    52605260                    kill tmp;
    52615261                  }
    5262                 } 
     5262                }
    52635263                j++;
    52645264                helpP = Indicator[j];
     
    53035303            { B=sort_of_invariant_basis(TotalReductor,REY,i-1,int(dimmat[i,1])*6);
    53045304            }
    5305                                        // B is a linearly independent set of reynolds 
     5305                                       // B is a linearly independent set of reynolds
    53065306                                       // images of monomials that do not occur
    53075307                                       // as leading monomials of the ideal spanned
    5308                                        // by primary and previously found irreducible 
     5308                                       // by primary and previously found irreducible
    53095309                                       // secondary invariants.
    53105310            if (TotalSet==0 && ncols(B)+counter==int(dimmat[i,1])) // then we can take all of B
     
    53235323            else
    53245324            { irrcounter=0;
    5325               j=0;                         // j goes through all of B 
     5325              j=0;                         // j goes through all of B
    53265326// Compare the comments on the computation of reducible sec. inv.!
    53275327              ReducedCandidates = reduce(B,sP);
     
    59605960                { ISSort[i-1] = ideal(B[j]);
    59615961                }
    5962                 if (v) 
    5963                 { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1; 
     5962                if (v)
     5963                { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1;
    59645964                }
    59655965                Reductor = ideal(helpP);
     
    60166016                { ISSort[i-1] = ideal(B[j]);
    60176017                }
    6018                 if (v) 
    6019                 { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1; 
     6018                if (v)
     6019                { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1;
    60206020                }
    60216021                Reductor = ideal(helpP);
     
    60996099          hence the number of secondary invariants is the product of the degrees of
    61006100          primary invariants divided by the group order.
    6101           <secondary_and_irreducible_no_molien> should usually be faster and of more useful
     6101          <secondary_and_irreducibles_no_molien> should usually be faster and of more useful
    61026102          functionality.
    6103 SEE ALSO: secondary_and_irreducible_no_molien
     6103SEE ALSO: secondary_and_irreducibles_no_molien
    61046104EXAMPLE:  example secondary_no_molien; shows an example
    61056105"
     
    67596759THEORY:  Irred. secondary invariants are calculated by finding a basis (in terms of
    67606760         monomials) of the basering modulo primary and previously found secondary
    6761          invariants, mapping those to invariants with the Reynolds operator. Among 
    6762          these images we pick a maximal subset that is linearly independent modulo 
    6763          the primary and previously found secondary invariants, using Groebner basis 
     6761         invariants, mapping those to invariants with the Reynolds operator. Among
     6762         these images we pick a maximal subset that is linearly independent modulo
     6763         the primary and previously found secondary invariants, using Groebner basis
    67646764         techniques.
    67656765EXAMPLE: example irred_secondary_no_molien; shows an example
     
    68156815    return();
    68166816  }
    6817   if (ncols(REY)<>n) 
     6817  if (ncols(REY)<>n)
    68186818  { "ERROR:   The second parameter ought to be the Reynolds operator.";
    68196819    return();
     
    68386838  degBound = 0;
    68396839  int d,block, counter, totalcount, monsize,i,j, fin,hlp;
    6840   poly helpP,lmp; 
     6840  poly helpP,lmp;
    68416841  block = 1;
    68426842  ideal mon, MON, Inv, IS,RedInv, NewIS, NewReductor;
     
    68446844  ideal sP = slimgb(ideal(P));
    68456845  int Max = vdim(sP);
    6846   if (Max<0) 
     6846  if (Max<0)
    68476847  { "ERROR:   The second parameter ought to be the Reynolds operator.";
    68486848    return();
     
    68646864        block=0; // Loops through the monomials
    68656865        while (block<monsize)
    6866         { if ((block mod MonStep) == 0) 
     6866        { if ((block mod MonStep) == 0)
    68676867          { if ((block+MonStep) <= monsize)
    68686868            { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[block+1..block+MonStep])));
     
    68796879              kill tmp;
    68806880            }
    6881           } 
     6881          }
    68826882          block++;
    68836883          helpP = RedInv[block];
     
    68916891            NewIS[NewIScounter] = helpP;
    68926892            mon[block]=0;
    6893             Inv[block]=0; 
     6893            Inv[block]=0;
    68946894            RedInv[block]=0;
    68956895            NewReductor[1]=helpP;
     
    69046904          { degBound = 0;
    69056905            sIS = groebner(sIS);
    6906             fin=1; 
     6906            fin=1;
    69076907          }
    69086908        }
    69096909        else
    69106910        { degBound = d+1;
    6911           sIS = groebner(sIS+NewIS); 
     6911          sIS = groebner(sIS+NewIS);
    69126912          degBound = 0;
    69136913          fin = 0;
     
    69156915      }
    69166916      attrib(sIS,"isSB",1);
    6917     } // if degree d is not excluded by deg_vec 
     6917    } // if degree d is not excluded by deg_vec
    69186918    else
    69196919    { if (size(deg_vec)==l)
     
    79637963ASSUME:   mon contains at least the minimal monomial in each orbit sum of degree d
    79647964          under the permutation group given by Per.
    7965 RETURN:   an <ideal> whose generators are the orbit sums of degree d under the permutation 
     7965RETURN:   an <ideal> whose generators are the orbit sums of degree d under the permutation
    79667966          group given by Per.
    79677967SEE ALSO: invariant_algebra_perm
     
    79697969EXAMPLE: example orbit_sums; shows an example
    79707970"
    7971 { 
     7971{
    79727972//----------------- checking input ------------------
    79737973  mon=simplify(mon,2); // remove 0
     
    79757975  { "ERROR: Monomials in the first parameter must be of the same degree.";
    79767976    return();
    7977   } 
     7977  }
    79787978  int k,k2;
    79797979  for (k=1;k<=ncols(mon);k++)
     
    79897989      return();
    79907990    }
    7991     if ((ncols(M[k2])!=nvars(basering))     
     7991    if ((ncols(M[k2])!=nvars(basering))
    79927992     or (ncols(M[k2])!=ncols(simplify(M[k2],6)))
    79937993     or (M[k2][1]==0))
     
    80298029    { if ( mon[k]!=0)
    80308030      { if (tmpI[k] < mon[k])
    8031         { 
     8031        {
    80328032          mon[k]=0;
    80338033        }
    80348034        else
    80358035        { if (tmpI[k]>mon[k])
    8036           { 
     8036          {
    80378037            mon=NF(mon,std(tmpI[k]));
    80388038          }
     
    80528052  poly tmp;
    80538053  int GenOK, j,i;
    8054   poly OrbitS=mon[1]; 
     8054  poly OrbitS=mon[1];
    80558055  mon[1]=0;
    80568056  int countOrbits;
     
    80738073        newL[k] = simplify(NF(newL[k],L[k]),2);
    80748074        attrib(newL[k],"isSB",1);
    8075         if (newL[k][1] != 0)  // i.e., the Orbit is not complete under all generators yet 
    8076         { GenOK=-1;   
     8075        if (newL[k][1] != 0)  // i.e., the Orbit is not complete under all generators yet
     8076        { GenOK=-1;
    80778077          L[k] = L[k],newL[k];
    80788078          attrib(L[k],"isSB",1);
     
    80998099    if (GenOK == 0)  // i.e., all orbits are complete, so we can break the iteration
    81008100    { break;
    8101     } 
     8101    }
    81028102  } // iterate
    81038103  degBound = dgb;
     
    81128112         orb;
    81138113}
    8114  
     8114
    81158115///////////////////////////////////////////////////////////////////////////////
    81168116
    81178117proc invariant_algebra_perm (list #)
    81188118"USAGE:    invariant_algebra_perm(GEN[,v]);
    8119 @*        GEN: a list of generators of a permutation group. It is given in disjoint cycle 
    8120           form, where trivial cycles can be omitted; e.g., the generator (1,2)(3,4)(5) is 
     8119@*        GEN: a list of generators of a permutation group. It is given in disjoint cycle
     8120          form, where trivial cycles can be omitted; e.g., the generator (1,2)(3,4)(5) is
    81218121          given by <list(list(1,2),list(3,4))>.
    81228122@*        v: an optional <int>
     
    81248124          by GEN, type <matrix>
    81258125ASSUME:   We are in the non-modular case, i.e., the characteristic of the basering
    8126           does not divide the group order. Note that the function does not verify whether 
     8126          does not divide the group order. Note that the function does not verify whether
    81278127          the assumption holds or not
    81288128DISPLAY:  Information on the progress of computations if v does not equal 0
     
    81348134EXAMPLE:  example invariant_algebra_perm; shows an example
    81358135"
    8136 { 
     8136{
    81378137//----------------- checking input and setting verbose mode ------------------
    81388138  if (size(#)==0)
     
    81928192      NextCand, sGoffset, fin,MaxD,LastGDeg;
    81938193  ideal OrbSums, RedSums, NewReductor;
    8194   poly helpP,lmp; 
     8194  poly helpP,lmp;
    81958195
    81968196
     
    82168216  while ((fin==0) or (d<=MaxD))
    82178217  { if (v)
    8218     { "Searching generators in degree",d; 
     8218    { "Searching generators in degree",d;
    82198219    }
    82208220    counter = 0; // counts generators in degree d
     
    82238223    sGoffset=ncols(sG);
    82248224    OrbSize = ncols(OrbSums);
    8225     if (v) 
     8225    if (v)
    82268226    { "  We have "+string(OrbSize)+" orbit sums of degree "+string(d);
    82278227    }
    82288228// loop through orbit_sum, and select generators among them
    8229     for (i=1;i<=OrbSize;i++) 
     8229    for (i=1;i<=OrbSize;i++)
    82308230    { helpP = RedSums[i];
    82318231      if (helpP<>0)
    82328232      { counter++; // found new inv. algebra generator!
    82338233        totalcount++;
    8234         if (v) 
     8234        if (v)
    82358235        { "    We found generator number "+string(totalcount)+
    8236           " in degree "+string(d); 
     8236          " in degree "+string(d);
    82378237        }
    82388238        G[totalcount] = OrbSums[i];
     
    82568256    { degBound=0;
    82578257      if (v) {"Presumably all generators have been found";}
    8258       sG = groebner(sG); 
     8258      sG = groebner(sG);
    82598259      fin = 0;
    82608260    }
     
    82688268    if ((fin==0) and (dim(sG)==0))
    82698269    { MaxD = maxdeg1(kbase(sG));
    8270       if (v) 
     8270      if (v)
    82718271      { if (MaxD>=d) {"We found the degree bound",MaxD; }
    82728272        else {"We found the degree bound",d-1;}
     
    82778277      }
    82788278      fin = 1;
    8279     } // computing degree bound 
     8279    } // computing degree bound
    82808280  } // for increasing degrees
    82818281  kill sG;
     
    82958295proc invariant_algebra_reynolds (matrix REY, list #)
    82968296"USAGE:    invariant_algebra_reynolds(REY[,v]);
    8297 @*        REY: a gxn <matrix> representing the Reynolds operator of a finite matrix group, 
     8297@*        REY: a gxn <matrix> representing the Reynolds operator of a finite matrix group,
    82988298               where g ist the group order and n is the number of variables of the basering;
    82998299@*        v: an optional <int>
     
    83058305DISPLAY:  Information on the progress of computations if v does not equal 0
    83068306THEORY:   We do an incremental search in increasing degree d. Generators of the invariant
    8307           ring are found among the Reynolds images of monomials of degree d. The generators are 
     8307          ring are found among the Reynolds images of monomials of degree d. The generators are
    83088308          chosen by Groebner basis techniques.
    83098309SEE ALSO: invariant_algebra_perm
     
    83188318  int block, counter, totalcount, monsize,i,j,
    83198319      sGoffset, fin,MaxD,LastGDeg;
    8320   poly helpP,lmp; 
     8320  poly helpP,lmp;
    83218321  block = 1;
    83228322  ideal mon, MON, Inv, G;  // G will contain homog. alg.generators
     
    83398339      block=0; // Loops through the monomials
    83408340      while (block<monsize)
    8341       { if ((block mod MonStep) == 0) 
     8341      { if ((block mod MonStep) == 0)
    83428342        { if ((block+MonStep) <= monsize)
    83438343          { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[block+1..block+MonStep])));
     
    83548354            kill tmp;
    83558355          }
    8356         } 
     8356        }
    83578357        block++;
    83588358        helpP = RedInv[block];
     
    83678367          NewG[NewGcounter] = helpP;
    83688368          mon[block]=0;
    8369           Inv[block]=0; 
     8369          Inv[block]=0;
    83708370          RedInv[block]=0;
    83718371          NewReductor[1]=helpP;
     
    83878387    { degBound=0;
    83888388      if (v) {"Presumably all generators have been found";}
    8389       sG = groebner(sG); 
     8389      sG = groebner(sG);
    83908390      fin = 0;
    83918391    }
     
    83998399    if ((fin==0) and (dim(sG)==0))
    84008400    { MaxD = maxdeg1(kbase(sG));
    8401       if (v) 
     8401      if (v)
    84028402      { if (MaxD>=d) {"We found the degree bound",MaxD; }
    84038403        else {"We found the degree bound",d-1;}
     
    84088408      }
    84098409      fin = 1;
    8410     } // computing degree bound 
     8410    } // computing degree bound
    84118411  } // for increasing degrees
    84128412  kill sG;
Note: See TracChangeset for help on using the changeset viewer.