/usr/share/singular/LIB/qmatrix.lib is in singular-data 4.0.3+ds-1.
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 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | /////////////////////////////////////
version="version qmatrix.lib 4.0.0.0 Jun_2013 "; // $Id: 0ff9b9f42c3021528e3920ce6700195dc3d55673 $
category="Noncommutative";
info="
LIBRARY: qmatrix.lib Quantum matrices, quantum minors and symmetric groups
AUTHORS: Lobillo, F.J., jlobillo@ugr.es
@* Rabelo, C., crabelo@ugr.es
SUPPORT: 'Metodos algebraicos y efectivos en grupos cuanticos', BFM2001-3141, MCYT, Jose Gomez-Torrecillas (Main researcher).
PROCEDURES:
quantMat(n, [p]); generates the quantum matrix ring of order n;
qminor(u, v, nr); calculate a quantum minor of a quantum matrix
SymGroup(n); generates an intmat containing S(n), each row is an element of S(n)
LengthSymElement(v); calculates the length of the element v of S(n)
LengthSym(M); calculates the length of each element of M, being M a subset of S(n)
";
LIB "ncalg.lib";
LIB "nctools.lib"; // for rootofUnity
///////////////////////////////////////////////////////////////////////////////
proc SymGroup(int n)
"USAGE: SymGroup(n); n an integer (positive)
RETURN: intmat
PURPOSE: represent the symmetric group S(n) via integer vectors (permutations)
NOTE: each row of the output integer matrix is an element of S(n)
SEE ALSO: LengthSym, LengthSymElement
EXAMPLE: example SymGroup; shows examples
"{
if (n<=0)
{
"n must be positive";
intmat M[1][1]=0;
}
else
{
if (n==1)
{
intmat M[1][1]=1;
}
else
{
def N=SymGroup(n-1); // N is the symmetric group S(n-1)
int m=nrows(N); // The order of S(n-1)=(n-1)!
intmat M[m*n][n]; // Matrix to save S(n), m*n=n*(n-1)!=n!=#S(n)
int i,j,k;
for (i=1; i<=m; i++)
{ // fixed an element i of S(n-1)
for (j=n; j>0; j--)
{ // and fixed a position j to introduce an "n"
for (k=1; k<j; k++)
{ // we want to copy the i-th element until position j-1
M[n*(i-1)+(n-j+1),k]=N[i,k];
}
M[n*(i-1)+(n-j+1),j]=n; // we write the "n" in the position j
for (k=j+1; k<=n; k++)
{
M[n*(i-1)+(n-j+1),k]=N[i,k-1]; // and we run until the end of copying
}
}
}
}
}
return (M);
}
example
{
"EXAMPLE:";echo=2;
// "S(3)={(1,2,3),(1,3,2),(3,1,2),(2,1,3),(2,3,1),(3,2,1)}";
SymGroup(3);
}
///////////////////////////////////////////////////////////////////////////////
// This procedure calculates the length of an element v of a symmetric group
// If size(v)=n, the group is S(n). The permutation is i->v[i].
proc LengthSymElement(intvec v)
"USAGE: LengthSymElement(v); v intvec
RETURN: int
PURPOSE: determine the length of the permutation given by v in some S(n)
ASSUME: v represents an element of S(n); otherwise the output may have no sense
SEE ALSO: SymGroup, LengthSym
EXAMPLE: example LengthSymElement; shows examples
"{
int n=size(v);
int l=0;
int i,j;
for (i=1; i<n; i++)
{
for (j=i+1; j<=n; j++)
{
if (v[j]<v[i]) {l++;}
}
}
return (l);
}
example
{
"EXAMPLE:";echo=2;
intvec v=1,3,4,2,8,9,6,5,7,10;
LengthSymElement(v);
}
///////////////////////////////////////////////////////////////////////////////
proc LengthSym(intmat M)
"USAGE: LengthSym(M); M an intmat
RETURN: intvec
PURPOSE: determine a vector, where the i-th element is the length of the permutation of S(n) given by the i-th row of M
ASSUME: M represents a subset of S(n) (each row must be an element of S(n)); otherwise, the output may have no sense
SEE ALSO: SymGroup, LengthSymElement
EXAMPLE: example LengthSym; shows examples
"{
int n=ncols(M); // this n is the n of S(n)
int m=nrows(M); // m=num of element of S(n) in M, if M=S(n) m=n!
intvec L=0;
int i;
for (i=1; i<=m; i++)
{
L=L,LengthSymElement(intvec(M[i,1..n]));
}
L=L[2..size(L)];
return (L);
}
example
{
"EXAMPLE:";echo=2;
def M = SymGroup(3); M;
LengthSym(M);
}
///////////////////////////////////////////////////////////////////////////////
proc quantMat(int n, list #)
"USAGE: quantMat(n [, p]); n integer (n>1), p an optional integer
RETURN: ring (of quantum matrices). If p is specified, the quantum parameter q
@* will be specialized at the p-th root of unity
PURPOSE: compute the quantum matrix ring of order n
NOTE: activate this ring with the \"setring\" command.
@* The usual representation of the variables in this quantum
@* algebra is not used because double indexes are not allowed
@* in the variables. Instead the variables are listed by reading
@* the rows of the usual matrix representation, that is, there
@* will be n*n variables (one for each entry an n*N generic matrix),
@* listed row-wise
SEE ALSO: qminor
EXAMPLE: example quantMat; shows examples
"{
if (n>1)
{
int nv=n^2;
intmat m[nv][nv];
int i,j;
for (i=1; i<=nv; i++)
{
m[i,nv+1-i]=1;
}
int chr = 0;
if ( size(#) > 0 )
{
if ( typeof( #[1] ) == "int" )
{
chr = #[1];
}
}
ring @rrr=(0,q),(y(1..nv)),Dp;
minpoly = rootofUnity(chr);
matrix C[nv][nv]=0;
matrix D[nv][nv]=0;
intvec idyi, idyj;
for (i=1; i<nv; i++)
{
for (j=i+1; j<=nv; j++)
{
idyi=itoij(i,n);
idyj=itoij(j,n);
if (idyi[1]==idyj[1] || idyi[2]==idyj[2])
{
C[i,j]=1/q;
}
else
{
if (idyi[2]<idyj[2])
{
C[i,j]=1;
D[i,j]=(1/q - q)*y(ijtoi(idyi[1],idyj[2],n))*y(ijtoi(idyj[1],idyi[2],n));
}
else
{
C[i,j]=1;
}
}
}
}
def @@rrr=nc_algebra(C,D);
return (@@rrr);
}
else
{
"ERROR: n must be greater than 1";
return();
}
}
example
{
"EXAMPLE:"; echo=2;
def r = quantMat(2); // generate O_q(M_2) at q generic
setring r; r;
kill r;
def r = quantMat(2,5); // generate O_q(M_2) at q^5=1
setring r; r;
}
///////////////////////////////////////////////////////////////////////////////
proc qminor(intvec I, intvec J, int nr)
"USAGE: qminor(I,J,n); I,J intvec, n int
RETURN: poly, the quantum minor of a generic n*n quantum matrix
ASSUME: I is the ordered list of the rows to consider in the minor,
@* J is the ordered list of the columns to consider in the minor,
@* I and J must have the same number of elements,
@* n is the order of the quantum matrix algebra you are working with (quantMat(n)).
@* The base ring should be constructed using @code{quantMat}.
SEE ALSO: quantMat
EXAMPLE: example qminor; shows examples
"{
poly d=0;
poly f=0;
int k=0;
int n=size(I);
if ( size(I)!=size(J) )
{
"#I must be equal to #J";
}
else
{
def Sn=SymGroup(n);
def L=LengthSym(Sn);
int m=size(L); // m is the order of S(n)
int i,j;
for (i=1; i<=m; i++)
{
f=(-q)^(L[i]);
for (j=1; j<=n; j++)
{
k=ijtoi(I[j],J[Sn[i,j]],nr);
f=f*y(k);
}
d=d+f;
}
}
return (d);
}
example
{
"EXAMPLE:";
echo=2;
def r = quantMat(3); // let r be a quantum matrix of order 3
setring r;
intvec u = 1,2;
intvec v = 2,3;
intvec w = 1,2,3;
qminor(w,w,3);
qminor(u,v,3);
qminor(v,u,3);
qminor(u,u,3);
}
///////////////////////////////////////////////////////////////////////////////
// For tecnical reasons we work with a list of variables {y(1)...y(n^2)}.
// In quantum matrices the usual is to work with a square matrix of variables {y(ij)}.
// The formulas are easier if we use matricial notation.
// The following two procedures change the index of a list to a matrix and viceversa in order
// to use matricial notation in the calculus but use list notation in input and output.
// n is the order of the quantum matrix algebra where we are working.
static proc itoij(int i,int n)
{
intvec ij=0,0;
ij[1]=((i-1) div n)+1;
ij[2]=((i-1) mod n)+1;
return(ij);
}
static proc ijtoi(int i,int j,int n)
{
return((j-1)+n*(i-1)+1);
}
///////////////////////////////////////////////////////////////////////////////
|