/usr/share/singular/LIB/perron.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 | //////////////////////////////////////////////////////////////////////////////
version="version perron.lib 4.0.0.0 Jun_2013 "; // $Id: bd7cde64b139f9376272b52f8102d69ba8af6397 $
category="Noncommutative";
info="
LIBRARY: perron.lib computation of algebraic dependences
AUTHOR: Oleksandr Motsak U@D, where U={motsak}, D={mathematik.uni-kl.de}
PROCEDURES:
perron(L[, D]); relations between pairwise commuting polynomials
KEYWORDS: algebraic dependence; relations
";
LIB "central.lib";
//////////////////////////////////////////////////////////////////////////////
proc perron( ideal L, list # )
"USAGE: perron( L [, D] )
RETURN: commutative ring with ideal `Relations`
PURPOSE: computes polynomial relations ('Relations') between pairwise
commuting polynomials of L [, up to a given degree bound D]
NOTE: the implementation was partially inspired by the Perron's theorem.
EXAMPLE: example perron; shows an example
"
{
int N, D, i;
N = size(L);
if( N == 0 )
{
ERROR( "Input ideal must be non-zero!" );
}
intvec W; // weights
for ( i = N; i > 0; i-- )
{
W[i] = deg(L[i]);
}
////////////////////////////////////////////////////////////////////////
D = -1;
// Check whether the degree bound 'D' is given:
if( size(#)>0 )
{
if ( typeof(#[1]) == typeof(D) )
{
D = #[1];
if( D <= 0 )
{
ERROR( "An optional parameter D must be positive!" );
}
}
}
// , otherwise we try to estimate it according to Perron's Th:
if( D < 0 )
{
D = 1;
int d;
int min = -1;
for ( i = size(L); i > 0 ; i-- )
{
d = W[i];
D = D * d;
if( min == -1)
{
min = d;
}
else
{
if( min > d )
{
min = d;
}
}
}
if( (D == 0) or (min <= 0) )
{
ERROR( "Wrong set of polynomials!" );
}
D = D div min;
}
////////////////////////////////////////////////////////////////////////
def NCRING = basering;
def CurrentField = ringlist( NCRING )[1];
// We are going to construct a commutative ring in N variables F(i),
// with the field specified by 'CurrentField':
ring TEMPRING = 0, ( F(1..N) ), dp;
list RingList = ringlist( TEMPRING );
setring NCRING;
if( !defined(RingList) )
{
list RingList = imap( TEMPRING, RingList );
}
RingList[1] = CurrentField;
// New Commutative Ring with correct field!
def COMMUTATIVERING = ring( RingList );
////////////////////////////////////////////////////////////////////////
setring COMMUTATIVERING; // we are in COMMUTATIVERING now
ideal PBWBasis = PBW_maxDeg( D ); // All monomials of degree(!) <= D.
// TODO: it would be better to compute weighted monomials of weight
// <= W[1] \cdots W[N].
setring NCRING; // and back to NCRING
map Psi = COMMUTATIVERING, L; // F(i) \mapsto L[i]
ideal Images = Psi( PBWBasis ); // Corresponding products of polynomials
// from L
// ::MAIN STEP:: // Compute relations in NC ring:
def T = linearMapKernel( Images );
////////////////////////////////////////////////////////////////////////
// check the output of 'linearMapKernel':
int t = 0;
if( (typeof(T) != "module") and (typeof(T) != "int" ) )
{
ERROR( "Wrong output from function 'linearMapKernel'!" );
}
if( typeof(T) == "int" )
{
t = 1;
if( T != 0 )
{
ERROR( "Wrong output from function 'linearMapKernel'!" );
}
}
////////////////////////////////////////////////////////////////////////
// Go back to commutative case in both cases:
setring COMMUTATIVERING;
ideal Relations; // And generate Relations:
if( t == 0 ) // T is a module
{
module KER = imap( NCRING, T );
Relations = linearCombinations( PBWBasis, KER );
}
else
{ // T == int(0) => all images are zero =>
Relations = PBWBasis;
}
////////////////////////////////////////////////////////////////////////
// we compute an std basis of the relations:
// save options
intvec v = option( get );
// set right options
option( redSB );
option( redTail );
// reduce everything in as far as possible
Relations = simplify( groebner( Relations ), 1 + 2 + 8 );
// restore options
option( set, v );
// Relations;
export Relations;
return( COMMUTATIVERING );
}
example
{ "EXAMPLE:"; echo = 2;
int p = 3;
ring AA = p,(x,y,z),dp;
matrix D[3][3]=0;
D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y;
def A = nc_algebra(1,D); setring A; // this algebra is U(sl_2)
ideal I = x^p, y^p, z^p-z, 4*x*y+z^2-2*z; // the center
def RA = perron( I, p );
setring RA;
RA;
Relations; // it was exported from perron to be in the returned ring.
// perron can be also used in a commutative case, for example:
ring B = 0,(x,y,z),dp;
ideal J = xy+z2, z2+y2, x2y2-2xy3+y4;
def RB = perron(J);
setring RB;
Relations;
// one more test:
setring A;
map T=RA,I;
T(Relations); // should be zero
}
|