Changeset f2ed2d in git
- Timestamp:
- Apr 9, 2010, 11:22:04 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- a0f5849764a78dfc4f5394cbc998a82eefdd6644
- Parents:
- 7d9253b1d9528cb0ec8435d0e009b4bc3b24d9ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/nctools.lib
r7d9253 rf2ed2d 22 22 Exterior(); return qring, the exterior algebra of a basering, 23 23 findimAlgebra(M,[r]); create finite dimensional algebra structure from the basering and the multiplication matrix M, 24 superCommutative([b,e,Q]); return qring, thesuper-commutative algebra over a basering,24 superCommutative([b,e,Q]); return qring, a super-commutative algebra over a basering, 25 25 rightStd(I); compute a right Groebner basis of an ideal, 26 26 … … 733 733 /////////////////////////////////////////////////////////////////////////////// 734 734 proc superCommutative(list #) 735 "USAGE: superCommutative([b,[e, [Q , [flag]]]]);735 "USAGE: superCommutative([b,[e, [Q]]]); 736 736 RETURN: qring 737 737 PURPOSE: create a super-commutative algebra (as a GR-algebra) over a basering, 738 738 NOTE: activate this qring with the \"setring\" command. 739 NOTE: if b==e then the resulting ring is commutative unless 'flag' is given and non-zero. 740 @* By default, @code{b=1, e=nvars(basering), Q=0}, and @code{flag=0}. 741 THEORY: given a basering, this procedure introduces the anticommutative relations x(j)x(i)=-x(i)x(j) for all e>=j>i>=b, 742 @* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2[ + Q] 739 NOTE: if b==e then the resulting ring is commutative. 740 @* By default, @code{b=1, e=nvars(basering), Q=0}. 741 THEORY: given a basering, this procedure introduces the anti-commutative relations 742 @* var(j)var(i)=-var(i)var(j) for all e>=j>i>=b and creates the quotient 743 @* of the anti-commutative algebra modulo the two-sided ideal, generated by 744 @* x(b)^2, ..., x(e)^2[ + Q] 743 745 DISPLAY: If @code{printlevel} > 1, warning debug messages will be printed 744 746 EXAMPLE: example superCommutative; shows examples … … 813 815 } 814 816 815 if(size(#)>3)817 /* if(size(#)>3) 816 818 { 817 819 if(typeof(#[4]) != "int") … … 822 824 flag = #[4]; 823 825 } 826 */ 824 827 825 828 int iSavedDegBoung = degBound; … … 848 851 setring @R; // @R; 849 852 */ 853 int i, j; 850 854 851 855 if( (char(basering)==2) && (flag == 0) )// commutative ring!!! … … 856 860 } 857 861 858 i nt j = ncols(Q) + 1;859 860 for ( int i=e; i>=b; i--, j++)861 { 862 Q[j] = var(i)^2;862 ideal I; 863 864 for (i = e - b + 1; i > 0; i--) 865 { 866 I[i] = var(i + b - 1)^2; 863 867 } 864 868 865 869 degBound=0; 866 Q = std( Q);870 Q = std(I + Q); 867 871 degBound = iSavedDegBoung; 868 872 … … 872 876 873 877 874 int i, j;875 878 876 879 if( (b == 1) && (e == N) ) // just an exterior algebra? … … 893 896 } 894 897 895 ideal @Q = fetch(saveRing, Q); 896 897 j = ncols(@Q) + 1; 898 899 for ( i=e; i>=b; i--, j++ ) 900 { 901 @Q[j] = var(i)^2; 902 } 903 904 if( (fprot == 1) and (attrib(basering, "global") != 1) ) 905 { 906 print("Warning: Since the current ordering is not global there might be problems computing twostd(Q)!"); 907 "Q:"; 908 @Q; 909 } 898 ideal @I; 899 900 for (i = e - b + 1; i > 0; i--) 901 { 902 @I[i] = var(i + b - 1)^2; 903 } 904 910 905 911 906 degBound=0; 912 @ Q = twostd(@Q); // must be computed within the ground G-algebra => problems with local orderings!907 @I = twostd(@I); // must be computed within the ground G-algebra => problems with local orderings! 913 908 degBound = iSavedDegBoung; 914 909 915 qring @EA = @Q; 910 qring @EA = @I; 911 912 ideal @Q = twostd(fetch(saveRing, Q)); 913 914 if( size(@Q) > 0 ) 915 { 916 qring @EA2 = @Q; 917 } 918 919 attrib(basering, "isSCA", 1==1); 920 attrib(basering, "iAltVarStart", b); 921 attrib(basering, "iAltVarEnd", e); 916 922 917 923 // "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 918 return( @EA);924 return(basering); 919 925 } 920 926 example … … 931 937 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 932 938 kill R; kill ER; 933 ring R = 0,(x (1..6)),(ls(2), dp(2), lp(2)); // local!934 def ER = superCommutative( 3,4); // b = 3, e = 4939 ring R = 0,(x, y, z),(ds(1), dp(2)); // mixed! 940 def ER = superCommutative(2,3); // b = 2, e = 3 935 941 setring ER; ER; 936 942 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 943 x + 1 + z + y; // ordering on variables: y > z > 1 > x 944 std(x - x*x*x); 945 std(ideal(x - x*x*x, x*x*z + y, z + y*x*x)); 937 946 kill R; kill ER; 947 ring R = 0,(x, y, z),(ds(1), dp(2)); // mixed! 948 def ER = superCommutative(2, 3, ideal(x - x*x, x*x*z + y, z + y*x*x )); // b = 2, e = 3 949 setring ER; ER; 950 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 938 951 } 939 952 940 953 // Please, don't throw this away!!! Needed for backward compatibility. 941 954 proc SuperCommutative(list #) 942 { 943 // "Please use superCommutative instead"; 955 "USAGE: please use @code{superCommutative} instead 956 " 957 { 958 "// This procedure is deprecated. Please use superCommutative instead"; 944 959 return( superCommutative(#) ); 945 960 } 946 961 example 962 { 963 "EXAMPLE:"; 964 "Procedure is deprecated. Please use superCommutative instead"; 965 } 947 966 948 967 static proc ParseSCA() … … 952 971 " 953 972 { 973 if(typeof(attrib(basering, "isSCA"))=="int") // workaround, if(defined()) doesn't work!!!! 974 { 975 if(typeof(attrib(basering, "iAltVarStart"))=="int") 976 { 977 if(typeof(attrib(basering, "iAltVarEnd"))=="int") 978 { 979 if(attrib(basering, "isSCA")) 980 { 981 return(list( 982 attrib(basering, "iAltVarStart"), 983 attrib(basering, "iAltVarEnd") 984 )); 985 } 986 } 987 } 988 } 989 954 990 def saveRing = basering; 955 991 … … 960 996 int e = -1; 961 997 962 int fprot = (find(option(),"prot") != 0);998 int fprot = 0; // (find(option(),"prot") != 0); 963 999 964 1000 … … 974 1010 if(fprot) 975 1011 { 976 print(" Warning: The current ring is internally commutative!");1012 print("// Warning: The current ring is internally commutative!"); 977 1013 } 978 1014 … … 983 1019 if( (fprot == 1) and (i > 1) ) 984 1020 { 985 print(" Warning: the SCA representation of the current commutative factor ring may be ambiguous!");1021 print("// Warning: the SCA representation of the current commutative factor ring may be ambiguous!"); 986 1022 } 987 1023 … … 1084 1120 1085 1121 //////////////////////////////////////////////////////////////////////// 1086 // ok. itis a SCA!!!1122 // ok. this is a SCA!!! 1087 1123 1088 1124 return(list(b, e)); … … 1094 1130 RETURN: int 1095 1131 PURPOSE: returns the number of the first alternating variable of basering 1096 NOTE: basering should be a super-commutative algebra with at most one block of anti-commutative variables1097 @* For commutative rings, @code{nvars(basering)+1} will be returned.1132 NOTE: basering should be a super-commutative algebra constructed by 1133 @* the procedure @code{superCommutative}, emits an error otherwise 1098 1134 EXAMPLE: example AltVarStart; shows examples 1099 1135 " … … 1116 1152 setring ER; ER; 1117 1153 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1154 setring R; 1155 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1156 kill R, ER; 1157 ////////////////////////////////////////////////////////////////// 1158 ring R = 2,(x(1..4)),dp; // the same in char. = 2! 1159 def ER = superCommutative(2); // (b = 2, e = N) 1160 setring ER; ER; 1161 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1162 setring R; 1163 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1118 1164 } 1119 1165 … … 1123 1169 RETURN: int 1124 1170 PURPOSE: returns the number of the last alternating variable of basering 1125 NOTE: basering should be a super-commutative algebra with at most one block of anti-commutative variables1126 @* returns -1 for commutative rings1171 NOTE: basering should be a super-commutative algebra constructed by 1172 @* the procedure @code{superCommutative}, emits an error otherwise 1127 1173 EXAMPLE: example AltVarEnd; shows examples 1128 1174 " … … 1145 1191 setring ER; ER; 1146 1192 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1193 setring R; 1194 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1195 kill R, ER; 1196 ////////////////////////////////////////////////////////////////// 1197 ring R = 2,(x(1..4)),dp; // the same in char. = 2! 1198 def ER = superCommutative(2); // (b = 2, e = N) 1199 setring ER; ER; 1200 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1201 setring R; 1202 "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 1147 1203 } 1148 1204 … … 1151 1207 "USAGE: IsSCA(); 1152 1208 RETURN: int 1153 PURPOSE: returns 1 if basering is a super-commutative algebra and 0 otherwise. 1154 NOTE: shows hint message for non-SCA algebras if the 'prot' option is on. 1209 PURPOSE: returns 1 if basering is a super-commutative algebra and 0 otherwise 1155 1210 EXAMPLE: example IsSCA; shows examples 1156 1211 "
Note: See TracChangeset
for help on using the changeset viewer.