- Timestamp:
- Sep 21, 2016, 8:50:47 PM (8 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 340ab86324a89fa970583967bc2dc82e455bac1d
- Parents:
- 579edfd1e445a134cdaeced2df1b8db73d9b7d9b
- git-author:
- Sharwan Tiwari <stiwari@gmail.com>2016-09-21 20:50:47+02:00
- git-committer:
- Sharwan Tiwari <stiwari@gmail.com>2016-10-11 17:40:28+02:00
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ncHilb.lib
r579edfd r637aa3 14 14 15 15 PROCEDURES: 16 nchilb(L, d, #); gives the Hilbert series of a monomial algebra 17 (free algebra/two-sided monomial ideal). 18 List L contains non-comm. polynomials. 19 And d is a degree bound for the Groebner basis computation of 20 the ideal generated by L. Third argument is optional, required for 21 the non-finitely generated ideals. 16 nchilb(L, d, #); Hilbert series of a non-commutative monomial algebra 17 22 18 "; 23 19 … … 39 35 EXAMPLE: example nchilb; shows an example " 40 36 { 41 system("--ticks-per-sec",1000); 42 if (d<1) {"bad degree bound"; return(0);} 43 printlevel=1; 37 38 if (d<1) 39 { 40 ERROR("bad degree bound"); 41 } 42 44 43 def save = basering; 45 44 int sz=size(#); … … 49 48 setring R; 50 49 ideal I; 51 poly p =0;52 50 poly p; 51 poly q=0; 53 52 // convert list L_wp of free-poly to letterPlace-poly format 54 53 setring save; 55 54 module M; 56 55 int i,j,k,sw,sm,slm; 57 vector w; // for words 58 slm = size(L_wp); // number of polys in the given ideal 59 string letpl; 56 vector w; 57 poly pc=0; 58 intvec v; 59 slm = size(L_wp); // number of polys in the given ideal 60 60 61 for (i=1; i<=slm; i++) 61 { 62 { 62 63 M = L_wp[i]; 63 sm = ncols(M); 64 sm = ncols(M); // number of words in the free-poly M 64 65 for (j=1; j<=sm; j++) 65 66 { 66 67 w = M[j]; 67 68 sw = size(w); 68 letpl = "p = p + ";69 69 for (k=2; k<=sw; k++) 70 70 { 71 letpl = letpl + string(w[k])+"("+string(k-1)+")*";71 v[k-1]=rvar(w[k]); 72 72 } 73 letpl = letpl + string(w[1])+";"; 74 73 pc=w[1]; 75 74 setring R; 76 execute(letpl); 75 p=imap(save,pc); 76 for (k=2; k<=sw; k++) 77 { 78 p=p*var(v[k-1]+(k-2)*lV); 79 } 80 q=q+p; 77 81 setring save; 78 82 } 79 83 setring R; 80 I = I, p; //lp-polynomial added to I81 p =0; //ready for the next polynomial84 I = I,q; //lp-polynomial added to I 85 q=0; //ready for the next polynomial 82 86 setring save; 83 87 } 84 kill letpl;85 88 setring R; 86 int tt,rt; 87 88 tt=timer; 89 rt=rtimer; 89 90 90 ideal J = system("freegb",I,d,lV); 91 91 92 if(printlevel >=2)93 {94 "CPU-time of GB computation="+string(timer-tt)+" milli-sec.";95 "Real-time of GB computation="+string(rtimer-rt)+" milli-sec.";96 }97 98 92 //Groebner Basis is computed for the given ideal. 99 //now compute the leading monomials of Groebner Basis93 //now compute the leading monomials of the Groebner Basis 100 94 101 95 ideal J_lm; … … 111 105 112 106 //compute the Hilbert series 113 tt=timer; 114 rt=rtimer; 115 if(sz==1) 107 108 if(sz==1) // non-finitely generated case 116 109 { 117 110 system("nc_hilb",I,lV,1); 118 111 } 119 else 112 else // finitely generated case 120 113 { 121 114 system("nc_hilb",I,lV); 122 115 } 123 if(printlevel >=2)124 {125 "CPU-time of Hilbert series computation="+string(timer-tt)+" milli-sec.";126 "Real-time of Hilbert series computation="+string(rtimer-rt)+" milli-sec.";127 }128 129 116 } 130 117 example … … 132 119 "EXAMPLE:"; echo = 2; 133 120 ring r=0,(x,y,z),dp; 134 module p1=[1,y,z],[-1,z,y]; //represents the poly y*z-z*y135 module p2=[1,x,z,x],[-1,z,x,z]; //represents the poly x*z*x-z*x*z121 module p1=[1,y,z],[-1,z,y]; //represents the poly y*z-z*y 122 module p2=[1,x,z,x],[-1,z,x,z]; //represents the poly x*z*x-z*x*z 136 123 list l1=list(p1,p2); 137 124 nchilb(l1,6,1); //third argument is for non-finitely generated case 138 125 139 126 ring r=0,(x,y,z,w),dp; 140 module p1=[1,y,x],[-1,x,y]; 127 module p1=[1,y,x],[-1,x,y]; //represents the poly y*x-x*y 141 128 module p2=[1,z,x],[-1,x,z]; 142 129 module p3=[1,w,x],[-1,x,w]; … … 148 135 149 136 ring r=0,(X,Y,Z),dp; 150 module p1 =[1,Y,Z]; 137 module p1 =[1,Y,Z]; //represents the poly Y*Z 151 138 module p2 =[1,Y,Z,X]; 152 139 module p3 =[1,Y,Z,Z,X,Z]; -
Singular/extra.cc
r579edfd r637aa3 3046 3046 else 3047 3047 #endif 3048 //========================================================== 3049 // Hilbert series for non-comm. monomial algebras 3050 // ========================================================= 3051 if(strcmp(sys_cmd,"nc_hilb")==0) 3052 { 3053 ideal i; 3054 int lV; 3055 bool ig=FALSE; 3056 if((h!=NULL)&&(h->Typ()==IDEAL_CMD)) 3057 i=(ideal)h->Data(); 3058 else return TRUE; 3059 h=h->next; 3060 if((h!=NULL)&&(h->Typ()==INT_CMD)) 3061 lV=(int)(long)h->Data(); 3062 else return TRUE; 3063 h=h->next; 3064 if(h!=NULL) 3065 ig=TRUE; 3066 HilbertSeries_OrbitData(i,lV,ig); 3067 return(FALSE); 3068 } 3069 else 3070 3071 /*==================== sca?AltVar ==================================*/ 3048 /*====================================================== 3049 * Hilbert series of non-commutative monomial algebras 3050 *======================================================*/ 3051 if(strcmp(sys_cmd,"nc_hilb") == 0) 3052 { 3053 ideal i; 3054 int lV; 3055 bool ig = FALSE; 3056 if((h != NULL)&&(h->Typ() == IDEAL_CMD)) 3057 i = (ideal)h->Data(); 3058 else 3059 { 3060 WerrorS("ideal expected"); 3061 return TRUE; 3062 } 3063 h = h->next; 3064 if((h != NULL)&&(h->Typ() == INT_CMD)) 3065 lV = (int)(long)h->Data(); 3066 else 3067 { 3068 WerrorS("int expected"); 3069 return TRUE; 3070 } 3071 h = h->next; 3072 if(h != NULL) 3073 ig = TRUE; 3074 HilbertSeries_OrbitData(i,lV,ig); 3075 return(FALSE); 3076 } 3077 else 3078 3079 /*==================== sca?AltVar ==================================*/ 3072 3080 #ifdef HAVE_PLURAL 3073 3081 if ( (strcmp(sys_cmd, "AltVarStart") == 0) || (strcmp(sys_cmd, "AltVarEnd") == 0) )
Note: See TracChangeset
for help on using the changeset viewer.