Changeset 8307d2d in git
- Timestamp:
- Aug 12, 2019, 11:35:29 AM (4 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- d9e5b0a9e2ca74ac8fcf60a83f008cc393d9278d
- Parents:
- 7161acac8387482214ebcdd85e77266519f0cad2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpaprops.lib
r7161aca r8307d2d 26 26 lpIsSemiPrime(<GB>); check whether A/<LM(GB)> is semi-prime 27 27 lpIsPrime(<GB>); check whether A/<LM(GB)> is prime 28 lpGkDim(<GB>); compute the Gelfand Kirillov dimension of A/<GB>29 28 lpGlDimBound(<GB>); compute an upper bound for the global dimension of A/<GB> 30 29 lpSubstitute(); substitute a variable with polynomials (ring homomorphism) … … 43 42 example lpIsSemiPrime; 44 43 example lpIsPrime; 45 example lpGkDim;46 44 example lpGlDimBound; 47 45 example lpSubstitute; … … 877 875 } 878 876 879 proc lpGkDim_lib(ideal G) 880 "USAGE: lpGkDim(G); G an ideal in a letterplace ring 881 RETURN: int 882 PURPOSE: Determines the Gelfand Kirillov dimension of A/<G> 883 -1 means positive infinite 884 ASSUME: - basering is a Letterplace ring 885 - G is a Groebner basis 886 " 887 { 888 G = lead(G); 889 G = simplify(G, 2+4+8); 890 891 // check special case 1 892 int l = 0; 893 for (int i = 1; i <= size(G); i++) { 894 // find the max degree in G 895 int d = deg(G[i]); 896 if (d > l) { 897 l = d; 898 } 899 900 // also if G is the whole ring return minus infinity 901 if (leadmonom(G[i]) == 1) { 902 ERROR("GK-Dim not defined for 0-ring") 903 } 904 kill d; 905 } kill i; 906 // if longest word has length 1, or G is the zero ideal, we handle it as a special case 907 if (l == 1 || size(G) == 0) { 908 int n = lpVarBlockSize(basering); // variable count 909 int k = size(G); 910 if (k == n) { // V = {1} no edges 911 return(0); 912 } 913 if (k == n-1) { // V = {1} with loop 914 return(1); 915 } 916 if (k <= n-2) { // V = {1} with more than one loop 917 return(-1); 918 } 919 } 920 921 dbprint("computing Ufnarovskii graph"); 922 intmat UG = lpUfGraph(G); 923 if (printlevel >= voice + 1) { 924 UG; 925 } 926 927 // check special case 2 928 intmat zero[nrows(UG)][ncols(UG)]; 929 if (UG == zero) { 930 return (0); 931 } 932 933 // check special case 3 934 dbprint("topological sorting of Ufnarovskii graph"); 935 UG = topologicalSort(UG); 936 if (printlevel >= voice + 1) { 937 UG; 938 } 939 940 dbprint("check if Ufnarovskii graph is DAG"); 941 if (imIsUpRightTriangle(UG)) { 942 UG = eliminateZerosUpTriangle(UG); 943 if (ncols(UG) == 0 || nrows(UG) == 0) { // when the diagonal was zero 944 return (0) 945 } 946 dbprint("DAG detected, using URTNZD growth alg"); 947 return(UfGraphURTNZDGrowth(UG)); 948 } 949 950 // otherwise count cycles in the Ufnarovskij Graph 951 dbprint("not a DAG, using regular growth alg"); 952 return(UfGraphGrowth(UG)); 953 } 954 example 955 { 956 "EXAMPLE:"; echo = 2; 957 ring r = 0,(x,y,z),dp; 958 def R = freeAlgebra(r, 5); // constructs a Letterplace ring 959 R; 960 setring R; // sets basering to Letterplace ring 961 ideal I = z;//an example of infinite GK dimension 962 lpGkDim(I); 963 I = x,y,z; // gkDim = 0 964 lpGkDim(I); 965 I = x*y, x*z, z*y, z*z;//gkDim = 2 966 lpGkDim(I); 967 ideal G = y*x - x*y, z*x - x*z, z*y - y*z; G = std(G); 968 G; 969 lpGkDim(G); // 3, as expected for K[x,y,z] 970 } 877 // lpGkDim now implemented in dynamic module 878 /* proc lpGkDim(ideal G) */ 879 /* "USAGE: lpGkDim(G); G an ideal in a letterplace ring */ 880 /* RETURN: int */ 881 /* PURPOSE: Determines the Gelfand Kirillov dimension of A/<G> */ 882 /* -1 means positive infinite */ 883 /* ASSUME: - basering is a Letterplace ring */ 884 /* - G is a Groebner basis */ 885 /* " */ 886 /* { */ 887 /* G = lead(G); */ 888 /* G = simplify(G, 2+4+8); */ 889 890 /* // check special case 1 */ 891 /* int l = 0; */ 892 /* for (int i = 1; i <= size(G); i++) { */ 893 /* // find the max degree in G */ 894 /* int d = deg(G[i]); */ 895 /* if (d > l) { */ 896 /* l = d; */ 897 /* } */ 898 899 /* // also if G is the whole ring return minus infinity */ 900 /* if (leadmonom(G[i]) == 1) { */ 901 /* ERROR("GK-Dim not defined for 0-ring") */ 902 /* } */ 903 /* kill d; */ 904 /* } kill i; */ 905 /* // if longest word has length 1, or G is the zero ideal, we handle it as a special case */ 906 /* if (l == 1 || size(G) == 0) { */ 907 /* int n = lpVarBlockSize(basering); // variable count */ 908 /* int k = size(G); */ 909 /* if (k == n) { // V = {1} no edges */ 910 /* return(0); */ 911 /* } */ 912 /* if (k == n-1) { // V = {1} with loop */ 913 /* return(1); */ 914 /* } */ 915 /* if (k <= n-2) { // V = {1} with more than one loop */ 916 /* return(-1); */ 917 /* } */ 918 /* } */ 919 920 /* dbprint("computing Ufnarovskii graph"); */ 921 /* intmat UG = lpUfGraph(G); */ 922 /* if (printlevel >= voice + 1) { */ 923 /* UG; */ 924 /* } */ 925 926 /* // check special case 2 */ 927 /* intmat zero[nrows(UG)][ncols(UG)]; */ 928 /* if (UG == zero) { */ 929 /* return (0); */ 930 /* } */ 931 932 /* // check special case 3 */ 933 /* dbprint("topological sorting of Ufnarovskii graph"); */ 934 /* UG = topologicalSort(UG); */ 935 /* if (printlevel >= voice + 1) { */ 936 /* UG; */ 937 /* } */ 938 939 /* dbprint("check if Ufnarovskii graph is DAG"); */ 940 /* if (imIsUpRightTriangle(UG)) { */ 941 /* UG = eliminateZerosUpTriangle(UG); */ 942 /* if (ncols(UG) == 0 || nrows(UG) == 0) { // when the diagonal was zero */ 943 /* return (0) */ 944 /* } */ 945 /* dbprint("DAG detected, using URTNZD growth alg"); */ 946 /* return(UfGraphURTNZDGrowth(UG)); */ 947 /* } */ 948 949 /* // otherwise count cycles in the Ufnarovskij Graph */ 950 /* dbprint("not a DAG, using regular growth alg"); */ 951 /* return(UfGraphGrowth(UG)); */ 952 /* } */ 953 /* example */ 954 /* { */ 955 /* "EXAMPLE:"; echo = 2; */ 956 /* ring r = 0,(x,y,z),dp; */ 957 /* def R = freeAlgebra(r, 5); // constructs a Letterplace ring */ 958 /* R; */ 959 /* setring R; // sets basering to Letterplace ring */ 960 /* ideal I = z;//an example of infinite GK dimension */ 961 /* lpGkDim(I); */ 962 /* I = x,y,z; // gkDim = 0 */ 963 /* lpGkDim(I); */ 964 /* I = x*y, x*z, z*y, z*z;//gkDim = 2 */ 965 /* lpGkDim(I); */ 966 /* ideal G = y*x - x*y, z*x - x*z, z*y - y*z; G = std(G); */ 967 /* G; */ 968 /* lpGkDim(G); // 3, as expected for K[x,y,z] */ 969 /* } */ 971 970 972 971 proc lpGlDimBound(ideal G)
Note: See TracChangeset
for help on using the changeset viewer.