Changeset 68e678 in git
- Timestamp:
- Jul 19, 1999, 4:07:41 PM (25 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 92b2f3e2d00d6abe7a672fb181a8eb0c95c41b0f
- Parents:
- b00a82cbecb96fbd56a19be975fa94c5c6ee3016
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/all.lib
rb00a82 r68e678 1 // $Id: all.lib,v 1. 19 1999-07-07 14:39:05obachman Exp $1 // $Id: all.lib,v 1.20 1999-07-19 14:07:27 obachman Exp $ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: all.lib,v 1. 19 1999-07-07 14:39:05obachman Exp $";4 version="$Id: all.lib,v 1.20 1999-07-19 14:07:27 obachman Exp $"; 5 5 info=" 6 6 LIBRARY: all.lib Load all libraries … … 32 32 mondromy.lib PROCEDURES TO COMPUTE THE MONODROMY OF A SINGULARITY 33 33 jordan.lib PROCEDURES TO COMPUTE THE JORDAN NORMAL FORM 34 spcurve.lib PROCEDURES FOR CM CODIMENSION 2 SINGULARITIES 34 spcurve.lib PROCEDURES FOR CM CODIMENSION 2 SINGULARITIES 35 algebra.lib PROCEDURES FOR COMPUTING WITH ALGBRAS AND MAPS 35 36 "; 36 37 … … 64 65 LIB "jordan.lib"; 65 66 LIB "spcurve.lib"; 66 67 LIB "algebra.lib"; 67 68 // LIB "tools.lib"; -
Singular/LIB/finvar.lib
rb00a82 r68e678 1 // $Id: finvar.lib,v 1.1 6 1999-07-06 11:32:50obachman Exp $1 // $Id: finvar.lib,v 1.17 1999-07-19 14:07:31 obachman Exp $ 2 2 // author: Agnes Eileen Heydtmann, email:agnes@math.uni-sb.de 3 3 // last change: 98/11/05 4 4 ////////////////////////////////////////////////////////////////////////////// 5 version="$Id: finvar.lib,v 1.1 6 1999-07-06 11:32:50obachman Exp $"5 version="$Id: finvar.lib,v 1.17 1999-07-19 14:07:31 obachman Exp $" 6 6 info=" 7 7 LIBRARY: finvar.lib LIBRARY TO CALCULATE INVARIANT RINGS & MORE … … 10 10 A library for computing polynomial invariants of finite matrix groups and 11 11 generators of related varieties. The algorithms are based on B. Sturmfels, 12 G. Kemper and Decker et al..12 G. Kemper and W. Decker et al.. 13 13 14 14 AUTHOR: Agnes E. Heydtmann, agnes@math.uni-sb.de … … 45 45 secondary_and_irreducibles_no_molien() s.i. & irreducible s.i., without M.s. 46 46 secondary_not_cohen_macaulay() s.i. when invariant ring not Cohen-Macaulay 47 algebra_containment() query of algebra containment48 module_containment() query of module containment49 47 orbit_variety() ideal of the orbit variety 50 48 relative_orbit_variety() ideal of a relative orbit variety 51 49 image_of_variety() ideal of the image of a variety 52 50 "; 53 /////////////////////////////////////////////////////////////////////////////// /51 /////////////////////////////////////////////////////////////////////////////// 54 52 // perhaps useful procedures (no help provided): 55 53 // unique() is a matrix among other matrices? … … 63 61 // p_search_random searches a # of p.i., char p, randomized 64 62 // concat_intmat concatenates two integer matrices 65 //////////////////////////////////////////////////////////////////////////////// 63 /////////////////////////////////////////////////////////////////////////////// 64 66 65 LIB "matrix.lib"; 67 66 LIB "elim.lib"; 68 67 LIB "general.lib"; 69 //////////////////////////////////////////////////////////////////////////////// 70 71 //////////////////////////////////////////////////////////////////////////////// 68 LIB "algebra.lib"; 69 /////////////////////////////////////////////////////////////////////////////// 72 70 // Checks whether the last parameter, being a matrix, is among the previous 73 71 // parameters, also being matrices 74 /////////////////////////////////////////////////////////////////////////////// /72 /////////////////////////////////////////////////////////////////////////////// 75 73 proc unique (list #) 76 74 { for (int i=1;i<size(#);i=i+1) … … 81 79 return(1); 82 80 } 81 ////////////////////////////////////////////////////////////////////////////// 83 82 84 83 proc cyclotomic (int i) 85 "USAGE: cyclotomic(i); 86 i: an <int> > 0 84 "USAGE: cyclotomic(i); i integer > 0 87 85 RETURNS: the i-th cyclotomic polynomial (type <poly>) as one in the first ring 88 86 variable 87 THEORY: x^i-1 is divided by the j-th cyclotomic polynomial where j takes on 88 the value of proper divisors of i 89 89 EXAMPLE: example cyclotomic; shows an example 90 THEORY: x^i-1 is divided by the j-th cyclotomic polynomial where j takes on the91 value of proper divisors of i92 90 " 93 91 { if (i<=0) … … 127 125 } 128 126 example 129 { echo=2;127 { "EXAMPLE:"; echo=2; 130 128 ring R=0,(x,y,z),dp; 131 129 print(cyclotomic(25)); 132 130 } 131 ////////////////////////////////////////////////////////////////////////////// 133 132 134 133 proc group_reynolds (list #) … … 145 144 elements are nxn <matrices> listing all elements of the finite group 146 145 DISPLAY: information if v does not equal 0 147 EXAMPLE: example group_reynolds; shows an example148 146 THEORY: The entire matrix group is generated by getting all left products of 149 thegenerators with the new elements from the last run through the loop147 generators with the new elements from the last run through the loop 150 148 (or the generators themselves during the first run). All the ones that 151 149 have been generated before are thrown out and the program terminates 152 when there are no new elementsfound in one run. Additionally each time150 when no new elements were found in one run. Additionally each time 153 151 a new group element is found the corresponding ring mapping of which 154 152 the Reynolds operator is made up is generated. They are stored in the 155 153 rows of the first return value. 154 EXAMPLE: example group_reynolds; shows an example 156 155 " 157 { int ch=char(basering); // the existance of the Reynolds operator158 159 160 int gen_num; 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 161 160 //------------------------ making sure the input is okay --------------------- 162 161 if (typeof(#[size(#)])=="int") … … 192 191 // operator - 193 192 matrix G(1)=#[1]; // G(k) are elements of the group - 194 if (ch<>0 && minpoly==0 && gen_num<>1) // 193 if (ch<>0 && minpoly==0 && gen_num<>1) //finding out of which order the group 195 194 { matrix I=diag(1,n); // element is 196 195 matrix TEST=G(1); … … 259 258 g=g+1; 260 259 matrix G(g)=P(k); // a new group element - 261 if (ch<>0 && minpoly==0 && i<>1) // 260 if (ch<>0 && minpoly==0 && i<>1) //finding out of which order the group 262 261 { TEST=G(g); // element is 263 262 o2=1; … … 285 284 ""; 286 285 } 287 REY=transpose(REY); // 286 REY=transpose(REY); //when we evaluate the Reynolds operator 288 287 // later on, we actually want 1xn 289 288 // matrices … … 319 318 } 320 319 example 321 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 322 echo=2; 320 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";echo=2; 323 321 ring R=0,(x,y,z),dp; 324 322 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 328 326 } 329 327 330 /////////////////////////////////////////////////////////////////////////////// /328 /////////////////////////////////////////////////////////////////////////////// 331 329 // Returns i such that root^i==n, i.e. it heavily relies on the right input. 332 /////////////////////////////////////////////////////////////////////////////// /330 /////////////////////////////////////////////////////////////////////////////// 333 331 proc exponent(number n, number root) 334 332 { int i=0; … … 338 336 return(i); 339 337 } 338 ////////////////////////////////////////////////////////////////////////////// 340 339 341 340 proc molien (list #) … … 343 342 G1,G2,...: nxn <matrices> generating a finite matrix group, ringname: 344 343 a <string> giving a name for a new ring of characteristic 0 for the 345 Molien series in case of prime characteristic, lcm: an <int> giving the346 lowest common multiple of the elements' orders in case of prime344 Molien series in case of prime characteristic, lcm: an <int> giving 345 the lowest common multiple of the elements' orders in case of prime 347 346 characteristic, minpoly==0 and a non-cyclic group, flags: an optional 348 347 <intvec> with three components: if the first element is not equal to 0 349 348 characteristic 0 is simulated, i.e. the Molien series is computed as 350 349 if the base field were characteristic 0 (the user must choose a field 351 of large primecharacteristic, e.g. 32003), the second component should350 of large characteristic, e.g. 32003), the second component should 352 351 give the size of intervals between canceling common factors in the 353 352 expansion of the Molien series, 0 (the default) means only once after … … 364 363 Molien series (named M) is stored 365 364 DISPLAY: information if the third component of flags does not equal 0 365 THEORY: In characteristic 0 the terms 1/det(1-xE) for all group elements of 366 the Molien series are computed in a straight forward way. In prime 367 characteristic a Brauer lift is involved. The returned matrix gives 368 enumerator and denominator of the expanded version where common 369 factors have been canceled. 366 370 EXAMPLE: example molien; shows an example 367 THEORY: In characteristic 0 the terms 1/det(1-xE) for all group elements of the368 Molien series are computed in a straight forward way. In prime369 characteristic a Brauer lift is involved. The returned matrix gives370 enumerator and denominator of the expanded version where common factors371 have been canceled.372 371 " 373 372 { def br=basering; // the Molien series depends on the … … 860 859 example 861 860 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 862 " note the case of prime characteristic"; 863 echo=2; 861 " note the case of prime characteristic"; echo=2; 864 862 ring R=0,(x,y,z),dp; 865 863 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 877 875 kill alksdfjlaskdjf; 878 876 } 877 /////////////////////////////////////////////////////////////////////////////// 879 878 880 879 proc reynolds_molien (list #) … … 901 900 created where the same Molien series (named M) is stored 902 901 DISPLAY: information if the third component of flags does not equal 0 903 EXAMPLE: example reynolds_molien; shows an example904 902 THEORY: The entire matrix group is generated by getting all left products of 905 the generators with thenew elements from the last run through the loop903 the generators with new elements from the last run through the loop 906 904 (or the generators themselves during the first run). All the ones that 907 905 have been generated before are thrown out and the program terminates 908 when there are no new elementsfound in one run. Additionally each time906 when no new elements were found in one run. Additionally each time 909 907 a new group element is found the corresponding ring mapping of which 910 908 the Reynolds operator is made up is generated. They are stored in the … … 915 913 modular case). The returned matrix gives enumerator and denominator of 916 914 the expanded version where common factors have been canceled. 915 EXAMPLE: example reynolds_molien; shows an example 917 916 " 918 917 { def br=basering; // the Molien series depends on the … … 1406 1405 example 1407 1406 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 1408 " note the case of prime characteristic"; 1409 echo=2; 1407 " note the case of prime characteristic"; echo=2; 1410 1408 ring R=0,(x,y,z),dp; 1411 1409 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 1423 1421 kill Qadjoint; 1424 1422 } 1423 /////////////////////////////////////////////////////////////////////////////// 1425 1424 1426 1425 proc partial_molien (matrix M, int n, list #) … … 1434 1433 (first n if there is no third parameter given, otherwise the next n 1435 1434 terms depending on a previous calculation) and an intermediate result 1436 (type <poly>) of the calculation to be used as third parameter in a next1437 run of partial_molien1435 (type <poly>) of the calculation to be used as third parameter in a 1436 next run of partial_molien 1438 1437 THEORY: The following calculation is implemented: 1439 1438 (1+a1x+a2x^2+...+anx^n)/(1+b1x+b2x^2+...+bmx^m)=(1+(a1-b1)x+... … … 1499 1498 } 1500 1499 example 1501 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 1502 echo=2; 1500 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 1503 1501 ring R=0,(x,y,z),dp; 1504 1502 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 1510 1508 p(1); 1511 1509 } 1510 /////////////////////////////////////////////////////////////////////////////// 1512 1511 1513 1512 proc evaluate_reynolds (matrix REY, ideal I) … … 1520 1519 NOTE: the characteristic of the coefficient field of the polynomial ring 1521 1520 should not divide the order of the finite matrix group 1522 EXAMPLE: example evaluate_reynolds; shows an example1523 1521 THEORY: REY has been constructed in such a way that each row serves as a ring 1524 1522 mapping of which the Reynolds operator is made up. 1523 EXAMPLE: example evaluate_reynolds; shows an example 1525 1524 " 1526 1525 { def br=basering; … … 1551 1550 } 1552 1551 example 1553 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 1554 echo=2; 1552 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 1555 1553 ring R=0,(x,y,z),dp; 1556 1554 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 1559 1557 print(evaluate_reynolds(L[1],I)); 1560 1558 } 1559 /////////////////////////////////////////////////////////////////////////////// 1561 1560 1562 1561 proc invariant_basis (int g,list #) … … 1565 1564 shoud be, G1,G2,...: <matrices> generating a finite matrix group 1566 1565 RETURNS: the basis (type <ideal>) of the space of invariants of degree g 1567 EXAMPLE: example invariant_basis; shows an example 1568 THEORY: A general polynomial of degree g is generated and the generators of the 1569 matrix group applied. The difference ought to be 0 and this way a 1566 THEORY: A general polynomial of degree g is generated and the generators of 1567 the matrix group applied. The difference ought to be 0 and this way a 1570 1568 system of linear equations is created. It is solved by computing 1571 1569 syzygies. 1570 EXAMPLE: example invariant_basis; shows an example 1572 1571 " 1573 1572 { if (g<=0) … … 1643 1642 } 1644 1643 example 1645 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 1646 echo=2; 1644 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 1647 1645 ring R=0,(x,y,z),dp; 1648 1646 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; 1649 1647 print(invariant_basis(2,A)); 1650 1648 } 1649 /////////////////////////////////////////////////////////////////////////////// 1651 1650 1652 1651 proc invariant_basis_reynolds (matrix REY,int d,list #) … … 1664 1663 and flags[1] given by partial_molien 1665 1664 RETURN: the basis (type <ideal>) of the space of invariants of degree d 1666 EXAMPLE: example invariant_basis_reynolds; shows an example1667 1665 THEORY: Monomials of degree d are mapped to invariants with the Reynolds 1668 1666 operator. A linearly independent set is generated with the help of 1669 1667 minbase. 1668 EXAMPLE: example invariant_basis_reynolds; shows an example 1670 1669 " 1671 1670 { … … 1712 1711 //---------------------------------------------------------------------------- 1713 1712 ideal mon=sort(maxideal(d))[1]; 1713 int DEGB = degBound; 1714 1714 degBound=d; 1715 1715 int j=ncols(mon); … … 1720 1720 { B=evaluate_reynolds(REY,mon); // invariants at once 1721 1721 B=minbase(B); 1722 degBound= 0;1722 degBound=DEGB; 1723 1723 return(B); 1724 1724 } … … 1728 1728 { B=evaluate_reynolds(REY,mon); // invariants at once 1729 1729 B=minbase(B); 1730 degBound= 0;1730 degBound=DEGB; 1731 1731 return(B); 1732 1732 } … … 1750 1750 B=minbase(B+evaluate_reynolds(REY,part_mon)); 1751 1751 if ((ncols(B)==cd and B[1]<>0) or upper_bound==j) 1752 { degBound= 0;1752 { degBound=DEGB; 1753 1753 return(B); 1754 1754 } … … 1756 1756 } 1757 1757 example 1758 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 1759 echo=2; 1760 ring R=0,(x,y,z),dp; 1761 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; 1762 intvec flags=0,1,0; 1763 matrix REY,M=reynolds_molien(A,flags); 1764 flags=8,6; 1765 print(invariant_basis_reynolds(REY,6,flags)); 1758 { "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)); 1766 1765 } 1767 1766 1768 /////////////////////////////////////////////////////////////////////////////// /1769 // 1767 /////////////////////////////////////////////////////////////////////////////// 1768 //This procedure generates linearly independent invariant polynomials of degree 1770 1769 // d that do not reduce to 0 modulo the primary invariants. It does this by 1771 1770 // applying the Reynolds operator to the monomials returned by kbase(sP,d). The 1772 1771 // result is used when computing secondary invariants. 1773 /////////////////////////////////////////////////////////////////////////////// /1772 /////////////////////////////////////////////////////////////////////////////// 1774 1773 proc sort_of_invariant_basis (ideal sP,matrix REY,int d,int step_fac) 1775 1774 { ideal mon=kbase(sP,d); 1775 int DEGB = degBound; 1776 1776 degBound=d; 1777 1777 int j=ncols(mon); … … 1787 1787 } 1788 1788 B=minbase(B); // here are the linearly independent ones 1789 degBound= 0;1789 degBound=DEGB; 1790 1790 return(B); 1791 1791 } … … 1808 1808 B=minbase(B+part_mon); // here are the linearly independent ones 1809 1809 if (upper_bound==j) 1810 { degBound= 0;1810 { degBound=DEGB; 1811 1811 return(B); 1812 1812 } … … 1814 1814 } 1815 1815 1816 /////////////////////////////////////////////////////////////////////////////// /1816 /////////////////////////////////////////////////////////////////////////////// 1817 1817 // Procedure returning the succeeding vector after vec. It is used to list 1818 1818 // all the vectors of Z^n with first nonzero entry 1. They are listed by 1819 1819 // increasing sum of the absolute value of their entries. 1820 /////////////////////////////////////////////////////////////////////////////// /1820 /////////////////////////////////////////////////////////////////////////////// 1821 1821 proc next_vector(intmat vec) 1822 1822 { int n=ncols(vec); // p: >0, n: <0, p0: >=0, n0: <=0 … … 1876 1876 } 1877 1877 1878 /////////////////////////////////////////////////////////////////////////////// /1878 /////////////////////////////////////////////////////////////////////////////// 1879 1879 // Maps integers to elements of the base field. It is only called if the base 1880 // field is of prime characteristic. If the base field has q elements (depending1881 // on minpoly) 1..q is mapped to those q elements.1882 /////////////////////////////////////////////////////////////////////////////// /1880 // field is of prime characteristic. If the base field has q elements 1881 // (depending on minpoly) 1..q is mapped to those q elements. 1882 /////////////////////////////////////////////////////////////////////////////// 1883 1883 proc int_number_map (int i) 1884 1884 { int p=char(basering); … … 1912 1912 } 1913 1913 1914 /////////////////////////////////////////////////////////////////////////////// /1914 /////////////////////////////////////////////////////////////////////////////// 1915 1915 // This procedure finds dif primary invariants in degree d. It returns all 1916 1916 // primary invariants found so far. The coefficients lie in a field of 1917 1917 // characteristic 0. 1918 /////////////////////////////////////////////////////////////////////////////// /1918 /////////////////////////////////////////////////////////////////////////////// 1919 1919 proc search (int n,int d,ideal B,int cd,ideal P,ideal sP,int i,int dif,int dB,ideal CI) 1920 1920 { intmat vec[1][cd]; // the coefficients for the next … … 1961 1961 } 1962 1962 1963 /////////////////////////////////////////////////////////////////////////////// /1963 /////////////////////////////////////////////////////////////////////////////// 1964 1964 // This procedure finds at most dif primary invariants in degree d. It returns 1965 1965 // all primary invariants found so far. The coefficients lie in the field of 1966 1966 // characteristic p>0. 1967 /////////////////////////////////////////////////////////////////////////////// /1967 /////////////////////////////////////////////////////////////////////////////// 1968 1968 proc p_search (int n,int d,ideal B,int cd,ideal P,ideal sP,int i,int dif,int dB,ideal CI) 1969 1969 { def br=basering; … … 2049 2049 return(P,sP,CI,dB); 2050 2050 } 2051 /////////////////////////////////////////////////////////////////////////////// 2051 2052 2052 2053 proc primary_char0 (matrix REY,matrix M,list #) … … 2059 2060 equal 0 2060 2061 RETURN: primary invariants (type <matrix>) of the invariant ring 2061 EXAMPLE: example primary_char0; shows an example2062 2062 THEORY: Bases of homogeneous invariants are generated successively and those 2063 2063 are chosen as primary invariants that lower the dimension of the ideal … … 2065 2065 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2066 2066 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2067 EXAMPLE: example primary_char0; shows an example 2067 2068 " 2068 2069 { degBound=0; 2069 2070 if (char(basering)<>0) 2070 { "ERROR: 2071 { "ERROR: primary_char0 should only be used with rings of characteristic 0."; 2071 2072 return(); 2072 2073 } … … 2182 2183 } 2183 2184 example 2184 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 2185 echo=2; 2185 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 2186 2186 ring R=0,(x,y,z),dp; 2187 2187 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 2190 2190 print(P); 2191 2191 } 2192 /////////////////////////////////////////////////////////////////////////////// 2192 2193 2193 2194 proc primary_charp (matrix REY,string ring_name,list #) … … 2202 2203 equal 0 2203 2204 RETURN: primary invariants (type <matrix>) of the invariant ring 2204 EXAMPLE: example primary_charp; shows an example2205 2205 THEORY: Bases of homogeneous invariants are generated successively and those 2206 2206 are chosen as primary invariants that lower the dimension of the ideal … … 2208 2208 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2209 2209 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2210 EXAMPLE: example primary_charp; shows an example 2210 2211 " 2211 2212 { degBound=0; … … 2331 2332 } 2332 2333 example 2333 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into"; 2334 " characteristic 3)"; 2335 echo=2; 2334 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2; 2336 2335 ring R=3,(x,y,z),dp; 2337 2336 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 2344 2343 print(P); 2345 2344 } 2345 /////////////////////////////////////////////////////////////////////////////// 2346 2346 2347 2347 proc primary_char0_no_molien (matrix REY, list #) … … 2355 2355 <intvec> listing some of the degrees where no non-trivial homogeneous 2356 2356 invariants are to be found 2357 EXAMPLE: example primary_char0_no_molien; shows an example2358 2357 THEORY: Bases of homogeneous invariants are generated successively and those 2359 2358 are chosen as primary invariants that lower the dimension of the ideal … … 2361 2360 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2362 2361 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2362 EXAMPLE: example primary_char0_no_molien; shows an example 2363 2363 " 2364 2364 { degBound=0; … … 2479 2479 } 2480 2480 example 2481 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 2482 echo=2; 2481 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";echo=2; 2483 2482 ring R=0,(x,y,z),dp; 2484 2483 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 2487 2486 print(l[1]); 2488 2487 } 2488 /////////////////////////////////////////////////////////////////////////////// 2489 2489 2490 2490 proc primary_charp_no_molien (matrix REY, list #) … … 2498 2498 <intvec> listing some of the degrees where no non-trivial homogeneous 2499 2499 invariants are to be found 2500 EXAMPLE: example primary_charp_no_molien; shows an example2501 2500 THEORY: Bases of homogeneous invariants are generated successively and those 2502 2501 are chosen as primary invariants that lower the dimension of the ideal … … 2504 2503 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2505 2504 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2505 EXAMPLE: example primary_charp_no_molien; shows an example 2506 2506 " 2507 2507 { degBound=0; … … 2623 2623 } 2624 2624 example 2625 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into"; 2626 " characteristic 3)"; 2627 echo=2; 2625 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2; 2628 2626 ring R=3,(x,y,z),dp; 2629 2627 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 2632 2630 print(l[1]); 2633 2631 } 2632 /////////////////////////////////////////////////////////////////////////////// 2634 2633 2635 2634 proc primary_charp_without (list #) … … 2640 2639 equal 0 2641 2640 RETURN: primary invariants (type <matrix>) of the invariant ring 2642 EXAMPLE: example primary_charp_without; shows an example2643 2641 THEORY: Bases of homogeneous invariants are generated successively and those 2644 2642 are chosen as primary invariants that lower the dimension of the ideal … … 2647 2645 Decker, Heydtmann, Schreyer (1997) to appear in JSC). No Reynolds 2648 2646 operator or Molien series is used. 2647 EXAMPLE: example primary_charp_without; shows an example 2649 2648 " 2650 2649 { degBound=0; … … 2765 2764 } 2766 2765 example 2767 { 2766 {"EXAMPLE:";echo=2; 2768 2767 ring R=2,(x,y,z),dp; 2769 2768 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 2771 2770 print(P); 2772 2771 } 2772 /////////////////////////////////////////////////////////////////////////////// 2773 2773 2774 2774 proc primary_invariants (list #) … … 2788 2788 characteristic also a negative number can be given to indicate that 2789 2789 common factors should always be canceled when the expansion is simple 2790 (the root of the extension field does not occuramong the coefficients)2790 (the root of the extension field occurs not among the coefficients) 2791 2791 DISPLAY: information about the various stages of the programme if the third 2792 2792 flag does not equal 0 … … 2796 2796 then an <intvec> is returned giving some of the degrees where no 2797 2797 non-trivial homogeneous invariants can be found 2798 EXAMPLE: example primary_invariants; shows an example2799 2798 THEORY: Bases of homogeneous invariants are generated successively and those 2800 2799 are chosen as primary invariants that lower the dimension of the ideal … … 2802 2801 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2803 2802 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2803 EXAMPLE: example primary_invariants; shows an example 2804 2804 " 2805 2805 { … … 2970 2970 } 2971 2971 2972 /////////////////////////////////////////////////////////////////////////////// /2972 /////////////////////////////////////////////////////////////////////////////// 2973 2973 // This procedure finds dif primary invariants in degree d. It returns all 2974 2974 // primary invariants found so far. The coefficients lie in a field of 2975 2975 // characteristic 0. 2976 /////////////////////////////////////////////////////////////////////////////// /2976 /////////////////////////////////////////////////////////////////////////////// 2977 2977 proc search_random (int n,int d,ideal B,int cd,ideal P,int i,int dif,int dB,ideal CI,int max) 2978 2978 { string answer; … … 3066 3066 } 3067 3067 3068 /////////////////////////////////////////////////////////////////////////////// /3068 /////////////////////////////////////////////////////////////////////////////// 3069 3069 // This procedure finds at most dif primary invariants in degree d. It returns 3070 3070 // all primary invariants found so far. The coefficients lie in the field of 3071 3071 // characteristic p>0. 3072 /////////////////////////////////////////////////////////////////////////////// /3072 /////////////////////////////////////////////////////////////////////////////// 3073 3073 proc p_search_random (int n,int d,ideal B,int cd,ideal P,int i,int dif,int dB,ideal CI,int max) 3074 3074 { string answer; … … 3180 3180 return(P,CI,dB); 3181 3181 } 3182 /////////////////////////////////////////////////////////////////////////////// 3182 3183 3183 3184 proc primary_char0_random (matrix REY,matrix M,int max,list #) … … 3192 3193 equal 0 3193 3194 RETURN: primary invariants (type <matrix>) of the invariant ring 3194 EXAMPLE: example primary_char0_random; shows an example3195 3195 THEORY: Bases of homogeneous invariants are generated successively and random 3196 3196 linear combinations are chosen as primary invariants that lower the 3197 3197 dimension of the ideal generated by the previously found invariants 3198 (see paper\"Generating a Noetherian Normalization of the Invariant Ring3198 (see \"Generating a Noetherian Normalization of the Invariant Ring 3199 3199 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3200 3200 JSC). 3201 EXAMPLE: example primary_char0_random; shows an example 3201 3202 " 3202 3203 { degBound=0; … … 3319 3320 } 3320 3321 example 3321 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 3322 echo=2; 3322 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:";echo=2; 3323 3323 ring R=0,(x,y,z),dp; 3324 3324 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 3327 3327 print(P); 3328 3328 } 3329 /////////////////////////////////////////////////////////////////////////////// 3329 3330 3330 3331 proc primary_charp_random (matrix REY,string ring_name,int max,list #) … … 3340 3341 equal 0 3341 3342 RETURN: primary invariants (type <matrix>) of the invariant ring 3342 EXAMPLE: example primary_charp_random; shows an example3343 3343 THEORY: Bases of homogeneous invariants are generated successively and random 3344 3344 linear combinations are chosen as primary invariants that lower the 3345 3345 dimension of the ideal generated by the previously found invariants 3346 (see paper\"Generating a Noetherian Normalization of the Invariant Ring3346 (see \"Generating a Noetherian Normalization of the Invariant Ring 3347 3347 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3348 3348 JSC). 3349 EXAMPLE: example primary_charp_random; shows an example 3349 3350 " 3350 3351 { degBound=0; … … 3473 3474 } 3474 3475 example 3475 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into"; 3476 " characteristic 3)"; 3477 echo=2; 3476 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2; 3478 3477 ring R=3,(x,y,z),dp; 3479 3478 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 3486 3485 print(P); 3487 3486 } 3487 /////////////////////////////////////////////////////////////////////////////// 3488 3488 3489 3489 proc primary_char0_no_molien_random (matrix REY, int max, list #) … … 3498 3498 <intvec> listing some of the degrees where no non-trivial homogeneous 3499 3499 invariants are to be found 3500 EXAMPLE: example primary_char0_no_molien_random; shows an example3501 3500 THEORY: Bases of homogeneous invariants are generated successively and random 3502 3501 linear combinations are chosen as primary invariants that lower the 3503 3502 dimension of the ideal generated by the previously found invariants 3504 (see paper\"Generating a Noetherian Normalization of the Invariant Ring3503 (see \"Generating a Noetherian Normalization of the Invariant Ring 3505 3504 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3506 3505 JSC). 3506 EXAMPLE: example primary_char0_no_molien_random; shows an example 3507 3507 " 3508 3508 { degBound=0; … … 3626 3626 } 3627 3627 example 3628 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 3629 echo=2; 3628 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 3630 3629 ring R=0,(x,y,z),dp; 3631 3630 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 3634 3633 print(l[1]); 3635 3634 } 3635 /////////////////////////////////////////////////////////////////////////////// 3636 3636 3637 3637 proc primary_charp_no_molien_random (matrix REY, int max, list #) … … 3646 3646 <intvec> listing some of the degrees where no non-trivial homogeneous 3647 3647 invariants are to be found 3648 EXAMPLE: example primary_charp_no_molien_random; shows an example3649 3648 THEORY: Bases of homogeneous invariants are generated successively and random 3650 3649 linear combinations are chosen as primary invariants that lower the 3651 3650 dimension of the ideal generated by the previously found invariants 3652 (see paper\"Generating a Noetherian Normalization of the Invariant Ring3651 (see \"Generating a Noetherian Normalization of the Invariant Ring 3653 3652 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3654 3653 JSC). 3654 EXAMPLE: example primary_charp_no_molien_random; shows an example 3655 3655 " 3656 3656 { degBound=0; … … 3774 3774 } 3775 3775 example 3776 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into"; 3777 " characteristic 3)"; 3778 echo=2; 3776 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2; 3779 3777 ring R=3,(x,y,z),dp; 3780 3778 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 3783 3781 print(l[1]); 3784 3782 } 3783 /////////////////////////////////////////////////////////////////////////////// 3785 3784 3786 3785 proc primary_charp_without_random (list #) … … 3792 3791 equal 0 3793 3792 RETURN: primary invariants (type <matrix>) of the invariant ring 3794 EXAMPLE: example primary_charp_without_random; shows an example3795 3793 THEORY: Bases of homogeneous invariants are generated successively and random 3796 3794 linear combinations are chosen as primary invariants that lower the 3797 3795 dimension of the ideal generated by the previously found invariants 3798 (see paper\"Generating a Noetherian Normalization of the Invariant Ring3796 (see \"Generating a Noetherian Normalization of the Invariant Ring 3799 3797 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3800 3798 JSC). No Reynolds operator or Molien series is used. 3799 EXAMPLE: example primary_charp_without_random; shows an example 3801 3800 " 3802 3801 { degBound=0; … … 3927 3926 } 3928 3927 example 3929 { echo=2;3928 { "EXAMPLE:"; echo=2; 3930 3929 ring R=2,(x,y,z),dp; 3931 3930 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 3933 3932 print(P); 3934 3933 } 3934 /////////////////////////////////////////////////////////////////////////////// 3935 3935 3936 3936 proc primary_invariants_random (list #) … … 3960 3960 then an <intvec> is returned giving some of the degrees where no 3961 3961 non-trivial homogeneous invariants can be found 3962 EXAMPLE: example primary_invariants_random; shows an example3963 3962 THEORY: Bases of homogeneous invariants are generated successively and random 3964 3963 linear combinations are chosen as primary invariants that lower the 3965 3964 dimension of the ideal generated by the previously found invariants 3966 (see paper\"Generating a Noetherian Normalization of the Invariant Ring3965 (see \"Generating a Noetherian Normalization of the Invariant Ring 3967 3966 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3968 3967 JSC). 3968 EXAMPLE: example primary_invariants_random; shows an example 3969 3969 " 3970 3970 { … … 4131 4131 } 4132 4132 example 4133 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 4134 echo=2; 4133 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 4135 4134 ring R=0,(x,y,z),dp; 4136 4135 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 4138 4137 print(L[1]); 4139 4138 } 4139 /////////////////////////////////////////////////////////////////////////////// 4140 4140 4141 4141 proc concat_intmat(intmat A,intmat B) … … 4148 4148 return(C); 4149 4149 } 4150 /////////////////////////////////////////////////////////////////////////////// 4150 4151 4151 4152 proc power_products(intvec deg_vec,int d) … … 4156 4157 containing the exponents of the corresponding polynomials. The product 4157 4158 of the powers is then homogeneous of degree d. 4158 EXAMPLE: example power_products; gives an example4159 EXAMPLE: example power_products; shows an example 4159 4160 " 4160 4161 { ring R=0,x,dp; … … 4200 4201 } 4201 4202 example 4202 { echo=2;4203 { "EXAMPLE:"; echo=2; 4203 4204 intvec dv=5,5,5,10,10; 4204 4205 print(power_products(dv,10)); 4205 4206 print(power_products(dv,7)); 4206 4207 } 4208 /////////////////////////////////////////////////////////////////////////////// 4207 4209 4208 4210 proc secondary_char0 (matrix P, matrix REY, matrix M, list #) 4209 4211 "USAGE: secondary_char0(P,REY,M[,v]); 4210 4212 P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix> 4211 representing the Reynolds operator, M: a 1x2 <matrix> giving enumerator4213 representing the Reynolds operator, M: a 1x2 <matrix> giving numerator 4212 4214 and denominator of the Molien series, v: an optional <int> 4213 4215 ASSUME: n is the number of variables of the basering, g the size of the group, … … 4219 4221 irreducible secondary invariants (type <matrix>) 4220 4222 DISPLAY: information if v does not equal 0 4221 EXAMPLE: example secondary_char0; shows an example 4222 THEORY: The secondary invariants are calculated by finding a basis (in terms of 4223 monomials) of the basering modulo the primary invariants, mapping those 4224 to invariants with the Reynolds operator and using these images or 4225 their power products such that they are linearly independent modulo the 4223 THEORY: The secondary invariants are calculated by finding a basis (in terms 4224 of monomials) of the basering modulo the primary invariants, mapping 4225 those to invariants with the Reynolds operator and using these images 4226 or their power products s. t. they are linearly independent modulo 4226 4227 primary invariants (see paper \"Some Algorithms in Invariant Theory of 4227 4228 Finite Groups\" by Kemper and Steel (1997)). 4229 EXAMPLE: example secondary_char0; shows an example 4228 4230 " 4229 4231 { def br=basering; … … 4404 4406 } 4405 4407 example 4406 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 4407 echo=2; 4408 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 4408 4409 ring R=0,(x,y,z),dp; 4409 4410 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 4413 4414 print(IS); 4414 4415 } 4416 /////////////////////////////////////////////////////////////////////////////// 4415 4417 4416 4418 proc secondary_charp (matrix P, matrix REY, string ring_name, list #) … … 4422 4424 ASSUME: n is the number of variables of the basering, g the size of the group, 4423 4425 REY is the 1st return value of group_reynolds(), reynolds_molien() or 4424 the second one of primary_invariants(), `ringname` is ring of4425 char acteristic0 that has been created by molien() or reynolds_molien()4426 the second one of primary_invariants(), `ringname` is a ring of 4427 char 0 that has been created by molien() or reynolds_molien() 4426 4428 or primary_invariants() 4427 4429 RETURN: secondary invariants of the invariant ring (type <matrix>) and 4428 4430 irreducible secondary invariants (type <matrix>) 4429 4431 DISPLAY: information if v does not equal 0 4430 EXAMPLE: example secondary_charp; shows an example 4431 THEORY: The secondary invariants are calculated by finding a basis (in terms of 4432 monomials) of the basering modulo the primary invariants, mapping those 4432 THEORY: Secondary invariants are calculated by finding a basis (in terms of 4433 monomials) of the basering modulo primary invariants, mapping those 4433 4434 to invariants with the Reynolds operator and using these images or 4434 their power products s uch thatthey are linearly independent modulo the4435 their power products s. t. they are linearly independent modulo the 4435 4436 primary invariants (see paper \"Some Algorithms in Invariant Theory of 4436 4437 Finite Groups\" by Kemper and Steel (1997)). 4438 EXAMPLE: example secondary_charp; shows an example 4437 4439 " 4438 4440 { def br=basering; … … 4627 4629 } 4628 4630 example 4629 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed into"; 4630 " characteristic 3)"; 4631 echo=2; 4631 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7 (changed to char 3)"; echo=2; 4632 4632 ring R=3,(x,y,z),dp; 4633 4633 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 4637 4637 print(IS); 4638 4638 } 4639 /////////////////////////////////////////////////////////////////////////////// 4639 4640 4640 4641 proc secondary_no_molien (matrix P, matrix REY, list #) … … 4642 4643 P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix> 4643 4644 representing the Reynolds operator, deg_vec: an optional <intvec> 4644 listing some degrees where no non-trivial homogeneous invariants can be4645 found, v: an optional <int>4645 listing some degrees where no non-trivial homogeneous invariants can 4646 be found, v: an optional <int> 4646 4647 ASSUME: n is the number of variables of the basering, g the size of the group, 4647 4648 REY is the 1st return value of group_reynolds(), reynolds_molien() or … … 4651 4652 RETURN: secondary invariants of the invariant ring (type <matrix>) 4652 4653 DISPLAY: information if v does not equal 0 4653 EXAMPLE: example secondary_no_molien; shows an example 4654 THEORY: The secondary invariants are calculated by finding a basis (in terms of 4655 monomials) of the basering modulo the primary invariants, mapping those 4654 THEORY: Secondary invariants are calculated by finding a basis (in terms of 4655 monomials) of the basering modulo primary invariants, mapping those 4656 4656 to invariants with the Reynolds operator and using these images as 4657 4657 candidates for secondary invariants. 4658 EXAMPLE: example secondary_no_molien; shows an example 4658 4659 " 4659 4660 { int i; … … 4788 4789 } 4789 4790 example 4790 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 4791 echo=2; 4791 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 4792 4792 ring R=0,(x,y,z),dp; 4793 4793 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 4796 4796 print(S); 4797 4797 } 4798 /////////////////////////////////////////////////////////////////////////////// 4798 4799 4799 4800 proc secondary_and_irreducibles_no_molien (matrix P, matrix REY, list #) … … 4807 4808 irreducible secondary invariants (type <matrix>) 4808 4809 DISPLAY: information if v does not equal 0 4809 EXAMPLE: example secondary_and_irreducibles_no_molien; shows an example 4810 THEORY: The secondary invariants are calculated by finding a basis (in terms of 4811 monomials) of the basering modulo the primary invariants, mapping those 4810 THEORY: Secondary invariants are calculated by finding a basis (in terms of 4811 monomials) of the basering modulo primary invariants, mapping those 4812 4812 to invariants with the Reynolds operator and using these images or 4813 their power products s uch thatthey are linearly independent modulo the4813 their power products s.t. they are linearly independent modulo the 4814 4814 primary invariants (see paper \"Some Algorithms in Invariant Theory of 4815 4815 Finite Groups\" by Kemper and Steel (1997)). 4816 EXAMPLE: example secondary_and_irreducibles_no_molien; shows an example 4816 4817 " 4817 4818 { int i; … … 4984 4985 } 4985 4986 example 4986 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 4987 echo=2; 4987 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 4988 4988 ring R=0,(x,y,z),dp; 4989 4989 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 4993 4993 print(IS); 4994 4994 } 4995 /////////////////////////////////////////////////////////////////////////////// 4995 4996 4996 4997 proc secondary_not_cohen_macaulay (matrix P, list #) … … 5001 5002 RETURN: secondary invariants of the invariant ring (type <matrix>) 5002 5003 DISPLAY: information if v does not equal 0 5003 EXAMPLE: example secondary_not_cohen_macaulay; shows an example 5004 THEORY: The secondary invariants are generated following \"Generating Invariant 5004 THEORY: Secondary invariants are generated following \"Generating Invariant 5005 5005 Rings of Finite Groups over Arbitrary Fields\" by Kemper (1996, to 5006 5006 appear in JSC). 5007 EXAMPLE: example secondary_not_cohen_macaulay; shows an example 5007 5008 " 5008 5009 { int i, j; … … 5154 5155 } 5155 5156 example 5156 { echo=2;5157 { "EXAMPLE:"; echo=2; 5157 5158 ring R=2,(x,y,z),dp; 5158 5159 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 5161 5162 print(S); 5162 5163 } 5164 /////////////////////////////////////////////////////////////////////////////// 5163 5165 5164 5166 proc invariant_ring (list #) … … 5175 5177 not even be attempted to compute the Reynolds operator or Molien 5176 5178 series), the second component should give the size of intervals 5177 between canceling common factors in the expansion of theMolien series,5179 between canceling common factors in the expansion of Molien series, 5178 5180 0 (the default) means only once after generating all terms, in prime 5179 5181 characteristic also a negative number can be given to indicate that 5180 5182 common factors should always be canceled when the expansion is simple 5181 (the root of the extension field does not occuramong the coefficients)5182 RETURN: primary and secondary invariants (both of type <matrix>) generating the5183 (the root of the extension field occurs not among the coefficients) 5184 RETURN: primary and secondary invariants (both of type matrix) generating the 5183 5185 invariant ring with respect to the matrix group generated by the 5184 5186 matrices in the input and irreducible secondary invariants (type … … 5186 5188 DISPLAY: information about the various stages of the program if the third flag 5187 5189 does not equal 0 5188 EXAMPLE: example invariant_ring; shows an example5189 5190 THEORY: Bases of homogeneous invariants are generated successively and those 5190 5191 are chosen as primary invariants that lower the dimension of the ideal … … 5196 5197 invariants, mapping to invariants with the Reynolds operator and using 5197 5198 those or their power products such that they are linearly independent 5198 modulo the primary invariants (see paper\"Some Algorithms in Invariant5199 modulo the primary invariants (see \"Some Algorithms in Invariant 5199 5200 Theory of Finite Groups\" by Kemper and Steel (1997)). In the modular 5200 5201 case they are generated according to \"Generating Invariant Rings of 5201 5202 Finite Groups over Arbitrary Fields\" by Kemper (1996, to appear in 5202 5203 JSC). 5204 EXAMPLE: example invariant_ring; shows an example 5203 5205 " 5204 5206 { if (size(#)==0) … … 5367 5369 print(IS); 5368 5370 } 5371 /////////////////////////////////////////////////////////////////////////////// 5369 5372 5370 5373 proc invariant_ring_random (list #) … … 5373 5376 where -|r| to |r| is the range of coefficients of random 5374 5377 combinations of bases elements that serve as primary invariants, 5375 flags: an optional <intvec> with three entries: if the first oneequals5378 flags: an optional <intvec> with three entries: if the first equals 5376 5379 0, the program attempts to compute the Molien series and Reynolds 5377 5380 operator, if it equals 1, the program is told that the Molien series … … 5380 5383 characteristic 0 (the user must choose a field of large prime 5381 5384 characteristic, e.g. 32003) and if the first one is anything else, it 5382 means thatthe characteristic of the base field divides the group order5383 (i.e. it will not even be attemptedto compute the Reynolds operator or5385 then the characteristic of the base field divides the group order 5386 (i.e. we will not even attempt to compute the Reynolds operator or 5384 5387 Molien series), the second component should give the size of intervals 5385 between canceling common factors in the expansion of the Molien series, 5388 between canceling common factors in the expansion of the Molien 5389 series, 5386 5390 0 (the default) means only once after generating all terms, in prime 5387 5391 characteristic also a negative number can be given to indicate that 5388 5392 common factors should always be canceled when the expansion is simple 5389 (the root of the extension field does not occuramong the coefficients)5390 RETURN: primary and secondary invariants (both of type <matrix>) generating the5393 (the root of the extension field occurs not among the coefficients) 5394 RETURN: primary and secondary invariants (both of type matrix) generating the 5391 5395 invariant ring with respect to the matrix group generated by the 5392 5396 matrices in the input and irreducible secondary invariants (type … … 5394 5398 DISPLAY: information about the various stages of the program if the third flag 5395 5399 does not equal 0 5396 EXAMPLE: example invariant_ring_random; shows an example5397 5400 THEORY: is the same as for invariant_ring except that random combinations of 5398 5401 basis elements are chosen as candidates for primary invariants and 5399 5402 hopefully they lower the dimension of the previously found primary 5400 5403 invariants by the right amount. 5404 EXAMPLE: example invariant_ring_random; shows an example 5401 5405 " 5402 5406 { if (size(#)<2) … … 5582 5586 } 5583 5587 example 5584 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 5585 echo=2; 5588 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 5586 5589 ring R=0,(x,y,z),dp; 5587 5590 matrix A[3][3]=0,1,0,-1,0,0,0,0,-1; … … 5591 5594 print(IS); 5592 5595 } 5593 5594 proc algebra_containment (poly p, matrix A) 5595 "USAGE: algebra_containment(p,A); 5596 p: arbitrary <poly>, A: a 1xm <matrix> giving generators of a 5597 subalgebra of the basering 5598 RETURN: 1 (TRUE) (type <int>) if p is contained in the subalgebra 5599 0 (FALSE) (type <int>) if <poly> is not contained 5600 DISPLAY: a representation of p in terms of algebra generators A[1,i]=y(i) if p 5601 is contained in the subalgebra 5602 EXAMPLE: example algebra_containment; shows an example 5603 THEORY: The ideal of algebraic relations of the algebra generators f1,...,fm 5604 given by A is computed introducing new variables y(i) and the product 5605 order: x^a*y^b > y^d*y^e if x^a > x^d or else if y^b > y^e. p reduces 5606 to a polynomial only in the y(i) <=> p is contained in the subring 5607 generated by the polynomials in A. 5608 " 5609 { degBound=0; 5610 if (nrows(A)==1) 5611 { def br=basering; 5612 int n=nvars(br); 5613 int m=ncols(A); 5614 string mp=string(minpoly); 5615 execute "ring R=("+charstr(br)+"),(x(1..n),y(1..m)),(dp(n),dp(m));"; 5616 execute "minpoly=number("+mp+");"; 5617 ideal vars=x(1..n); 5618 map emb=br,vars; 5619 ideal A=ideal(emb(A)); 5620 ideal check=emb(p); 5621 for (int i=1;i<=m;i=i+1) 5622 { A[i]=A[i]-y(i); 5623 } 5624 A=std(A); 5625 check[1]=reduce(check[1],A); 5626 A=elim(check,1,n); 5627 if (A[1]<>0) 5628 { "\/\/ "+string(check); 5629 return(1); 5630 } 5631 else 5632 { return(0); 5633 } 5634 } 5635 else 5636 { "ERROR: <matrix> may only have one row"; 5637 return(); 5638 } 5639 } 5640 example 5641 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 5642 echo=2; 5643 ring R=0,(x,y,z),dp; 5644 matrix A[1][7]=x2+y2,z2,x4+y4,1,x2z-1y2z,xyz,x3y-1xy3; 5645 poly p1=x10z3-x8y2z3+2x6y4z3-2x4y6z3+x2y8z3-y10z3+x6z4+3x4y2z4+3x2y4z4+y6z4; 5646 algebra_containment(p1,A); 5647 poly p2=z; 5648 algebra_containment(p2,A); 5649 } 5650 5651 proc module_containment(poly p, matrix P, matrix S) 5652 "USAGE: module_containment(p,P,S); 5653 p: arbitrary <poly>, P: a 1xn <matrix> giving generators of an algebra, 5654 S: a 1xt <matrix> giving generators of a module over the algebra 5655 generated by P 5656 ASSUME: n is the number of variables in the basering and the generators in P 5657 are algebraically independent 5658 RETURNS: 1 (TRUE) (type <int>) if p is contained in the ring 5659 0 (FALSE) type <int>) if p is not contained 5660 DISPLAY: the representation of p in terms of algebra generators P[1,i]=z(i) and 5661 module generators S[1,j]=y(j) if p is contained in the module 5662 EXAMPLE: example module_containment; shows an example 5663 THEORY: The ideal of algebraic relations of all the generators p1,...,pn, 5664 s1,...,st given by P and S is computed introducing new variables y(j), 5665 z(i) and the product order: x^a*y^b*z^c > x^d*y^e*z^f if x^a > x^d 5666 with respect to the lp ordering or else if z^c > z^f with respect to 5667 the dp ordering or else if y^b > y^e with respect to the lp ordering 5668 again. p reduces to a polynomial only in the y(j) and z(i) linear in 5669 the z(i)) <=> p is contained in the module. 5670 " 5671 { def br=basering; 5672 degBound=0; 5673 int n=nvars(br); 5674 if (ncols(P)==n and nrows(P)==1 and nrows(S)==1) 5675 { int m=ncols(S); 5676 string mp=string(minpoly); 5677 execute "ring R=("+charstr(br)+"),(x(1..n),y(1..m),z(1..n)),(lp(n),dp(m),lp(n));"; 5678 execute "minpoly=number("+mp+");"; 5679 ideal vars=x(1..n); 5680 map emb=br,vars; 5681 matrix P=emb(P); 5682 matrix S=emb(S); 5683 ideal check=emb(p); 5684 ideal I; 5685 for (int i=1;i<=m;i=i+1) 5686 { I[i]=S[1,i]-y(i); 5687 } 5688 for (i=1;i<=n;i=i+1) 5689 { I[m+i]=P[1,i]-z(i); 5690 } 5691 I=std(I); 5692 check[1]=reduce(check[1],I); 5693 I=elim(check,1,n); // checking whether all variables from 5694 if (I[1]<>0) // the former ring have disappeared 5695 { "\/\/ "+string(check); 5696 return(1); 5697 } 5698 else 5699 { return(0); 5700 } 5701 } 5702 else 5703 { "ERROR: the first <matrix> must have the same number of columns as the"; 5704 " basering and both <matrices> may only have one row"; 5705 return(); 5706 } 5707 } 5708 example 5709 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 5710 echo=2; 5711 ring R=0,(x,y,z),dp; 5712 matrix P[1][3]=x2+y2,z2,x4+y4; 5713 matrix S[1][4]=1,x2z-1y2z,xyz,x3y-1xy3; 5714 poly p1=x10z3-x8y2z3+2x6y4z3-2x4y6z3+x2y8z3-y10z3+x6z4+3x4y2z4+3x2y4z4+y6z4; 5715 module_containment(p1,P,S); 5716 poly p2=z; 5717 module_containment(p2,P,S); 5718 } 5596 /////////////////////////////////////////////////////////////////////////////// 5719 5597 5720 5598 proc orbit_variety (matrix F,string newring) … … 5724 5602 RETURN: a Groebner basis (type <ideal>, named G) for the ideal defining the 5725 5603 orbit variety (i.e. the syzygy ideal) in the new ring (named `s`) 5726 EXAMPLE: example orbit_variety; shows an example5727 5604 THEORY: The ideal of algebraic relations of the invariant ring generators is 5728 5605 calculated, then the variables of the original ring are eliminated and 5729 5606 the polynomials that are left over define the orbit variety 5607 EXAMPLE: example orbit_variety; shows an example 5730 5608 " 5731 5609 { if (newring=="") … … 5765 5643 } 5766 5644 example 5767 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; 5768 echo=2; 5645 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2; 5769 5646 ring R=0,(x,y,z),dp; 5770 5647 matrix F[1][7]=x2+y2,z2,x4+y4,1,x2z-1y2z,xyz,x3y-1xy3; … … 5774 5651 basering; 5775 5652 } 5653 /////////////////////////////////////////////////////////////////////////////// 5776 5654 5777 5655 proc relative_orbit_variety(ideal I,matrix F,string newring) … … 5782 5660 RETURN: a Groebner basis (type <ideal>, named G) for the ideal defining the 5783 5661 relative orbit variety with respect to I in the new ring (named s) 5784 EXAMPLE: example relative_orbit_variety; shows an example5785 5662 THEORY: A Groebner basis of the ideal of algebraic relations of the invariant 5786 5663 ring generators is calculated, then one of the basis elements plus the 5787 ideal generators. The variables of the original ring are eliminated and5788 the polynomials that are left over define thecrelative orbit variety5664 ideal generators. The variables of the original ring are eliminated 5665 and the polynomials that are left define the relative orbit variety 5789 5666 with respect to I. 5667 EXAMPLE: example relative_orbit_variety; shows an example 5790 5668 " 5791 5669 { if (newring=="") … … 5845 5723 } 5846 5724 example 5847 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.6.3:"; 5848 echo=2; 5725 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.6.3:"; echo=2; 5849 5726 ring R=0,(x,y,z),dp; 5850 5727 matrix F[1][3]=x+y+z,xy+xz+yz,xyz; … … 5855 5732 basering; 5856 5733 } 5734 /////////////////////////////////////////////////////////////////////////////// 5857 5735 5858 5736 proc image_of_variety(ideal I,matrix F) … … 5862 5740 RETURN: the <ideal> defining the image under that group of the variety defined 5863 5741 by I 5864 EXAMPLE: example image_of_variety; shows an example5865 5742 THEORY: relative_orbit_variety(I,F,s) is called and the newly introduced 5866 5743 variables in the output are replaced by the generators of the 5867 5744 invariant ring. This ideal in the original variables defines the image 5868 5745 of the variety defined by I 5746 EXAMPLE: example image_of_variety; shows an example 5869 5747 " 5870 5748 { if (nrows(F)==1) … … 5888 5766 } 5889 5767 example 5890 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.6.8:"; 5891 echo=2; 5768 { "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.6.8:"; echo=2; 5892 5769 ring R=0,(x,y,z),dp; 5893 5770 matrix F[1][3]=x+y+z,xy+xz+yz,xyz; … … 5895 5772 print(image_of_variety(I,F)); 5896 5773 } 5774 /////////////////////////////////////////////////////////////////////////////// -
Singular/LIB/invar.lib
rb00a82 r68e678 1 // $Id: invar.lib,v 1.12 1999-07-19 10:32:46 obachman Exp $ 2 /////////////////////////////////////////////////////// 3 // invar.lib 4 // algorithm for computing the ring of invariants under 5 // the action of the additive group (C,+) 6 // written by Gerhard Pfister 7 ////////////////////////////////////////////////////// 8 9 version="$Id: invar.lib,v 1.12 1999-07-19 10:32:46 obachman Exp $"; 1 // $Id: invar.lib,v 1.13 1999-07-19 14:07:34 obachman Exp $ 2 ///////////////////////////////////////////////////////////////////////////// 3 4 version="$Id: invar.lib,v 1.13 1999-07-19 14:07:34 obachman Exp $"; 10 5 info=" 11 LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS 6 LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (K,+)-ACTIONS 7 AUTHORS: Gerhard Pfister, email: pfister@mathematik.uni-kl.de 8 Gert-Martin Greuel, email: greuel@mathematik.uni-kl.de 12 9 13 10 PROCEDURES: 14 invariantRing(m,p,q[,i]) computes invariants of (C,+)-action 15 actionIsProper(matrix m) check for proper action 11 invariantRing(m..); compute ring of invariants of (K,+)-action given by m 12 der(m,f); derivation of f with respect to the vectorfield m 13 actionIsProper(m); tests whether action defined by m is proper 14 reduction(p,I); SAGBI reduction of p in the subring generated by I 15 completeReduction(); complete SAGBI reduction 16 localInvar(m,p..); invariant polynomial under m computed from p,... 17 furtherInvar(m..); compute further inariants of m from the given ones 18 sortier(id); sorts generators of id by increasing leading terms 16 19 "; 17 18 ///////////////////////////////////////////////////////////////////////////////19 20 20 21 LIB "inout.lib"; 21 22 LIB "general.lib"; 22 23 /////////////////////////////////////////////////////////////////////////////// 24 25 26 proc sortier(ideal id) 23 LIB "algebra.lib"; 24 /////////////////////////////////////////////////////////////////////////////// 25 26 proc sortier(id) 27 "USAGE: sotier(id); id ideal/module 28 RETURN: the same ideal/module but with generators ordered by there 29 leading term, starting with the smallest 30 EXAMPLE: example sortier; shows an example 31 " 27 32 { 28 33 if(size(id)==0) 29 { 30 return(id); 34 {return(id); 31 35 } 32 36 intvec i=sortvec(id); 33 37 int j; 34 ideal m; 35 for (j=1;j<=size(i);j++) 38 if( typeof(id)=="ideal") 39 { ideal m; 40 } 41 if( typeof(id)=="module") 42 { module m; 43 } 44 if( typeof(id)!="ideal" and typeof(id)!="module") 45 { "// input must be of type ideal or module" 46 return(); 47 } 48 for (j=1;j<=size(i);j++) 36 49 { 37 50 m[j] = id[i[j]]; … … 43 56 ring q=0,(x,y,z,u,v,w),dp; 44 57 ideal i=w,x,z,y,v; 45 ideal j=sortier(i); 46 j; 47 } 48 49 50 /////////////////////////////////////////////////////////////////////////////// 51 52 53 proc der (matrix m, poly f) 54 "USAGE: der(m,f); m matrix, f poly 55 RETURN: poly= application of the vectorfield m defined by the matrix m 56 (m[i,1] are the coefficients of d/dx(i)) to f 57 NOTE: 58 sortier(i); 59 } 60 /////////////////////////////////////////////////////////////////////////////// 61 62 proc der (matrix m, id) 63 "USAGE: der(m,id); m matrix, id poly/vector/ideal 64 ASSUME: m is a nx1 matrix, where n = number of variables of the basering 65 RETURN: poly/vector/ideal (same type as input), result of applying the 66 vectorfield by the matrix m componentwise to id; 67 NOTE: the vectorfield is m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n) 58 68 EXAMPLE: example der; shows an example 59 69 " 60 { 61 matrix mh=matrix(jacob(f))*m; 62 return(mh[1,1]); 70 { 71 execute (typeof(id)+ " j;"); 72 ideal I = ideal(id); 73 matrix mh=matrix(jacob(I))*m; 74 if(typeof(j)=="poly") 75 { j = mh[1,1]; 76 } 77 else 78 { j = mh[1]; 79 } 80 return(j); 63 81 } 64 82 example … … 66 84 ring q=0,(x,y,z,u,v,w),dp; 67 85 poly f=2xz-y2; 68 matrix m[6][1]; 69 m[2,1]=x; 70 m[3,1]=y; 71 m[5,1]=u; 72 m[6,1]=v; 86 matrix m[6][1] =x,y,0,u,v; 73 87 der(m,f); 74 } 75 76 /////////////////////////////////////////////////////////////////////////////// 77 88 vector v = [2xz-y2,u6-3]; 89 der(m,v); 90 der(m,ideal(2xz-y2,u6-3)); 91 } 92 93 /////////////////////////////////////////////////////////////////////////////// 78 94 79 95 proc actionIsProper(matrix m) 80 96 "USAGE: actionIsProper(m); m matrix 81 RETURN: 1 if the action of the additive group defined by the matrix m is 82 proper. 83 0 if not proper. 97 ASSUME: m is a nx1 matrix, where n = number of variables of the basering 98 RETURN: int = 1, if the action defined by m is proper, 0 if not 99 NOTE: m defines a group action which is the exponential of the vector 100 field m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n) 84 101 EXAMPLE: example actionIsProper; shows an example 85 102 " … … 119 136 { "EXAMPLE:"; echo = 2; 120 137 121 ring rf=0, (x(1..7)),dp;138 ring rf=0,x(1..7),dp; 122 139 matrix m[7][1]; 123 140 m[4,1]=x(1)^3; … … 127 144 actionIsProper(m); 128 145 129 ring rd=0, (x(1..5)),dp;146 ring rd=0,x(1..5),dp; 130 147 matrix m[5][1]; 131 148 m[3,1]=x(1); … … 136 153 /////////////////////////////////////////////////////////////////////////////// 137 154 138 139 155 proc reduction(poly p, ideal dom, list #) 140 "USAGE: reduction(p,dom,q); p poly, dom ideal, q (optional) monomial 141 RETURN: poly= (p-H(f1,...,fr))/q^a, if Lt(p)=H(Lt(f1),...,Lt(fr)) for 142 some polynomial H in r variables over the base field, 143 a maximal such that q^a devides p-H(f1,...,fr), 144 dom =(f1,...,fr) 156 "USAGE: reduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int (optional)] 157 RETURN: a polynomial equal to p-H(f1,...,fr), in case the leading 158 term LT(p) of p is of the form H(LT(f1),...,LT(fr)) for some 159 polynomial H in r variables over the base field, I=f1,...,fr; 160 if q is given, a maximal power a is computed such that q^a devides 161 p-H(f1,...,fr), and then (p-H(f1,...,fr))/q^a is returned; 162 return p if no H is found 163 if n=1, a different algorithm is choosen which is sometimes faster 164 (default: n=0; q and n can be given (or not) in any order) 165 NOTE: this is a kind of SAGBI reduction in the subalgebra K[f1,...,fr] of 166 the basering 145 167 EXAMPLE: example reduction; shows an example 146 168 " 147 169 { 148 int i ;149 int z= size(dom);170 int i,choose; 171 int z=ncols(dom); 150 172 def bsr=basering; 151 152 //arranges the monomial v for elimination 153 poly v=var(1); 154 for (i=2;i<=nvars(basering);i=i+1) 155 { 156 v=v*var(i); 157 } 158 159 //changes the basering bsr to bsr[@(0),...,@(z)] 160 execute "ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;"; 161 162 //costructes the ideal dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z)) 163 ideal dom=imap(bsr,dom); 164 for (i=1;i<=z;i++) 165 { 166 dom[i]=lead(dom[i])-var(nvars(bsr)+i+1); 167 } 168 dom=lead(imap(bsr,p))-@(0),dom; 169 170 //eliminates the variables of the basering bsr 171 //i.e. computes dom intersected with K[@(0),...,@(z)] 172 ideal kern=eliminate(dom,imap(bsr,v)); 173 174 // test wether @(0)-h(@(1),...,@(z)) is in ker for some poly h 175 poly h; 176 z=size(kern); 177 for (i=1;i<=z;i++) 178 { 179 h=kern[i]/@(0); 180 if (deg(h)==0) 173 if( size(#) >0 ) 174 { if( typeof(#[1]) == "int") 175 { choose = #[1]; 176 } 177 if( typeof(#[1]) == "poly") 178 { poly q = #[1]; 179 } 180 if( size(#)>1 ) 181 { if( typeof(#[2]) == "poly") 182 { poly q = #[2]; 183 } 184 if( typeof(#[2]) == "int") 185 { choose = #[2]; 186 } 187 } 188 } 189 // -------------------- first algorithm (default) ----------------------- 190 if ( choose == 0 ) 191 { 192 list L = algebra_containment(lead(p),lead(dom),1); 193 if( L[1]==1 ) 181 194 { 182 h=(1/h)*kern[i]; 183 // defines the map psi : s ---> bsr defined by @(i) ---> p,dom[i] 184 setring bsr; 185 map psi=s,maxideal(1),p,dom; 186 poly re=psi(h); 187 188 // devides by the maximal power of #[1] 189 if (size(#)>0) 190 { 191 while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0)) 192 { 193 re=re/#[1]; 195 // the ring L[2] = char(bsr),(x(1..nvars(bsr)),y(1..z)),(dp(n),dp(m)), 196 // contains poly check s.t. LT(p) is of the form check(LT(f1),...,LT(fr)) 197 def s1 = L[2]; 198 map psi = s1,maxideal(1),dom; 199 poly re = p - psi(check); 200 // devide by the maximal power of #[1] 201 if ( defined(q) == voice ) 202 { while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0)) 203 { re=re/#[1]; 204 } 205 } 206 return(re); 207 } 208 return(p); 209 } 210 // ------------------------- second algorithm --------------------------- 211 else 212 { 213 //----------------- arranges the monomial v for elimination ------------- 214 poly v=product(maxideal(1)); 215 216 //------------- changes the basering bsr to bsr[@(0),...,@(z)] ---------- 217 execute "ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;"; 218 219 //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z)) 220 ideal dom=imap(bsr,dom); 221 for (i=1;i<=z;i++) 222 { 223 dom[i]=lead(dom[i])-var(nvars(bsr)+i+1); 224 } 225 dom=lead(imap(bsr,p))-@(0),dom; 226 227 //---------- eliminates the variables of the basering bsr -------------- 228 //i.e. computes dom intersected with K[@(0),...,@(z)] (this is hard) 229 //### hier Variante analog zu algebra_containment einbauen! 230 ideal kern=eliminate(dom,imap(bsr,v)); 231 232 //--------- test wether @(0)-h(@(1),...,@(z)) is in ker --------------- 233 // for some poly h and divide by maximal power of q=#[1] 234 poly h; 235 z=size(kern); 236 for (i=1;i<=z;i++) 237 { 238 h=kern[i]/@(0); 239 if (deg(h)==0) 240 { h=(1/h)*kern[i]; 241 // define the map psi : s ---> bsr defined by @(i) ---> p,dom[i] 242 setring bsr; 243 map psi=s,maxideal(1),p,dom; 244 poly re=psi(h); 245 // devide by the maximal power of #[1] 246 if (size(#)>0) 247 { while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0)) 248 { re=re/#[1]; 249 } 194 250 } 251 return(re); 195 252 } 196 197 return(re);198 253 } 199 }200 setring bsr;201 return(p);254 setring bsr; 255 return(p); 256 } 202 257 } 203 258 example … … 213 268 214 269 proc completeReduction(poly p, ideal dom, list #) 215 "USAGE: completeReduction(p,dom,q); p poly, dom ideal, 216 q (optional) monomial 217 RETURN: poly= the polynomial p reduced with dom via the procedure 218 reduction as long as possible 219 NOTE: 270 "USAGE: completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int] 271 RETURN: a polynomial, the SAGBI reduction of the polynomial p with I 272 via the procedure 'reduction' as long as possible 273 if n=1, a different algorithm is choosen which is sometimes faster 274 (default: n=0; q and n can be given (or not) in any order) 275 NOTE: help reduction; shows an explanation of SAGBI reduction 220 276 EXAMPLE: example completeReduction; shows an example 221 277 " … … 238 294 completeReduction(p,dom,w); 239 295 } 240 ///////////////////////////////////////////////////////////////////////////////241 242 proc inSubring(poly p, ideal dom)243 "USAGE: inSubring(p,dom); p poly, dom ideal244 RETURN: list= 1,string(@(0)-h(@(1),...,@(size(dom)))) :if p = h(dom[1],...,dom[size(dom)])245 0,string(h(@(0),...,@(size(dom)))) :if there is only a nonlinear relation246 h(p,dom[1],...,dom[size(dom)])=0.247 NOTE:248 EXAMPLE: example inSubring; shows an example249 "250 {251 int z=size(dom);252 int i;253 def gnir=basering;254 list l;255 poly mile=var(1);256 for (i=2;i<=nvars(basering);i++)257 {258 mile=mile*var(i);259 }260 string eli=string(mile);261 // the intersection of ideal nett=(p-@(0),dom[1]-@(1),...)262 // with the ring k[@(0),...,@(n)] is computed, the result is ker263 execute "ring r1="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;";264 ideal nett=imap(gnir,dom);265 poly p;266 for (i=1;i<=z;i++)267 {268 execute "p=@("+string(i)+");";269 nett[i]=nett[i]-p;270 }271 nett=imap(gnir,p)-@(0),nett;272 execute "ideal ker=eliminate(nett,"+eli+");";273 // test wether @(0)-h(@(1),...,@(z)) is in ker274 l[1]=0;275 l[2]="";276 for (i=1;i<=size(ker);i++)277 {278 if (deg(ker[i]/@(0))==0)279 {280 string str=string(ker[i]);281 setring gnir;282 l[1]=1;283 l[2]=str;284 return(l);285 }286 if (deg(ker[i]/@(0))>0)287 {288 l[2]=l[2]+string(ker[i]);289 }290 }291 setring gnir;292 return(l);293 }294 example295 { "EXAMPLE:"; echo = 2;296 ring q=0,(x,y,z,u,v,w),dp;297 poly p=xyzu2w-1yzu2w2+u4w2-1xu2vw+u2vw2+xyz-1yzw+2u2w-1xv+vw+2;298 ideal dom =x-w,u2w+1,yz-v;299 inSubring(p,dom);300 }301 296 302 297 /////////////////////////////////////////////////////////////////////////////// 303 298 304 299 proc localInvar(matrix m, poly p, poly q, poly h) 305 "USAGE: localInvar(m,p,q,h); m matrix, p,q,h poly 306 RETURN: poly= the invariant of the vectorfield m=Sum m[i,1]*d/dx(i) with respect 307 to p,q,h, i.e. 308 Sum (-1)^v*(1/v!)*m^v(p)*(q/m(q))^v)*m(q)^N, m^N(q)=0, m^(N-1)(q)<>0 309 it is assumed that m(q) and h are invariant 310 the sum above is divided by h as much as possible 311 NOTE: 300 "USAGE: localInvar(m,p,q,h); m matrix, p,q,h polynomials 301 ASSUME: m(q) and h are invariant under the vectorfield m, i.e. m(m(q))=m(h)=0 302 h must be a ring variable 303 RETURN: a polynomial, the invariant polynomial of the vectorfield 304 m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n) 305 with respect to p,q,h. It is defined as follows: set inv = p if p is 306 invariant, and else as 307 inv = m(q)^N * sum_i=1..N-1{ (-1)^i*(1/i!)*m^i(p)*(q/m(q))^i } 308 where m^N(p) = 0, m^(N-1)(p) != 0; 309 the result is inv divided by h as much as possible 312 310 EXAMPLE: example localInvar; shows an example 313 311 " … … 315 313 if ((der(m,h) !=0) || (der(m,der(m,q)) !=0)) 316 314 { 317 " the last variable defines not an invariant function";315 "//the last two polynomials of the input must be invariant functions"; 318 316 return(q); 319 317 } 318 int ii,k; 319 for ( k=1; k <= nvars(basering); k++ ) 320 { if (h == var(k)) 321 { ii=1; 322 } 323 } 324 if( ii==0 ) 325 { "// the last argument must be a ring variable"; 326 return(q); 327 } 328 320 329 poly inv=p; 321 330 poly dif= der(m,inv); … … 323 332 poly sgn=-1; 324 333 poly coeff=sgn*q; 325 intk=1;334 k=1; 326 335 if (dif==0) 327 336 { … … 352 361 /////////////////////////////////////////////////////////////////////////////// 353 362 354 355 356 proc furtherInvar(matrix m, ideal id, ideal karl, poly q) 357 "USAGE: furtherInvar(m,id,karl,q); m matrix, id,karl ideal,q poly 358 RETURN: ideal= further invariants of the vectorfield m=Sum m[i,1]*d/dx(i) with respect359 to id,p,q, i.e.360 the ideal id contains invariants of m and we are looking for elements361 in the subring generated by id which are divisible by q362 it is assumed that m(p) and q are invariant363 the elements mentioned above are computed and divided by q364 as much as possible365 the ideal karl contains all invariants computed yet363 proc furtherInvar(matrix m, ideal id, ideal karl, poly q, list #) 364 "USAGE: furtherInvar(m,id,karl,q); m matrix, id,karl ideals, q poly, n int 365 ASSUME: karl,id,q are invariant under the vectorfield m, 366 moreover, q must be a variable 367 RETURN: list of two ideals, the first ideal contains further invariants of 368 the vectorfield 369 m = sum m[i,1]*d/dx(i) with respect to id,p,q, 370 i.e. we compute elements in the (invariant) subring generated by id 371 which are divisible by q and divde them by q as much as possible 372 the second ideal contains all invariants given before 373 if n=1, a different algorithm is choosen which is sometimes faster 374 (default: n=0) 366 375 EXAMPLE: example furtherInvar; shows an example 367 376 " 368 377 { 378 list ll = q; 379 if ( size(#)>0 ) 380 { ll = ll+list(#[1]); 381 } 369 382 int i; 370 383 ideal null; 371 int z= size(id);384 int z=ncols(id); 372 385 intvec v; 373 def @r=basering;386 def br=basering; 374 387 ideal su; 375 for (i=1;i<=z;i++) 376 { 377 su[i]=subst(id[i],q,0); 378 } 379 // defines the map phi : r1 ---> @r defined by 380 // y(i) ---> id[i](q=0) 381 execute "ring r1="+charstr(basering)+",(y(1..z)),dp"; 382 setring @r; 388 for (i=1; i<=z; i++) 389 { 390 su[i]=subst(id[i],q,0); 391 } 392 // -- define the map phi : r1 ---> br defined by y(i) ---> id[i](q=0) -- 393 execute ("ring r1="+charstr(basering)+",(y(1..z)),dp;"); 394 setring br; 383 395 map phi=r1,su; 384 396 setring r1; 385 // computes the kernel of phi386 execute "ideal ker=preimage(@r,phi,null)";387 // defines the map psi : r1 ---> @r defined by y(i) ---> id[i]388 setring @r;397 // --------------- compute the kernel of phi --------------------------- 398 ideal ker=preimage(br,phi,null); 399 // ---- define the map psi : r1 ---> br defined by y(i) ---> id[i] ----- 400 setring br; 389 401 map psi=r1,id; 390 // computes psi(ker(phi))402 // ------------------- compute psi(ker(phi)) -------------------------- 391 403 ideal rel=psi(ker); 392 // devides by the maximal power of q 393 // and tests wether we really obtain invariants 404 // devide by maximal power of q, test wether we really obtain invariants 394 405 for (i=1;i<=size(rel);i++) 395 406 { … … 399 410 if (der(m,rel[i])!=0) 400 411 { 401 " error in furtherInvar, function not invariant";412 "// error in furtherInvar, function not invariant:"; 402 413 rel[i]; 403 414 } … … 405 416 rel[i]=simplify(rel[i],1); 406 417 } 407 // test whether some variables occur linearly 408 // and deletes the corresponding invariant function 418 // --------------------------------------------------------------------- 419 // test whether some variables occur linearly and then delete the 420 // corresponding invariant function 409 421 setring r1; 410 422 int j; … … 415 427 if (deg(ker[i]/y(j))==0) 416 428 { 417 setring @r;418 rel[i]= completeReduction(rel[i],karl, q);429 setring br; 430 rel[i]= completeReduction(rel[i],karl,ll); 419 431 if(rel[i]!=0) 420 432 { … … 427 439 428 440 } 429 setring @r;441 setring br; 430 442 list l=rel+null,karl; 431 443 return(l); … … 445 457 /////////////////////////////////////////////////////////////////////////////// 446 458 447 448 449 proc invariantRing(matrix m, poly p, poly q,list #) 450 "USAGE: invariantRing(m,p,q[,choose]); m matrix; p,q poly; choose integer 451 RETURN: ideal which holds invariants of the action of the additive group 452 defined by the vectorfield corresponding to the matrix m 453 (m[i,1] are the coefficients of d/dx(i)). 454 The polys p and q are assumed to be variables x(i) and x(j) 455 such that m[j,1]=0 and m[i,1]=x(j) 456 If choose=0 the computation stops if generators of the ring 457 of invariants are computed (to be used only if you know that 458 the ring of invariants is finitey generated). 459 If choose<>0 it computes invariants up to degree choosen. 460 461 EXAMPLE: example furtherInvar; shows an example 459 proc invariantRing(matrix m, poly p, poly q, int b, list #) 460 "USAGE: invariantRing(m,p,q,b[,r,pa]); m matrix, p,q poly, b,r int, pa string 461 ASSUME: p,q variables with m(p)=q and q invariant under m 462 i.e. if p=x(i) and q=x(j) then m[j,1]=0 and m[i,1]=x(j) 463 RETURN: ideal, containing generators of the ring of invariants of the 464 additive gropup (K,+) given by the vectorfield 465 m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n). 466 If b>0 the computation stops after all invariants of degree <= b 467 (and at least one of higher degree) are found or when all invariants 468 are computed. 469 If b<=0, the computation continues until all generators 470 of the ring of invariants are computed (should be used only if the 471 ring of invariants is known to be finitey generated otherwise the 472 algorithm might not stop). 473 If r=1 a different reduction is used which is sometimes faster 474 (default r=0). 475 DISPLAY: if pa is given (any string as 5th or 6th argument), the computation 476 pauses whenever new invariants are found and displays them 477 THEORY: The algoritm to compute the ring of invariants works in char 0 478 or big enough characteristic. (K,+) acts as the exponential of the 479 vectorfield defined by the matrix m. For background see G.-M. Greuel, 480 G. Pfister, Geometric quotients of unipotent group actions, Proc. 481 London Math. Soc. ??,???,1993? 482 EXAMPLE: example invariantRing; shows an example 462 483 " 463 484 { 464 485 ideal j; 465 486 int i,it; 466 int bou=-1; 467 if(size(#)>0) 468 { 469 bou=#[1]; 487 list ll=q; 488 int bou=b; 489 if( size(#) >0 ) 490 { if( typeof(#[1]) == "int") 491 { ll=ll+list(#[1]); 492 } 493 if( typeof(#[1]) == "string") 494 { string pau=#[1]; 495 } 496 if( size(#)>1 ) 497 { if( typeof(#[2]) == "string") 498 { string pau=#[2]; 499 } 500 if( typeof(#[2]) == "int") 501 { ll=ll+list(#[2]); 502 } 503 } 470 504 } 471 505 int z; … … 473 507 ideal k1=1; 474 508 list k2; 475 // computation of local invariants509 //------------------ computation of local invariants ------------------ 476 510 for (i=1;i<=nvars(basering);i++) 477 511 { 478 512 karl=karl+localInvar(m,var(i),p,q); 479 513 } 480 if(bou==0) 481 { 482 " "; 483 "the local invariants:"; 484 " "; 514 if( defined(pau) == voice) 515 { ""; 516 "// local invariants computed:"; 517 ""; 485 518 karl; 486 " "; 487 } 488 // computation of further invariants 519 ""; 520 "// hit return key to continue!"; 521 pause; 522 " "; 523 } 524 //------------------ computation of further invariants ---------------- 489 525 it=0; 490 526 while (size(k1)!=0) 491 {527 { 492 528 // test if the new invariants are already in the ring generated 493 // by the invariants we constructed already529 // by the invariants we constructed so far 494 530 it++; 495 531 karl=sortier(karl); … … 497 533 for (i=1;i<=size(karl);i++) 498 534 { 499 j=j + simplify(completeReduction(karl[i],j,q),1);535 j=j + simplify(completeReduction(karl[i],j,ll),1); 500 536 } 501 537 karl=j; … … 509 545 for (i=1;i<=z;i++) 510 546 { 511 k1[i]= completeReduction(k1[i],karl, q);547 k1[i]= completeReduction(k1[i],karl,ll); 512 548 if (k1[i]!=0) 513 549 { … … 515 551 } 516 552 } 517 if(bou==0) 553 if( defined(pau) == voice) 554 { 555 "// the invariants after",it,"iteration(s):"; ""; 556 karl;""; 557 "// hit return key to continue!"; 558 pause; 559 ""; 560 } 561 if( (bou>0) && (size(k1)>0) ) 518 562 { 519 " "; 520 "the invariants after the iteration"; 521 it; 522 " "; 523 karl; 524 " "; 525 } 526 if((bou>0) && (size(k1)>0)) 527 { 528 if(deg(k1[size(k1)])>bou) 563 if( deg(k1[size(k1)])>bou ) 529 564 { 530 565 return(karl); … … 537 572 { "EXAMPLE:"; echo = 2; 538 573 539 //Winkelmann: free action but Spec k[x(1),...,x(5)]---> Spec In-540 // variantringis not surjective574 //Winkelmann: free action but Spec(k[x(1),..,x(5)])-->Spec(invariant ring) 575 //is not surjective 541 576 542 577 ring rw=0,(x(1..5)),dp; … … 545 580 m[4,1]=x(2); 546 581 m[5,1]=1+x(1)*x(4)+x(2)*x(3); 547 ideal in=invariantRing(m,x(3),x(1),0); 582 ideal in=invariantRing(m,x(3),x(1),0); //compute full invarint ring 548 583 in; 549 584 … … 556 591 m[6,1]=x(3)^3; 557 592 m[7,1]=(x(1)*x(2)*x(3))^2; 558 ideal in=invariantRing(m,x(4),x(1),6); 593 ideal in=invariantRing(m,x(4),x(1),6); //all invariants up to degree 6 559 594 in; 560 561 562 //Deveney/Finston:Proper Ga-action which is not locally trivial 595 } 596 597 /////////////////////////////////////////////////////////////////////////////// 598 /* Further examplex 599 600 //Deveney/Finston: Proper Ga-action which is not locally trivial 563 601 //r[x(1),...,x(5)] is not flat over the ring of invariants 564 602 LIB "invar.lib"; 565 603 ring rd=0,(x(1..5)),dp; 566 604 matrix m[5][1]; … … 568 606 m[4,1]=x(2); 569 607 m[5,1]=1+x(1)*x(4)^2; 570 ideal in=invariantRing(m,x(3),x(1) );608 ideal in=invariantRing(m,x(3),x(1),0,1); 571 609 in; 572 610 573 611 actionIsProper(m); 574 612 575 //compute s therelations between the invariants613 //compute the algebraic relations between the invariants 576 614 int z=size(in); 577 615 ideal null; … … 617 655 poly disc=9*det(m)/(x(1)^2*y(1)^4); 618 656 657 LIB "invar.lib"; 619 658 matrix n[6][1]; 620 659 n[2,1]=x(1); … … 624 663 der(n,disc); 625 664 626 //constructive approach to Weizenbcks theorem 627 628 kill n; 665 //x(1)^3*y(2)^6-6*x(1)^2*y(1)*y(2)^3*z+6*x(1)^2*y(2)^4+9*x(1)*y(1)^2*z^2-18*x(1)*y(1)*y(2)*z+9*x(1)*y(2)^2+4 666 667 ////////////////////////////////////////////////////////////////////////////// 668 //constructive approach to Weizenboecks theorem 669 629 670 int n=5; 630 631 ring w= 0,(x(1..n)),wp(1..n);671 // int n=6; //limit 672 ring w=32003,(x(1..n)),wp(1..n); 632 673 633 674 // definition of the vectorfield m=sum m[i]*d/dx(i) … … 638 679 m[i+1,1]=x(i); 639 680 } 640 ideal in=invariantRing(m,x(2),x(1),0 );681 ideal in=invariantRing(m,x(2),x(1),0,""); 641 682 in; 642 643 } 683 */
Note: See TracChangeset
for help on using the changeset viewer.