Changeset 1625c1 in git
- Timestamp:
- Jul 19, 2007, 7:18:30 PM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 3eadab96fecbb57aa75151e22b15ce9249b408b6
- Parents:
- 5b4439ab0ec54203e3aae4c8eb6af146fe1b11d5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/nctools.lib
r5b4439 r1625c1 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: nctools.lib,v 1.2 7 2007-07-13 14:05:14motsak Exp $";2 version="$Id: nctools.lib,v 1.28 2007-07-19 17:18:30 motsak Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 723 723 PURPOSE: create the super-commutative algebra (as a GR-algebra) 'over' a basering, 724 724 NOTE: activate this qring with the \"setring\" command. 725 NOTE: as a side effect the basering will be changed to bo the basis G-algebra (without factor). 725 NOTE: as a side effect the basering will be changed (if not in a commutative case) to bo the ground G-algebra (without factor). 726 NOTE: if b==e then the resulting ring is commutative. 726 727 THEORY: given a basering, this procedure introduces the anticommutative relations x(j)x(i)=-x(i)x(j) for all e>=j>i>=b, 727 728 @* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2[ + Q] … … 729 730 " 730 731 { 732 int fprot = (find(option(),"prot") != 0); 733 731 734 string rname=nameof(basering); 735 732 736 if ( rname == "basering") // i.e. no ring has been set yet 733 737 { … … 735 739 return(); 736 740 } 737 int N = nvars(basering); 738 741 742 def saveRing = basering; 743 744 int N = nvars(saveRing); 739 745 int b = 1; 740 746 int e = N; 741 747 742 def saveRing = basering;743 748 ideal Q = 0; 744 749 … … 749 754 ERROR("First argument 'b' must be an integer!"); 750 755 return(); 751 } 756 } 752 757 b = #[1]; 758 759 if((b < 1)||(b > N)) 760 { 761 ERROR("First argument 'b' must within [1..nvars(basering)]!"); 762 return(); 763 } 764 753 765 } 754 766 … … 757 769 if(typeof(#[2]) != "int") 758 770 { 759 ERROR(" Lastargument 'e' must be an integer!");771 ERROR("Second argument 'e' must be an integer!"); 760 772 return(); 761 773 } 762 774 e = #[2]; 775 776 if((e < 1)||(e > N)) 777 { 778 ERROR("Second argument 'e' must within [1..nvars(basering)]!"); 779 return(); 780 } 781 782 if(e < b) 783 { 784 ERROR("Second argument 'e' must be bigger or equal to 'b'!"); 785 return(); 786 } 787 763 788 } 764 789 … … 773 798 } 774 799 800 if( b == e ) // commutative ring!!! 801 { 802 if( fprot == 1) 803 { 804 print("Warning: b==e means that the resulting ring will be commutative!"); 805 } 806 Q = std(Q + (var(b)^2)); 807 qring @EA = Q; // and it will be internally commutative as well!!! 808 return(@EA); 809 } 810 775 811 /* 776 // Singular'(H ans) politics: no ring copyes!812 // Singular'(H.S.) politics: no ring copies! 777 813 // in future ncalgebra() should return a new ring!!! 778 814 list CurrRing = ringlist(basering); … … 793 829 } 794 830 795 ncalgebra(@E, 0); 796 797 ideal Q = fetch(saveRing, Q); 798 j = ncols(Q) + 1; 831 ncalgebra(@E, 0); // define ground G-algebra! 832 833 ideal @Q = fetch(saveRing, Q); 834 835 j = ncols(@Q) + 1; 799 836 800 837 for ( i=e; i>=b; i--, j++ ) 801 838 { 802 Q[j] = var(i)^2; 803 } 804 Q = twostd(Q); 805 qring @EA = Q; 839 @Q[j] = var(i)^2; 840 } 841 842 if( (fprot == 1) and (attrib(basering, "global") != 1) ) 843 { 844 print("Warning: Since the current ordering is not global there might be problems computing twostd(Q)!"); 845 print("Q:", @Q); 846 } 847 848 @Q = twostd(@Q); // must be computed within the ground G-algebra => problems with local orderings! 849 850 qring @EA = @Q; 806 851 807 852 // "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; … … 832 877 " 833 878 RETURN: list {AltVarStart, AltVarEnd} is currRing is SCA, returns undef otherwise. 879 NOTE: rings with only one non-commutative variable are commutative rings which are super-sommutative itself! 834 880 " 835 881 { 836 882 def saveRing = basering; 837 list L = ringlist(saveRing);838 839 if( size(L)!=6 )840 {841 return("The current ring is commutative!");842 }843 844 module D = simplify(L[6], 2 + 4);845 846 if( size(D)>0 )847 {848 return("The current ring is not SCA! (D!=0)");849 }850 883 851 884 int i, j; … … 854 887 int b = N+1; 855 888 int e = -1; 889 890 int fprot = (find(option(),"prot") != 0); 891 892 893 if( size(ideal(saveRing)) == 0 ) 894 { 895 return("SCA rings are factors by (at least) squares!"); // no squares in the factor ideal! 896 } 897 898 list L = ringlist(saveRing); 899 900 if( size(L)!=6 ) 901 { 902 if(fprot) 903 { 904 print("Warning: The current ring is internally commutative!"); 905 } 906 907 for( i = N; i > 0; i-- ) 908 { 909 if( NF(var(i)^2, std(0)) == 0 ) 910 { 911 if( (fprot == 1) and (i > 1) ) 912 { 913 print("Warning: the SCA representation of the current commutative factor ring may be ambiguous!"); 914 } 915 916 return( list(i, i) ); // this is not unique in this case! there may be other squares in the factor ideal! 917 } 918 } 919 920 return("The current commutative ring is not SCA! (Wrong quotient ideal)"); // no squares in the factor ideal! 921 } 922 923 module D = simplify(L[6], 2 + 4); 924 925 if( size(D)>0 ) 926 { 927 return("The current ring is not SCA! (D!=0)"); 928 } 856 929 857 930 matrix C = L[5]; … … 887 960 if( (b > N) || (e < 1)) 888 961 { 889 return("The current ring is commutative!"); 962 if(fprot) 963 { 964 print("Warning: The current ring is a commutative GR-algebra!"); 965 } 966 967 for( i = N; i > 0; i-- ) 968 { 969 if( NF(var(i)^2, std(0)) == 0 ) 970 { 971 if( (fprot == 1) and (i > 1) ) 972 { 973 print("Warning: the SCA representation of the current factor ring may be ambiguous!"); 974 } 975 976 return( list(i, i) ); // this is not unique in this case! there may be other squares in the factor ideal! 977 } 978 } 979 980 return("The current commutative GR-algebra is not SCA! (Wrong quotient ideal)"); // no squares in the factor ideal! 890 981 } 891 982 … … 912 1003 } 913 1004 914 list LL = list(L[1], L[2], L[3], ideal(0), L[5], L[6]);915 ideal Q = L[4];916 // "Q = ", string(Q);917 918 def E = ring(LL);919 setring E; // not a qring!920 // E;921 922 ideal Q = fetch(saveRing, Q); // should belong to E!923 Q = twostd(Q);924 925 // "Q = ", string(Q);926 927 1005 for( i = b; i <= e; i++ ) 928 1006 { 929 if( NF(var(i)^2, Q) != 0 ) 930 { 931 setring saveRing; 1007 if( NF(var(i)^2, std(0)) != 0 ) 1008 { 932 1009 return("The current ring is not SCA! (Wrong quotient ideal)"); 933 1010 } … … 937 1014 // ok. it is a SCA!!! 938 1015 939 ideal QQ; 940 941 for( i = e; i >= b; i-- ) 942 { 943 QQ[i - b + 1] = var(i)^2; 944 } 945 946 QQ = twostd(QQ); 947 Q = simplify(NF(Q, QQ), 1 + 2 + 4); 948 949 setring saveRing; 950 951 ideal QQ = fetch(E, Q); 952 953 return(list(b, e, QQ)); 954 } 955 956 957 1016 return(list(b, e)); 1017 } 958 1018 959 1019 /////////////////////////////////////////////////////////////////////////////// … … 1018 1078 RETURN: int 1019 1079 PURPOSE: returns 1 if basering is a supercommutative algebra and 0 otherwise. 1020 NOTE: no error message!1080 NOTE: shows hint message for non-SCA algebras if the 'prot' option is on. 1021 1081 EXAMPLE: example IsSCA; shows examples 1022 1082 " … … 1027 1087 { 1028 1088 return(1); 1089 } 1090 1091 if( find(option(),"prot") != 0 ) 1092 { 1093 print(l); 1029 1094 } 1030 1095
Note: See TracChangeset
for help on using the changeset viewer.