Goto Chapter: Top 1 2 3 4 5 Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

5 Tools
 5.1 Attributes
 5.2 Operations

5 Tools

5.1 Attributes

5.1-1 BasisOverCoefficientsRing
‣ BasisOverCoefficientsRing( R )( attribute )

Returns: a homalg matrix

Computes a basis of the ring R, provided it is free of finite rank over its coefficients ring.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> A := Q * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> bas := BasisOverCoefficientsRing( R );
<A 5 x 1 matrix over a residue class ring>
gap> Display( bas );
1, 
z, 
y, 
x, 
z^2

modulo [ y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z ]

5.1-2 RepresentationOverCoefficientsRing
‣ RepresentationOverCoefficientsRing( r )( attribute )

Returns: a homalg matrix

Computes a representation matrix of the ring element r, with respect to the basis computed by BasisOverCoefficientsRing, provided the ring is free of finite rank over its coefficients ring.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> A := Q * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> r := HomalgRingElement( "x^2 +xy +z", R );
|[ x^2+x*y+z ]|
gap> rep := RepresentationOverCoefficientsRing( r );
<A 5 x 5 matrix over an external ring>
gap> Display( rep );
0,2,0,0,1,
0,1,0,0,2,
0,0,1,2,0,
0,0,2,1,0,
0,2,0,0,1 

5.1-3 FGLMdata
‣ FGLMdata( R )( attribute )

Returns: a list

Computes the FGLM data of the ring R (see [Jam13]), provided it is free of finite rank over its coefficients ring. The FGLM data of such a ring consists of the representation matrices of all indeterminates of R computed by RepresentationOverCoefficientsRing.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> A := Q * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> F:= FGLMdata(R);
[ <A 5 x 5 matrix over an external ring>,
  <A 5 x 5 matrix over an external ring>,
  <A 5 x 5 matrix over an external ring> ]
gap> Display(F[1]);
0,0,0,1,0,
0,0,1,0,0,
0,1,0,0,0,
0,0,0,0,1,
0,0,0,1,0 
gap> Display(F[2]);
0,0,1,0,0,
0,0,0,1,0,
0,0,0,0,1,
0,1,0,0,0,
0,0,1,0,0 
gap> Display(F[3]);
0,1,0,0,0,
0,0,0,0,1,
0,0,0,1,0,
0,0,1,0,0,
0,1,0,0,0 

5.1-4 MinimalPolynomial
‣ MinimalPolynomial( r )( attribute )
‣ MinimalPolynomial( r, str )( operation )
‣ MinimalPolynomial( r, t )( operation )

Returns: a matrix

Computes the minimal polynomial of the element r of a ring R of finite rank over its coefficients ring. The installed method computes the representation matrix M of the ring element r and finds the first linear dependency among the vectors e, eM, eM^2, ..., where e is the identity of the ring.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> A := Q * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> r := "x^2+x*y+z" / R;
|[ x^2+x*y+z ]|
gap> s := "x*y+z"/ R;
|[ x*y+z ]|
gap> mu_r := MinimalPolynomial( r );
t^3-2*t^2-3*t
gap> mu_s := MinimalPolynomial( s );
t^3-4*t
gap> mu_r + mu_s;
2*t^3-2*t^2-7*t
gap> kt := HomalgRing( mu_r );
Q[t]
gap> t := Indeterminates( kt )[1];
t
gap> mu := MinimalPolynomial( r, t );
t^3-2*t^2-3*t
gap> mu = mu_r;
true
gap> mu := MinimalPolynomial( r, "t" );
t^3-2*t^2-3*t
gap> mu = mu_r;
true
gap> mu := MinimalPolynomial( r, "a" );
a^3-2*a^2-3*a

5.1-5 SquareFreeFactors
‣ SquareFreeFactors( p )( attribute )

Returns: a list

Computes the irreducible factors of the square free part of the univariate polynomial p.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> A := HomalgFieldOfRationalsInSingular() * "t";
Q[t]
gap> p := "t^3-2*t^2-3*t" / A;
t^3-2*t^2-3*t
gap> s := SquareFreeFactors( p );
[ t, t+1, t-3 ]
gap> Product( s );
t^3-2*t^2-3*t

5.1-6 SeparablePart
‣ SeparablePart( p )( attribute )

Returns: a ring element

Computes the separable part of a univariate polynomial p. For polynomials over nonperfect rings the method uses an algorithm of Kemper (see [Kem91]).

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> A := HomalgFieldOfRationalsInSingular() * "t";
Q[t]
gap> r := "t^4-t^3-5*t^2-3*t" / A;
t^4-t^3-5*t^2-3*t
gap> SquareFreeFactors( r );
[ t, t+1, t-3 ]
gap> SeparablePart( r );
t^3-2*t^2-3*t
gap> A := HomalgRingOfIntegersInSingular( 3, "t,s")* "x";
GF(3)(t,s)[x]
gap> r := "( x^3 - s ) * ( x^3 + t )" / A;
x^6+(t-s)*x^3+(-t*s)
gap> SeparablePart( r );
x^2+(t-s)*x+(-t*s)

5.1-7 BasisCoefficientsOfRingElement
‣ BasisCoefficientsOfRingElement( r )( attribute )

Returns: a matrix

Computes the coefficients of the basis representation of r, provided the ring is free of finite rank over its coefficients ring.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> A := HomalgFieldOfRationalsInSingular( ) * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> r := "x^4 * y^2 + z*x" / R;
|[ x^4*y^2+x*z ]|
gap> coeffs := BasisCoefficientsOfRingElement( r );
<A 1 x 5 matrix over an external ring>
gap> Display( coeffs );
0,0,1,0,1
gap> bas := BasisOverCoefficientsRing( R );
<A 5 x 1 matrix over a residue class ring>
gap> Display( bas );
1, 
z, 
y, 
x, 
z^2

modulo [ y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z ]
gap> s := R * coeffs * bas ;
<An unevaluated 1 x 1 matrix over a residue class ring>
gap> Display( s );
z^2+y

modulo [ y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z ]

5.1-8 IdealBasisOverCoefficientRing
‣ IdealBasisOverCoefficientRing( G )( operation )

Returns: a matrix

Computes a K-basis of an ideal generated by the entries of the matrix G over R, where K is the coefficient ring of R, using an algorithm of Sebastian Jambor (see [Jam13]).

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> A := Q * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> G := HomalgMatrix( "[ z + 1, y - 1 ]", 1, 1, R );
<A 1 x 1 matrix over a residue class ring>
gap> B := IdealBasisOverCoefficientRing( G );         
<An unevaluated 3 x 1 matrix over a residue class ring>
gap> Display( B );
z+1, 
x+y, 
z^2+z

modulo [ y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z ]

5.1-9 GapInternalIsomorphicField
‣ GapInternalIsomorphicField( K )( attribute )

Returns: a ring

Computes an isomorphic, GAP internal field, provided the field is perfect.

5.1-10 IdealBasisToGroebner
‣ IdealBasisToGroebner( M )( attribute )

Returns: a list

Computes a Groebner basis of an ideal I ⊴ R defined by a K-basis of an ideal J ⊴ R/tildeI, where K is the coefficients ring and tildeI a zero dimensional ideal. The basis elements are given in the rows of the matrix M in form of coefficient vectors with respect to the basis of the ring, which is computed by BasisOverCoefficientsRing and the matrix is defined over R/tildeI. This method works only for perfect coefficients rings K, since the reduced echelon form only accepts GAP internal rings. The method is based on an algorithm of Sebastian Jambor (see [Jam13]).

5.1-11 AppendToGroebnerBasisOfZeroDimensionalIdeal
‣ AppendToGroebnerBasisOfZeroDimensionalIdeal( G )( attribute )

Returns: a matrix

Computes a Groebner Basis of the ideal generated by the entries of the matrix G and the generators of the defining zero dimensional ideal of the residue class ring over which G is defined. If the coefficients ring K is perfect, the method uses the IdealBasisOverCoefficientsRing and IdealBasisToGroebner. If not, the method uses the usual Groebner basis algorithms, since IdealBasisToGroebner only works for perfect coefficient rings.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> A := HomalgFieldOfRationalsInSingular( ) * "x,y,z";
Q[x,y,z]
gap> I := LeftSubmodule( "y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z", A );
<A torsion-free ideal given by 6 generators>
gap> R := A/I;
Q[x,y,z]/( y*z-x, x*z-y, y^2-z^2, x*y-z, x^2-z^2, z^3-z )
gap> J := HomalgMatrix( "[z]", 1, 1, R );
<A 1 x 1 matrix over a residue class ring>
gap> mat := AppendToGroebnerBasisOfZeroDimensionalIdeal( J );
<An unevaluated 3 x 1 matrix over an external ring>
gap> Display( mat );
z,
y,
x

5.1-12 Derivative
‣ Derivative( f )( attribute )

Returns: a ring element

Computes the derivative of the univariate polynomial f.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> R := HomalgFieldOfRationalsInSingular() * "t";
Q[t]
gap> r := "t^4-t^3-5*t^2-3*t" / R;
t^4-t^3-5*t^2-3*t
gap> Derivative( r );
4*t^3-3*t^2-10*t-3
gap> S := HomalgRingOfIntegersInSingular( 3 ) * "t";
GF(3)[t]
gap> r := "t^5 + 3*t^4 - t^3 + 2*t" / S;  
t^5-t^3-t
gap> Derivative( r );
-t^4-1

5.1-13 PolysOverTheSameRing
‣ PolysOverTheSameRing( L )( attribute )

Returns: a list

Accepts a list L of polynomials which are defined over function fields, whose coefficients rings are a root of the same function field. The method computes a polynomial ring over a function field and the representations of the polynomials in L over this ring. For each polynomial ring R_j containing L_j the number e_j = R_j!.RootOfBaseField defines the embedding map R ↪ R_j: a ↦ a; t_i ↦ t_i^p^e_j} where p is the characteristic of the base field, a a field element and t_i are the rational parameters and R the common base function field. The rings R_j and R have to be technically identical, such that even the variable names coincide. The common ring S the method defines is in turn a copy of R with e_S = S!.RootOfBaseField is the least common multiply of the e_j, excluding zero. The polynomials L_j will be represented over S by taking the t_i to the power of p^e_S-e_j.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> R1 := HomalgRingOfIntegersInSingular( 3, "t,s" ) * "x";
GF(3)(t,s)[x]
gap> R1!.RootOfBaseField := 3;
3
gap> R2 := HomalgRingOfIntegersInSingular( 3, "t,s" ) * "x";
GF(3)(t,s)[x]
gap> R2!.RootOfBaseField := 2;
2
gap> r1 := "(t*s)*x^3+(s^2)*x+(t)" / R1;
(t*s)*x^3+(s^2)*x+(t)
gap> r2 := "(t)*x^2+(s)" / R2;
(t)*x^2+(s)
gap> PolysOverTheSameRing( [ r1, r2 ] );
[ (t^27*s^27)*x^3+(s^54)*x+(t^27), (t^81)*x^2+(s^81) ]
gap> R3 := HomalgRingOfIntegersInSingular( 3, "t,s" ) * "x";
GF(3)(t,s)[x]
gap> R3!.RootOfBaseField := 0;
0
gap> r3 := "(t)*x^2+(-s)*x"/ R3;
(t)*x^2+(-s)*x
gap> PolysOverTheSameRing( [ r1, r2, r3 ] );
[ (t^27*s^27)*x^3+(s^54)*x+(t^27), (t^81)*x^2+(s^81), (t^729)*x^2+(-s^729)*x ]

5.2 Operations

5.2-1 IsNotContainedInAnyHyperplane
‣ IsNotContainedInAnyHyperplane( lambda, L )( operation )

Returns: a matrix

Determines whether lambda is contained in any n - 1 dimensional subspace spanned by the rows of L.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> L := HomalgIdentityMatrix( 5, Q );
<An unevaluated 5 x 5 identity matrix over an external ring>
gap> Display( L );
1,0,0,0,0,
0,1,0,0,0,
0,0,1,0,0,
0,0,0,1,0,
0,0,0,0,1 
gap> lambda := HomalgMatrix( "[ 2,0,2,1,1]", 1, 5, Q );
<A 1 x 5 matrix over an external ring>
gap> Display( lambda );
2,0,2,1,1
gap> IsNotContainedInAnyHyperplane( lambda, L );
false
gap> lambda2 := GeneratorOfAnElementNotContainedInAnyHyperplane( L );;
gap> IsNotContainedInAnyHyperplane( lambda2, L );
true

5.2-2 GeneratorOfAnElementNotContainedInAnyHyperplane
‣ GeneratorOfAnElementNotContainedInAnyHyperplane( L )( operation )
‣ GeneratorOfAnElementNotContainedInAnyHyperplane( L, C )( operation )

Returns: a value

Generates an element of K^n, which is not contained in any n - 1 dimensional subspace of the vector field K^n, respectively C^n, spanned by the rows of L. The method repeats generating a random vector λ ∈ K^n until the method IsNotContainedInAnyHyperplan of λ and L returns true.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> Q := HomalgFieldOfRationalsInSingular( );
Q
gap> e := CertainRows( HomalgIdentityMatrix( 5, Q ), [ 1 .. 3 ] );
<An unevaluated diagonal right invertible sub-identity 3 x 5 matrix
 over an external ring>
gap> lambda := GeneratorOfAnElementNotContainedInAnyHyperplane( e );
<A non-zero left regular 1 x 5 matrix over an external ring>
gap> l := UnionOfRows( e, lambda );
<An unevaluated non-zero 4 x 5 matrix over an external ring>
gap> lambda := GeneratorOfAnElementNotContainedInAnyHyperplane( l );
<A non-zero left regular 1 x 5 matrix over an external ring>
gap> A := HomalgRingOfIntegersInSingular( 3, "t" );
GF(3)(t)
gap> S := HomalgRingOfIntegersInSingular( 3, "t" );
GF(3)(t)
gap> S!.RootOfBaseField:= 1;                       
1
gap> L := HomalgMatrix( "[ 2, t, 0, t, 0, 1 ]", 2, 3, A );
<A 2 x 3 matrix over an external ring>
gap> GeneratorOfAnElementNotContainedInAnyHyperplane( L, S );
<A 1 x 3 matrix over an external ring>

5.2-3 FGLMToGroebner
‣ FGLMToGroebner( M, e )( operation )
‣ FGLMToGroebner( M, e, l )( operation )

Returns: two lists

Computes a basis of the residue class ring and a Groebner Basis of the defining ideal, both defined by the FGLM data M and the identity element e. The method uses an algorithm of Sebastian Jambor (see [Jam13]).

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> A := HomalgFieldOfRationalsInSingular( ) * "x1,x2,x3";
Q[x1,x2,x3]
gap> I := LeftSubmodule( "x2*x3-x1, x1*x3-x2, x2^2-x3^2, x1*x2-x3, \
>                      x1^2-x3^2, x3^3-x3", A );
<A torsion-free ideal given by 6 generators>
gap> R := A / I;
Q[x1,x2,x3]/( x2*x3-x1, x1*x3-x2, x2^2-x3^2, x1*x2-x3, x1^2-x3^2, x3^3-x3 )
gap> M := FGLMdata( R );
[ <A 5 x 5 matrix over an external ring>, 
  <A 5 x 5 matrix over an external ring>, 
  <A 5 x 5 matrix over an external ring> ]
gap> e := CertainRows(
>      HomalgIdentityMatrix( NrRows( M[1] ), HomalgRing( M[1] ) ), [1] );
<An unevaluated diagonal right invertible sub-identity 1 x 5 matrix
 over an external ring>
gap> FGLMToGroebner( M, e );
[ [ 1, x3, x2, x1, x3^2 ], 
  [ -x2*x3+x1, -x2^2+x3^2, -x1*x3+x2, -x1*x2+x3, -x1^2+x3^2, -x3^3+x3 ] ]
gap> bas := BasisOverCoefficientsRing( R );
<A 5 x 1 matrix over a residue class ring>
gap> Display( bas );
1,  
x3, 
x2, 
x1, 
x3^2

modulo [ x2*x3-x1, x1*x3-x2, x2^2-x3^2, x1*x2-x3, x1^2-x3^2, x3^3-x3 ]

5.2-4 MatrixEmbedding
‣ MatrixEmbedding( M, f )( operation )

Returns: a matrix

Computes the image of the matrix M∈ K(α)^r × c) where K(α) with minimal polynomial f, under the extension field K(α) with minimal polynomial f embedding K(α)^r × c ↪ K^r deg(f) × c deg(f) which is a the natural extension of K(α )↪ K^deg(f)× deg(f): α ↦ textttCompanionMatrix(α). The method provides that the generator of the field extension α coincides withe the negativ of the constant coefficients of the minimal polynomial.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> R := HomalgRingOfIntegersInSingular( 3, "t,s" ) * "x";
GF(3)(t,s)[x]
gap> R!.RootOfBaseField:=1;
1
gap> f := "x^3 - t" / R;
x^3+(-t)
gap> p := "x^3 - s" / R;
x^3+(-s)
gap> A := CoefficientsRing( R );
GF(3)(t,s)
gap> M := HomalgMatrix( "[t*s - s, 1, 0, s]", 2, 2, A );
<A 2 x 2 matrix over an external ring>
gap> Display( M );
(t*s-s),1, 
0,      (s)
gap> N := MatrixEmbedding( M, f );
<An unevaluated non-zero 6 x 6 matrix over an external ring>
gap> Display( N );
(-s),0,   (t*s),1,  0,  0, 
(s), (-s),0,    0,  1,  0, 
0,   (s), (-s), 0,  0,  1, 
0,   0,   0,    (s),0,  0, 
0,   0,   0,    0,  (s),0, 
0,   0,   0,    0,  0,  (s)
gap> S := HomalgRingOfIntegersInSingular( 3, "t" ) * "x";
GF(3)(t)[x]
gap> S!.RootOfBaseRing := 3;
3
gap> I := LeftSubmodule( "x^2 - t^3", S );
<A principal torsion-free ideal given by a cyclic generator>
gap> L := S / I;
GF(3)(t)[x]/( x^2+(-t^3) )
gap> FGLM := FGLMdata( L );
[ <A 2 x 2 matrix over an external ring> ]
gap> Display( FGLM[1] );
0,    1,
(t^3),0
gap> f := "x^3 - t" / S;
x^3+(-t)
gap> M := MatrixEmbedding( FGLM[1] , f );
<An unevaluated non-zero 6 x 6 matrix over an external ring>
gap> Display( M );
0,  0,  0,  1,0,0,
0,  0,  0,  0,1,0,
0,  0,  0,  0,0,1,
(t),0,  0,  0,0,0,
0,  (t),0,  0,0,0,
0,  0,  (t),0,0,0 
gap> T := HomalgRing( M );
GF(3)(t)
gap> e := CertainRows( HomalgIdentityMatrix( NrRows( M ), T ), [1] );
<An unevaluated diagonal right invertible sub-identity 1 x 6 matrix
 over an external ring>
gap> FGLMToGroebner( [ M ], e );
[ [ 1, x ], [ -x^2+(t) ] ]

5.2-5 CoefficientsTransformation
‣ CoefficientsTransformation( M, deg )( operation )

Returns: a matrix

Raises the rational parameters to the power p^deg in the entries of the matrix M, where p is the characteristic of the base field.

gap> LoadPackage( "PrimaryDecomposition" );
true
gap> C := HomalgRingOfIntegersInSingular( 3, "t,s" );
GF(3)(t,s)
gap> deg := 2;
2
gap> M := HomalgMatrix( "[ t, s*t, s^2, 1 ]", 4, 1, C );
<A 4 x 1 matrix over an external ring>
gap> Display( M );
(t),  
(t*s),
(s^2),
1     
gap> coeffs := CoefficientsTransformation( M, deg );
<A 4 x 1 matrix over an external ring>
gap> Display( coeffs );
(t^9),
(t^9*s^9),
(s^18),
1         
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 Bib Ind

generated by GAPDoc2HTML