Changeset c591ad0 in git
- Timestamp:
- Feb 1, 2007, 12:56:34 AM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- bad2940b7a43a19da887b39672e04919a2b3a28c
- Parents:
- 86016dc267659b0c4d7155a4accd5fb595c04de7
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/nctools.lib
r86016d rc591ad0 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: nctools.lib,v 1.2 2 2007-01-23 15:03:36 SingularExp $";2 version="$Id: nctools.lib,v 1.23 2007-01-31 23:56:33 motsak Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 19 19 Exterior(); return qring, the exterior algebra of a basering, 20 20 findimAlgebra(M,[r]); create finite dimensional algebra structure from the basering and the multiplication matrix M, 21 SuperCommutative([b,e ]); return qring, the super-commutative algebra over a basering,21 SuperCommutative([b,e, Q]); return qring, the super-commutative algebra over a basering, 22 22 rightStd(I); compute a right Groebner basis of an ideal, 23 23 … … 716 716 /////////////////////////////////////////////////////////////////////////////// 717 717 proc SuperCommutative(list #) 718 "USAGE: SuperCommutative([b,[e ]]);718 "USAGE: SuperCommutative([b,[e, [Q]]]); 719 719 RETURN: qring 720 720 PURPOSE: create the super-commutative algebra over a basering, 721 721 NOTE: activate this qring with the \"setring\" command 722 722 THEORY: given a basering, this procedure introduces the anticommutative relations x(j)x(i)=-x(i)x(j) for all e>=j>i>=b, 723 @* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2 723 @* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2[ + Q] 724 724 EXAMPLE: example SuperCommutative; shows examples 725 725 " 726 726 { 727 728 727 string rname=nameof(basering); 729 728 if ( rname == "basering") // i.e. no ring has been set yet … … 737 736 int e = N; 738 737 738 def saveRing = basering; 739 ideal Q = 0; 740 739 741 if(size(#)>0) 740 742 { 741 743 if(typeof(#[1]) != "int") 742 744 { 743 ERROR("First argument 'b' must be integter!");745 ERROR("First argument 'b' must be an integer!"); 744 746 return(); 745 747 } 746 748 b = #[1]; 747 748 749 if(size(#)>1) 750 { 751 if(typeof(#[2]) != "int") 752 { 753 ERROR("Last argument 'e' must be integter!"); 754 return(); 755 } 756 e = #[2]; 757 } 758 } 759 760 749 } 750 751 if(size(#)>1) 752 { 753 if(typeof(#[2]) != "int") 754 { 755 ERROR("Last argument 'e' must be an integer!"); 756 return(); 757 } 758 e = #[2]; 759 } 760 761 if(size(#)>2) 762 { 763 if(typeof(#[3]) != "ideal") 764 { 765 ERROR("Last argument 'Q' must be an ideal!"); 766 return(); 767 } 768 Q = #[3]; 769 } 770 761 771 list CurrRing = ringlist(basering); 762 772 def @R = ring(CurrRing); … … 775 785 } 776 786 777 ncalgebra(@E,0); 778 779 ideal Q; 780 781 for ( i=e; i>=b; i-- ) 782 { 783 Q[i-b+1] = var(i)^2; 787 ncalgebra(@E, 0); 788 789 ideal Q = fetch(saveRing, Q); 790 j = ncols(Q) + 1; 791 792 for ( i=e; i>=b; i--, j++ ) 793 { 794 Q[j] = var(i)^2; 784 795 } 785 796 Q = twostd(Q); … … 815 826 " 816 827 { 817 def rRing = basering;818 list L = ringlist( rRing);828 def saveRing = basering; 829 list L = ringlist(saveRing); 819 830 820 831 if( size(L)!=6 ) … … 831 842 832 843 int i, j; 833 int N = nvars( rRing);844 int N = nvars(saveRing); 834 845 835 846 int b = N+1; 836 int e = 0; 837 838 poly p; 839 840 ideal I = sort(L[4])[1]; 841 842 // "Q = ", string(I); 843 844 intvec exp; 845 int d; 846 int n = 0; 847 848 for( i = size(I); i > 0; i-- ) 849 { 850 p = I[i]; 851 // p; 852 853 if( size(p) != 1 ) 854 { 855 return("The current ring is not SCA! (Wrong quotient ideal, not monomial)"); 856 } 857 858 exp = leadexp(p); 859 // exp; 860 d = 0; 861 for( j = size(exp); j >= 1; j-- ) 862 { 863 d = d + exp[j]; 864 // d; 865 866 if( (d!=2) && (d!=0) ) 847 int e = -1; 848 849 matrix C = L[5]; 850 poly c; 851 852 for( i = 1; i < N; i++ ) 853 { 854 for( j = i+1; j <= N; j++ ) 855 { 856 c = C[i, j]; 857 858 if( c == -1 ) 867 859 { 868 return("The current ring is not SCA! (Wrong quotient ideal, wrong leading exponent)"); 869 } 870 871 if(exp[j] == 2) 872 { 873 if(b > j) 860 if(i < b) 861 { 862 b = i; 863 } 864 865 if(j > e) 866 { 867 e = j; 868 } 869 } else 870 { // should commute 871 if( c!=1 ) 874 872 { 875 b = j; // min 876 n = n + 1; 877 } 878 if(e < j) 879 { 880 e = j; // max 881 n = n + 1; // => n = n + 1 twice for the 1st one 873 return("The current ring is not SCA! (C["+ string(i)+"," + string(j)+"]!=1)"); 882 874 } 883 875 } 884 876 } 885 886 if( d!=2 ) 887 { 888 return("The current ring is not SCA! (Wrong quotient ideal, wrong leading exponent)"); 889 } 890 } 891 892 // b, e, n; 893 894 if(size(I) == 0) 895 { 896 b = N+1; 897 e = N+1; 898 n = 2; 899 } 900 901 // if( (e < 1) || (b > N) ) 902 // { 903 // ERROR("The current ring is not SCA! (wrong quotient ideal, bad squares)"); 904 // return(); 905 // } 906 907 if( (e - b + 2) != n ) // +2 instead of +1! 908 { 909 return("The current ring is not SCA! (wrong quotient ideal, bad range)"); 910 } 911 912 913 matrix C = L[5]; 914 poly c; 915 877 } 878 879 if( (b > N) || (e < 1)) 880 { 881 return("The current ring is commutative!"); 882 } 883 916 884 for( i = 1; i < N; i++ ) 917 885 { … … 935 903 } 936 904 } 937 938 if( (b > N) || (e > N)) 939 { 940 return("The current ring is commutative!"); 941 } 942 943 return(list(b, e)); 905 906 list LL = list(L[1], L[2], L[3], ideal(0), L[5], L[6]); 907 ideal Q = L[4]; 908 // "Q = ", string(Q); 909 910 def E = ring(LL); 911 setring E; // not a qring! 912 // E; 913 914 ideal Q = fetch(saveRing, Q); // should belong to E! 915 Q = twostd(Q); 916 917 // "Q = ", string(Q); 918 919 for( i = b; i <= e; i++ ) 920 { 921 if( NF(var(i)^2, Q) != 0 ) 922 { 923 setring saveRing; 924 return("The current ring is not SCA! (Wrong quotient ideal)"); 925 } 926 } 927 928 //////////////////////////////////////////////////////////////////////// 929 // ok. it is a SCA!!! 930 931 ideal QQ; 932 933 for( i = e; i >= b; i-- ) 934 { 935 QQ[i - b + 1] = var(i)^2; 936 } 937 938 QQ = twostd(QQ); 939 Q = simplify(NF(Q, QQ), 1 + 2 + 4); 940 941 setring saveRing; 942 943 ideal QQ = fetch(E, Q); 944 945 return(list(b, e, QQ)); 944 946 } 945 947 … … 1069 1071 setring ER; ER; 1070 1072 if(IsSCA()) 1071 { " Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; }1073 { "This is a SCA! Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; } 1072 1074 else 1073 1075 { "Not a supercommutative algebra!!!"; } -
Singular/ipassign.cc
r86016d rc591ad0 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipassign.cc,v 1.8 7 2007-01-29 18:34:45 SingularExp $ */4 /* $Id: ipassign.cc,v 1.88 2007-01-31 23:56:34 motsak Exp $ */ 5 5 6 6 /* … … 587 587 } 588 588 589 // is this an exterior algebra or a commutative polynomial ring \otimes exterior algebra? 590 // we should check whether qr->qideal is of the form: y_i^2, y_{i+1}^2, \ldots, y_j^2 (j > i) 591 //.if yes, setup qr->nc->type, etc. 592 sca_SetupSCA(qr, currRing); 589 nc_SetupQuotient(qr, currRing); 593 590 } 594 591 #endif
Note: See TracChangeset
for help on using the changeset viewer.