/usr/share/singular/LIB/ncHilb.lib is in singular-data 1:4.1.0-p3+ds-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | //////////////////////////////////////////////////////////////////////////////
version="version nc_hilb.lib 4.1.0.0 Nov_2016 "; // $Id: 4d770dbb7090464d1ee06ad4d1fe1b7b94dba0cb $
category="Noncommutative algebra";
info="
LIBRARY: ncHilb.lib: A library for computing graded and multi-graded Hilbert
series of the non-commutative monomial algebras
(e.g. k<x,y,z>/I, where I is a two-sided ideal).
AUTHOR: Sharwan K. Tiwari stiwari@mathematik.uni-kl.de
REFERENCES:
La Scala R.: Monomial right ideals and the Hilbert series of
non-commutative modules, J. of Symb. Comp. (2016).
PROCEDURES:
nchilb(L,d,#); Hilbert series of a non-commutative monomial algebra
";
LIB "freegb.lib";
proc nchilb(list L_wp, int d, list #)
"USAGE: nchilb(list of relations, an integer, optional);
L is a list of modules (each module represents a free-polynomial),
d is an integer for the degree bound (maximal total degree of the
polynomials of generating set of input ideal),
#[]=1 represents the case of non-finitely generated ideals,
#[]=2 is for the computation of multi-graded Hilbert series, and
#[]=3 is to print the details about the orbit and system of equation.
NOTE : The generating set of input ideal should be a Groebner basis and needs
to be given in a special form. It is a list of modules, where each
generator of every module represents a monomial times a coefficient
in the free associative algebra. The first entry, in each generator,
represents a coefficient and every next entry is a variable.
Ex: module p1=[1,y,z],[-1,z,y] represents the poly y*z-z*y;
module p2=[1,x,z,x],[-1,z,x,z] represents the poly x*z*x-z*x*z
for more details about the input, see examples.
EXAMPLE: example nchilb; shows an example "
{
if (d<1)
{
ERROR("bad degree bound");
}
def save = basering;
int sz=size(#);
int lV=nvars(save);
int ig, mgrad, odp;
int i=1;
while(typeof(#[i])=="int" && i<=sz)
{
if(#[i] == 1)
{
ig = 1;
}
else
{
if(#[i] == 2)
{
mgrad = 2;
}
else
{
if(#[i] == 3)
{
odp = 3;
}
else
{
ERROR("error:only int 1,2,3 are allowed as optional parameters");
}
}
}
i = i + 1;
}
if( i <= sz)
{
ERROR("error:only int 1,2,3 are allowed as optional parameters");
}
def R = makeLetterplaceRing(2*d);
setring R;
ideal I;
poly p;
poly q=0;
// convert list L_wp of free-poly to letterPlace-poly format
setring save;
module M;
int j,k,sw,sm,slm;
vector w;
poly pc=0;
intvec v;
slm = size(L_wp); // number of polys in the given ideal
for (i=1; i<=slm; i++)
{
M = L_wp[i];
sm = ncols(M); // number of words in the free-poly M
for (j=1; j<=sm; j++)
{
w = M[j];
sw = size(w);
for (k=2; k<=sw; k++)
{
v[k-1]=rvar(w[k]);
}
pc=w[1];
setring R;
p=imap(save,pc);
for (k=2; k<=sw; k++)
{
p=p*var(v[k-1]+(k-2)*lV);
}
q=q+p;
setring save;
}
setring R;
I = I,q; //lp-polynomial added to I
q=0; //ready for the next polynomial
setring save;
}
setring R;
I=simplify(I,2);
ideal J_lm;
for(i=1;i<=size(I);i++)
{
J_lm[i]=leadmonom(I[i]);
}
//compute the Hilbert series
system("nc_hilb", J_lm, lV, ig, mgrad, odp);
}
example
{
"EXAMPLE:"; echo = 2;
ring r=0,(X,Y,Z),dp;
module p1 =[1,Y,Z]; //represents the poly Y*Z
module p2 =[1,Y,Z,X]; //represents the poly Y*Z*X
module p3 =[1,Y,Z,Z,X,Z];
module p4 =[1,Y,Z,Z,Z,X,Z];
module p5 =[1,Y,Z,Z,Z,Z,X,Z];
module p6 =[1,Y,Z,Z,Z,Z,Z,X,Z];
module p7 =[1,Y,Z,Z,Z,Z,Z,Z,X,Z];
module p8 =[1,Y,Z,Z,Z,Z,Z,Z,Z,X,Z];
list l1=list(p1,p2,p3,p4,p5,p6,p7,p8);
nchilb(l1,10);
ring r=0,(x,y,z),dp;
module p1=[1,y,z],[-1,z,y]; //y*z-z*y
module p2=[1,x,z,x],[-1,z,x,z]; // x*z*x-z*x*z
module p3=[1,x,z,z,x,z],[-1,z,x,z,z,x]; // x*z^2*x*z-z*x*z^2*x
module p4=[1,x,z,z,z,x,z];[-1,z,x,z,z,x,x]; // x*z^3*x*z-z*x*z^2*x^2
list l2=list(p1,p2,p3,p4);
nchilb(l2,6,1); //third argument '1' is for non-finitely generated case
ring r=0,(a,b),dp;
module p1=[1,a,a,a];
module p2=[1,a,b,b];
module p3=[1,a,a,b];
list l3=list(p1,p2,p3);
nchilb(l3,5,2);//third argument '2' is to compute multi-graded HS
ring r=0,(x,y,z),dp;
module p1=[1,x,z,y,z,x,z];
module p2=[1,x,z,x];
module p3=[1,x,z,y,z,z,x,z];
module p4=[1,y,z];
module p5=[1,x,z,z,x,z];
list l4=list(p1,p2,p3,p4,p5);
nchilb(l4,7,3); //third argument '3' is to print the details
// of the orbit and system
ring r=0,(x,y,z),dp;
module p1=[1,y,z,z];
module p2=[1,y,y,z];
module p3=[1,x,z,z];
module p4=[1,x,z,y];
module p5=[1,x,y,z];
module p6=[1,x,y,y];
module p7=[1,x,x,z];
module p8=[1,x,x,y];
module p9=[1,y,z,y,z];
module p10=[1,y,z,x,z];
module p11=[1,y,z,x,y];
module p12=[1,x,z,x,z];
module p13=[1,x,z,x,y];
module p14=[1,x,y,x,z];
module p15=[1,x,y,x,y];
module p16=[1,y,z,y,x,z];
module p17=[1,y,z,y,x,y];
module p18=[1,y,z,y,y,x,z];
module p19=[1,y,z,y,y,x,y];
module p20=[1,y,z,y,y,y,x,z];
module p21=[1,y,z,y,y,y,x,y];
list l5=list(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,
p14,p15,p16,p17,p18,p19,p20,p21);
nchilb(l5,7,1,2,3);
}
|