source: git/Singular/LIB/ncHilb.lib @ 637aa3

fieker-DuValspielwiese
Last change on this file since 637aa3 was 637aa3, checked in by Sharwan Tiwari <stiwari@…>, 8 years ago
modified nchilb
  • Property mode set to 100644
File size: 5.4 KB
Line 
1//////////////////////////////////////////////////////////////////////////////
2version="version nc_hilb.lib 4.0.3.3 Sep_2016 "; // $Id$
3category="Noncommutative algebra";
4info="
5LIBRARY:  ncHilb.lib: A library for computing the Hilbert series of the
6                       non-commutative monomial algebras (e.g. k<x,y,z>/I,
7                       where I is a two-sided ideal).
8
9AUTHOR:   Sharwan K. Tiwari   stiwari@mathematik.uni-kl.de
10
11REFERENCES:
12          La Scala R.: Monomial right ideals and the Hilbert series of
13          non-commutative modules, J. of Symb. Comp. (2016).
14
15PROCEDURES:
16          nchilb(L, d, #); Hilbert series of a non-commutative monomial algebra
17
18";
19
20LIB "freegb.lib";
21
22proc nchilb(list L_wp, int d, list #)
23"USAGE:  nchilb(list of relations, an integer, optional);
24         L is a list of modules (each module represents a free-polynomial),
25         d is an integer for the degree bound,
26         # != NULL for non-finitely generated ideals;
27NOTE  : The input ideal needs to be given in special form. It is a list
28        of modules, where each generator of every module represents a
29        monomial times a coefficient in the free associative algebra.
30        The first entry, in each generator, represents a coefficient and
31        every next entry is a variable.
32        Ex. module p1=[1,y,z],[-1,z,y] represents the poly y*z-z*y;
33            module p2=[1,x,z,x],[-1,z,x,z] represents the poly x*z*x-z*x*z
34        for more details about the input, see examples.
35EXAMPLE: example nchilb; shows an example "
36{
37
38    if (d<1)
39    {
40      ERROR("bad degree bound");
41    }
42   
43    def save = basering;
44    int sz=size(#);
45    int lV=nvars(save);
46   
47    def R =makeLetterplaceRing(d);
48    setring R;
49    ideal I;
50    poly p;
51    poly q=0;
52    // convert list L_wp of free-poly to letterPlace-poly format
53    setring save;
54    module M;
55    int i,j,k,sw,sm,slm;
56    vector w;
57    poly pc=0;
58    intvec v;
59    slm = size(L_wp);                  // number of polys in the given ideal
60   
61    for (i=1; i<=slm; i++)
62    {   
63        M  = L_wp[i];
64        sm = ncols(M);                 // number of words in the free-poly M
65        for (j=1; j<=sm; j++)
66        {
67            w  = M[j];
68            sw = size(w);
69            for (k=2; k<=sw; k++)
70            {
71              v[k-1]=rvar(w[k]);
72            }
73            pc=w[1];
74            setring R;
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;
81            setring save;
82        }
83        setring R;
84        I = I,q; //lp-polynomial added to I
85        q=0;   //ready for the next polynomial 
86        setring save;
87    }
88    setring R;
89
90    ideal J = system("freegb",I,d,lV);
91   
92    //Groebner Basis is computed for the given ideal.
93    //now compute the leading monomials of the Groebner Basis
94   
95    ideal J_lm;
96    for(i=1;i<=size(J);i++)
97    {
98        J_lm[i]=leadmonom(J[i]);
99    }
100   
101    setring save;
102    def A =makeLetterplaceRing(2*d);
103    setring A;
104    ideal I=imap(R, J_lm);
105   
106    //compute the Hilbert series
107   
108    if(sz==1)                     // non-finitely generated case
109    {
110        system("nc_hilb",I,lV,1);
111    }
112    else                         // finitely generated case
113    {
114        system("nc_hilb",I,lV);
115    }
116}
117example
118{
119"EXAMPLE:"; echo = 2;
120    ring r=0,(x,y,z),dp;
121    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
123    list l1=list(p1,p2);
124    nchilb(l1,6,1); //third argument is for non-finitely generated case
125   
126    ring r=0,(x,y,z,w),dp;
127    module p1=[1,y,x],[-1,x,y];            //represents the poly y*x-x*y
128    module p2=[1,z,x],[-1,x,z];
129    module p3=[1,w,x],[-1,x,w];
130    module p4=[1,z,y],[-1,y,z];
131    module p5=[1,w,y],[-1,y,w];
132    module p6=[1,w,z],[-1,z,w];
133    list l2=list(p1,p2,p3,p4,p5,p6);
134    nchilb(l2,5);
135       
136    ring r=0,(X,Y,Z),dp;
137    module p1 =[1,Y,Z];                //represents the poly Y*Z
138    module p2 =[1,Y,Z,X];
139    module p3 =[1,Y,Z,Z,X,Z];
140    module p4 =[1,Y,Z,Z,Z,X,Z];
141    module p5 =[1,Y,Z,Z,Z,Z,X,Z];
142    module p6 =[1,Y,Z,Z,Z,Z,Z,X,Z];
143    module p7 =[1,Y,Z,Z,Z,Z,Z,Z,X,Z];
144    module p8 =[1,Y,Z,Z,Z,Z,Z,Z,Z,X,Z];
145    list l3=list(p1,p2,p3,p4,p5,p6,p7,p8);
146    nchilb(l3,10);
147   
148    ring r=0,U(1..3),dp;
149    module p1=[1,U(2),U(3),U(3)];
150    module p2=[1,U(2),U(2),U(3)];
151    module p3=[1,U(1),U(3),U(3)];
152    module p4=[1,U(1),U(3),U(2)];
153    module p5=[1,U(1),U(2),U(3)];
154    module p6=[1,U(1),U(2),U(2)];
155    module p7=[1,U(1),U(1),U(3)];
156    module p8=[1,U(1),U(1),U(2)];
157    module p9=[1,U(2),U(3),U(2),U(3)];
158    module p10=[1,U(2),U(3),U(1),U(3)];
159    module p11=[1,U(2),U(3),U(1),U(2)];
160    module p12=[1,U(1),U(3),U(1),U(3)];
161    module p13=[1,U(1),U(3),U(1),U(2)];
162    module p14=[1,U(1),U(2),U(1),U(3)];
163    module p15=[1,U(1),U(2),U(1),U(2)];
164    module p16=[1,U(2),U(3),U(2),U(1),U(3)];
165    module p17=[1,U(2),U(3),U(2),U(1),U(2)];
166    module p18=[1,U(2),U(3),U(2),U(2),U(1),U(3)];
167    module p19=[1,U(2),U(3),U(2),U(2),U(1),U(2)];
168    module p20=[1,U(2),U(3),U(2),U(2),U(2),U(1),U(3)];
169    module p21=[1,U(2),U(3),U(2),U(2),U(2),U(1),U(2)];
170    list ll=list(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,
171    p14,p15,p16,p17,p18,p19,p20,p21);
172    nchilb(ll,7,1);
173   
174    ring r=0,(x,y,z),dp;
175    module p1=[0]; //zero ideal
176    list l1=list(p1);
177    nchilb(l1,2);
178   
179    ring r=0,(x,y,z),dp;
180    module p1=[1]; //unit ideal
181    list l1=list(p1);
182    nchilb(l1,2);
183}
184
Note: See TracBrowser for help on using the repository browser.