5.5-19 \*
5.5-20 \+
5.5-21 \-
5.5-22 \*
5.5-23 \=
‣ IsHomalgMatrix ( A ) | ( category ) |
Returns: true
or false
The GAP category of homalg matrices.
DeclareCategory( "IsHomalgMatrix", IsMatrixObj and IsAttributeStoringRep );
‣ IsHomalgInternalMatrixRep ( A ) | ( representation ) |
Returns: true
or false
The internal representation of homalg matrices.
(It is a representation of the GAP category IsHomalgMatrix
(5.1-1).)
‣ HomalgInitialMatrix ( m, n, R ) | ( function ) |
Returns: a homalg matrix
A mutable unevaluated initial m × n homalg matrix filled with zeros over the homalg ring R. This construction is useful in case one wants to define a matrix by assigning its nonzero entries. The property IsInitialMatrix
(5.3-26) is reset as soon as the matrix is evaluated. New computed properties or attributes of the matrix won't be cached, until the matrix is explicitly made immutable using (--> MakeImmutable
(Reference 12.6-4)).
gap> zz := HomalgRingOfIntegers( ); Z gap> z := HomalgInitialMatrix( 2, 3, zz ); <An initial 2 x 3 matrix over an internal ring> gap> HasIsZero( z ); false gap> IsZero( z ); true gap> z; <A 2 x 3 mutable matrix over an internal ring> gap> HasIsZero( z ); false
gap> n := HomalgInitialMatrix( 2, 3, zz ); <An initial 2 x 3 matrix over an internal ring> gap> n[ 1, 1 ] := "1";; gap> n[ 2, 3 ] := "1";; gap> MakeImmutable( n ); <A 2 x 3 matrix over an internal ring> gap> Display( n ); [ [ 1, 0, 0 ], [ 0, 0, 1 ] ] gap> IsZero( n ); false gap> n; <A non-zero 2 x 3 matrix over an internal ring>
‣ HomalgInitialIdentityMatrix ( m, R ) | ( function ) |
Returns: a homalg matrix
A mutable unevaluated initial m × m homalg quadratic matrix with ones on the diagonal over the homalg ring R. This construction is useful in case one wants to define an elementary matrix by assigning its off-diagonal nonzero entries. The property IsInitialIdentityMatrix
(5.3-27) is reset as soon as the matrix is evaluated. New computed properties or attributes of the matrix won't be cached, until the matrix is explicitly made immutable using (--> MakeImmutable
(Reference 12.6-4)).
gap> zz := HomalgRingOfIntegers( ); Z gap> id := HomalgInitialIdentityMatrix( 3, zz ); <An initial identity 3 x 3 matrix over an internal ring> gap> HasIsOne( id ); false gap> IsOne( id ); true gap> id; <A 3 x 3 mutable matrix over an internal ring> gap> HasIsOne( id ); false
gap> e := HomalgInitialIdentityMatrix( 3, zz ); <An initial identity 3 x 3 matrix over an internal ring> gap> e[ 1, 2 ] := "1";; gap> e[ 2, 1 ] := "-1";; gap> MakeImmutable( e ); <A 3 x 3 matrix over an internal ring> gap> Display( e ); [ [ 1, 1, 0 ], [ -1, 1, 0 ], [ 0, 0, 1 ] ] gap> IsOne( e ); false gap> e; <A 3 x 3 matrix over an internal ring>
‣ HomalgZeroMatrix ( m, n, R ) | ( function ) |
Returns: a homalg matrix
An immutable unevaluated m × n homalg zero matrix over the homalg ring R.
gap> zz := HomalgRingOfIntegers( ); Z gap> z := HomalgZeroMatrix( 2, 3, zz ); <An unevaluated 2 x 3 zero matrix over an internal ring> gap> Display( z ); [ [ 0, 0, 0 ], [ 0, 0, 0 ] ] gap> z; <A 2 x 3 zero matrix over an internal ring>
‣ HomalgIdentityMatrix ( m, R ) | ( function ) |
Returns: a homalg matrix
An immutable unevaluated m × m homalg identity matrix over the homalg ring R.
gap> zz := HomalgRingOfIntegers( ); Z gap> id := HomalgIdentityMatrix( 3, zz ); <An unevaluated 3 x 3 identity matrix over an internal ring> gap> Display( id ); [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] gap> id; <A 3 x 3 identity matrix over an internal ring>
‣ HomalgVoidMatrix ( [m, ][n, ]R ) | ( function ) |
Returns: a homalg matrix
A void m × n homalg matrix.
‣ HomalgMatrix ( llist, R ) | ( function ) |
‣ HomalgMatrix ( llist, m, n, R ) | ( function ) |
‣ HomalgMatrix ( list, m, n, R ) | ( function ) |
‣ HomalgMatrix ( str_llist, R ) | ( function ) |
‣ HomalgMatrix ( str_list, m, n, R ) | ( function ) |
Returns: a homalg matrix
An immutable evaluated m × n homalg matrix over the homalg ring R.
gap> zz := HomalgRingOfIntegers( ); Z gap> m := HomalgMatrix( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
gap> m := HomalgMatrix( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], 2, 3, zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
gap> m := HomalgMatrix( [ 1, 2, 3, 4, 5, 6 ], 2, 3, zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
gap> m := HomalgMatrix( "[ [ 1, 2, 3 ], [ 4, 5, 6 ] ]", zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
gap> m := HomalgMatrix( "[ [ 1, 2, 3 ], [ 4, 5, 6 ] ]", 2, 3, zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
It is nevertheless recommended to use the following form to create homalg matrices. This form can also be used to define external matrices. Since whitespaces (--> Reference: Whitespaces) are ignored, they can be used as optical delimiters:
gap> m := HomalgMatrix( "[ 1, 2, 3, 4, 5, 6 ]", 2, 3, zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
One can split the input string over several lines using the backslash character '\' to end each line
gap> m := HomalgMatrix( "[ \ > 1, 2, 3, \ > 4, 5, 6 \ > ]", 2, 3, zz ); <A 2 x 3 matrix over an internal ring> gap> Display( m ); [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
‣ HomalgMatrixListList ( llist, m, n, R ) | ( function ) |
Returns: a homalg matrix
Special case of HomalgMatrix
(5.2-6).
‣ HomalgRowVector ( entries, nr_cols, R ) | ( function ) |
Returns: a homalg matrix
Special case of HomalgMatrix
(5.2-6) for matrices with a single row. entries must be a list of ring elements.
‣ HomalgColumnVector ( entries, nr_rows, R ) | ( function ) |
Returns: a homalg matrix
Special case of HomalgMatrix
(5.2-6) for matrices with a single column. entries must be a list of ring elements.
‣ HomalgDiagonalMatrix ( diag, R ) | ( function ) |
Returns: a homalg matrix
An immutable unevaluated diagonal homalg matrix over the homalg ring R. The diagonal consists of the entries of the list diag.
gap> zz := HomalgRingOfIntegers( ); Z gap> d := HomalgDiagonalMatrix( [ 1, 2, 3 ], zz ); <An unevaluated diagonal 3 x 3 matrix over an internal ring> gap> Display( d ); [ [ 1, 0, 0 ], [ 0, 2, 0 ], [ 0, 0, 3 ] ] gap> d; <A diagonal 3 x 3 matrix over an internal ring>
5.2-11 \*
‣ \* ( R, mat ) | ( operation ) |
‣ \* ( mat, R ) | ( operation ) |
Returns: a homalg matrix
An immutable evaluated homalg matrix over the homalg ring R having the same entries as the matrix mat. Syntax: R *
mat or mat *
R
gap> zz := HomalgRingOfIntegers( ); Z gap> Z4 := zz / 4; Z/( 4 ) gap> Display( Z4 ); <A residue class ring> gap> d := HomalgDiagonalMatrix( [ 2 .. 4 ], zz ); <An unevaluated diagonal 3 x 3 matrix over an internal ring> gap> d2 := Z4 * d; ## or d2 := d * Z4; <A 3 x 3 matrix over a residue class ring> gap> Display( d2 ); [ [ 2, 0, 0 ], [ 0, 3, 0 ], [ 0, 0, 4 ] ] modulo [ 4 ] gap> d; <A diagonal 3 x 3 matrix over an internal ring> gap> ZeroRows( d ); [ ] gap> ZeroRows( d2 ); [ 3 ] gap> d; <A non-zero diagonal 3 x 3 matrix over an internal ring> gap> d2; <A non-zero 3 x 3 matrix over a residue class ring>
‣ CoercedMatrix ( ring_from, ring_to, mat ) | ( operation ) |
‣ CoercedMatrix ( ring_to, mat ) | ( operation ) |
Returns: a homalg matrix
A copy of the homalg matrix mat with homalg ring ring_from in the homalg ring ring_to.
(for the installed standard method see Eval
(C.4-9))
‣ IsZero ( A ) | ( property ) |
Returns: true
or false
Check if the homalg matrix A is a zero matrix, taking possible ring relations into account.
(for the installed standard method see IsZeroMatrix
(B.1-20))
gap> zz := HomalgRingOfIntegers( ); Z gap> A := HomalgMatrix( "[ 2 ]", zz ); <A 1 x 1 matrix over an internal ring> gap> Z2 := zz / 2; Z/( 2 ) gap> A := Z2 * A; <A 1 x 1 matrix over a residue class ring> gap> Display( A ); [ [ 2 ] ] modulo [ 2 ] gap> IsZero( A ); true
‣ IsOne ( A ) | ( property ) |
Returns: true
or false
Check if the homalg matrix A is an identity matrix, taking possible ring relations into account.
(for the installed standard method see IsIdentityMatrix
(B.2-2))
‣ IsUnitFree ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsPermutationMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsSpecialSubidentityMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsSubidentityMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsLeftRegular ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsRightRegular ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsInvertibleMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsLeftInvertibleMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsRightInvertibleMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsEmptyMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsDiagonalMatrix ( A ) | ( property ) |
Returns: true
or false
Check if the homalg matrix A is a diagonal matrix, taking possible ring relations into account.
(for the installed standard method see IsDiagonalMatrix
(B.2-3))
‣ IsScalarMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsUpperTriangularMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsLowerTriangularMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsStrictUpperTriangularMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsStrictLowerTriangularMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsUpperStairCaseMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsLowerStairCaseMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsTriangularMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsBasisOfRowsMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsBasisOfColumnsMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsReducedBasisOfRowsMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsReducedBasisOfColumnsMatrix ( A ) | ( property ) |
Returns: true
or false
A is a homalg matrix.
‣ IsInitialMatrix ( A ) | ( filter ) |
Returns: true
or false
A is a homalg matrix.
‣ IsInitialIdentityMatrix ( A ) | ( filter ) |
Returns: true
or false
A is a homalg matrix.
‣ IsVoidMatrix ( A ) | ( filter ) |
Returns: true
or false
A is a homalg matrix.
‣ NumberRows ( A ) | ( attribute ) |
Returns: a nonnegative integer
The number of rows of the matrix A.
(for the installed standard method see NumberRows
(B.1-21))
‣ NumberColumns ( A ) | ( attribute ) |
Returns: a nonnegative integer
The number of columns of the matrix A.
(for the installed standard method see NumberColumns
(B.1-22))
‣ DeterminantMat ( A ) | ( attribute ) |
Returns: a ring element
The determinant of the quadratic matrix A.
You can invoke it with Determinant
( A ).
(for the installed standard method see Determinant
(B.1-23))
‣ ZeroRows ( A ) | ( attribute ) |
Returns: a (possibly empty) list of positive integers
The list of zero rows of the matrix A.
(for the installed standard method see ZeroRows
(B.2-4))
‣ ZeroColumns ( A ) | ( attribute ) |
Returns: a (possibly empty) list of positive integers
The list of zero columns of the matrix A.
(for the installed standard method see ZeroColumns
(B.2-5))
‣ NonZeroRows ( A ) | ( attribute ) |
Returns: a (possibly empty) list of positive integers
The list of nonzero rows of the matrix A.
‣ NonZeroColumns ( A ) | ( attribute ) |
Returns: a (possibly empty) list of positive integers
The list of nonzero columns of the matrix A.
‣ PositionOfFirstNonZeroEntryPerRow ( A ) | ( attribute ) |
Returns: a list of nonnegative integers
The list of positions of the first nonzero entry per row of the matrix A, else zero.
‣ PositionOfFirstNonZeroEntryPerColumn ( A ) | ( attribute ) |
Returns: a list of nonnegative integers
The list of positions of the first nonzero entry per column of the matrix A, else zero.
‣ RowRankOfMatrix ( A ) | ( attribute ) |
Returns: a nonnegative integer
The row rank of the matrix A.
‣ ColumnRankOfMatrix ( A ) | ( attribute ) |
Returns: a nonnegative integer
The column rank of the matrix A.
‣ LeftInverse ( M ) | ( attribute ) |
Returns: a homalg matrix
A left inverse C of the matrix M. If no left inverse exists then false
is returned. (--> RightDivide
(5.5-51))
(for the installed standard method see LeftInverse
(5.5-2))
‣ RightInverse ( M ) | ( attribute ) |
Returns: a homalg matrix
A right inverse C of the matrix M. If no right inverse exists then false
is returned. (--> LeftDivide
(5.5-52))
(for the installed standard method see RightInverse
(5.5-3))
‣ CoefficientsOfUnreducedNumeratorOfHilbertPoincareSeries ( A ) | ( attribute ) |
Returns: a list of integers
A is a homalg matrix (row convention).
‣ CoefficientsOfNumeratorOfHilbertPoincareSeries ( A ) | ( attribute ) |
Returns: a list of integers
A is a homalg matrix (row convention).
‣ UnreducedNumeratorOfHilbertPoincareSeries ( A ) | ( attribute ) |
Returns: a univariate polynomial with rational coefficients
A is a homalg matrix (row convention).
‣ NumeratorOfHilbertPoincareSeries ( A ) | ( attribute ) |
Returns: a univariate polynomial with rational coefficients
A is a homalg matrix (row convention).
‣ HilbertPoincareSeries ( A ) | ( attribute ) |
Returns: a univariate rational function with rational coefficients
A is a homalg matrix (row convention).
‣ HilbertPolynomial ( A ) | ( attribute ) |
Returns: a univariate polynomial with rational coefficients
A is a homalg matrix (row convention).
‣ AffineDimension ( A ) | ( attribute ) |
Returns: an integer
A is a homalg matrix (row convention).
‣ AffineDegree ( A ) | ( attribute ) |
Returns: a nonnegative integer
A is a homalg matrix (row convention).
‣ ProjectiveDegree ( A ) | ( attribute ) |
Returns: a nonnegative integer
A is a homalg matrix (row convention).
‣ ConstantTermOfHilbertPolynomialn ( A ) | ( attribute ) |
Returns: an integer
A is a homalg matrix (row convention).
‣ MatrixOfSymbols ( A ) | ( attribute ) |
Returns: an integer
A is a homalg matrix.
‣ HomalgRing ( mat ) | ( operation ) |
Returns: a homalg ring
The homalg ring of the homalg matrix mat.
gap> zz := HomalgRingOfIntegers( ); Z gap> d := HomalgDiagonalMatrix( [ 2 .. 4 ], zz ); <An unevaluated diagonal 3 x 3 matrix over an internal ring> gap> R := HomalgRing( d ); Z gap> IsIdenticalObj( R, zz ); true
‣ LeftInverse ( RI ) | ( method ) |
Returns: a homalg matrix or fail
The left inverse of the matrix RI. The lazy version of this operation is LeftInverseLazy
(5.5-4). (--> RightDivide
(5.5-51))
InstallMethod( LeftInverse, "for homalg matrices", [ IsHomalgMatrix ], function( RI ) local Id, LI; Id := HomalgIdentityMatrix( NumberColumns( RI ), HomalgRing( RI ) ); LI := RightDivide( Id, RI ); ## ( cf. [BR08, Subsection 3.1.3] ) ## CAUTION: for the following SetXXX RightDivide is assumed ## NOT to be lazy evaluated!!! SetIsLeftInvertibleMatrix( RI, IsHomalgMatrix( LI ) ); if IsBool( LI ) then return fail; fi; if HasIsInvertibleMatrix( RI ) and IsInvertibleMatrix( RI ) then SetIsInvertibleMatrix( LI, true ); else SetIsRightInvertibleMatrix( LI, true ); fi; SetRightInverse( LI, RI ); SetNumberColumns( LI, NumberRows( RI ) ); if NumberRows( RI ) = NumberColumns( RI ) then ## a left inverse of a ring element is unique ## and coincides with the right inverse SetRightInverse( RI, LI ); SetLeftInverse( LI, RI ); fi; return LI; end );
‣ RightInverse ( LI ) | ( method ) |
Returns: a homalg matrix or fail
The right inverse of the matrix LI. The lazy version of this operation is RightInverseLazy
(5.5-5). (--> LeftDivide
(5.5-52))
InstallMethod( RightInverse, "for homalg matrices", [ IsHomalgMatrix ], function( LI ) local Id, RI; Id := HomalgIdentityMatrix( NumberRows( LI ), HomalgRing( LI ) ); RI := LeftDivide( LI, Id ); ## ( cf. [BR08, Subsection 3.1.3] ) ## CAUTION: for the following SetXXX LeftDivide is assumed ## NOT to be lazy evaluated!!! SetIsRightInvertibleMatrix( LI, IsHomalgMatrix( RI ) ); if IsBool( RI ) then return fail; fi; if HasIsInvertibleMatrix( LI ) and IsInvertibleMatrix( LI ) then SetIsInvertibleMatrix( RI, true ); else SetIsLeftInvertibleMatrix( RI, true ); fi; SetLeftInverse( RI, LI ); SetNumberRows( RI, NumberColumns( LI ) ); if NumberRows( LI ) = NumberColumns( LI ) then ## a right inverse of a ring element is unique ## and coincides with the left inverse SetLeftInverse( LI, RI ); SetRightInverse( RI, LI ); fi; return RI; end );
‣ LeftInverseLazy ( M ) | ( operation ) |
Returns: a homalg matrix
A lazy evaluated left inverse C of the matrix M. If no left inverse exists then Eval
( C ) will issue an error.
(for the installed standard method see Eval
(C.4-5))
‣ RightInverseLazy ( M ) | ( operation ) |
Returns: a homalg matrix
A lazy evaluated right inverse C of the matrix M. If no right inverse exists then Eval
( C ) will issue an error.
(for the installed standard method see Eval
(C.4-6))
‣ Involution ( M ) | ( method ) |
Returns: a homalg matrix
The twisted transpose of the homalg matrix M. If the underlying ring is commutative, the twist is the identity.
(for the installed standard method see Eval
(C.4-7))
‣ TransposedMatrix ( M ) | ( method ) |
Returns: a homalg matrix
The transpose of the homalg matrix M.
(for the installed standard method see Eval
(C.4-8))
‣ CertainRows ( M, plist ) | ( method ) |
Returns: a homalg matrix
The matrix of which the i-th row is the k-th row of the homalg matrix M, where k=plist[i].
(for the installed standard method see Eval
(C.4-10))
‣ CertainColumns ( M, plist ) | ( method ) |
Returns: a homalg matrix
The matrix of which the j-th column is the l-th column of the homalg matrix M, where l=plist[j].
(for the installed standard method see Eval
(C.4-11))
‣ UnionOfRows ( [R, nr_cols, ]L ) | ( function ) |
Returns: a homalg matrix
Stack the homalg matrices in the list L. The entries of L must be matrices over the homalg ring R with nr_cols columns. If L is non-empty, R and nr_cols can be omitted.
(for the installed standard method see Eval
(C.4-12))
‣ UnionOfColumns ( [R, nr_rows, ]L ) | ( function ) |
Returns: a homalg matrix
Augment the homalg matrices in the list L. The entries of L must be matrices over the homalg ring R with nr_rows rows. If L is non-empty, R and nr_rows can be omitted.
(for the installed standard method see Eval
(C.4-13))
‣ ConvertRowToMatrix ( M, r, c ) | ( method ) |
Returns: a homalg matrix
Fold the row M to an rxc-matrix.
‣ ConvertColumnToMatrix ( M, r, c ) | ( method ) |
Returns: a homalg matrix
Fold the column M to an rxc-matrix.
‣ ConvertMatrixToRow ( M ) | ( method ) |
Returns: a homalg matrix
Unfold the matrix M row-wise into a row.
‣ ConvertMatrixToColumn ( M ) | ( method ) |
Returns: a homalg matrix
Unfold the matrix M column-wise into a column.
‣ DiagMat ( [R, ]list ) | ( method ) |
Returns: a homalg matrix
Build the block diagonal matrix out of the homalg matrices listed in list. If list is non-empty, R can be omitted.
(for the installed standard method see Eval
(C.4-14))
‣ KroneckerMat ( A, B ) | ( method ) |
Returns: a homalg matrix
The Kronecker (or tensor) product of the two homalg matrices A and B.
(for the installed standard method see Eval
(C.4-15))
‣ DualKroneckerMat ( A, B ) | ( method ) |
Returns: a homalg matrix
The dual Kronecker product of the two homalg matrices A and B.
(for the installed standard method see Eval
(C.4-16))
5.5-19 \*
‣ \* ( a, A ) | ( method ) |
Returns: a homalg matrix
The product of the ring element a with the homalg matrix A (enter: a *
A;).
(for the installed standard method see Eval
(C.4-17))
5.5-20 \+
‣ \+ ( A, B ) | ( method ) |
Returns: a homalg matrix
The sum of the two homalg matrices A and B (enter: A +
B;).
(for the installed standard method see Eval
(C.4-18))
5.5-21 \-
‣ \- ( A, B ) | ( method ) |
Returns: a homalg matrix
The difference of the two homalg matrices A and B (enter: A -
B;).
(for the installed standard method see Eval
(C.4-19))
5.5-22 \*
‣ \* ( A, B ) | ( method ) |
Returns: a homalg matrix
The matrix product of the two homalg matrices A and B (enter: A *
B;).
(for the installed standard method see Eval
(C.4-20))
5.5-23 \=
‣ \= ( A, B ) | ( operation ) |
Returns: true
or false
Check if the homalg matrices A and B are equal (enter: A =
B;), taking possible ring relations into account.
(for the installed standard method see AreEqualMatrices
(B.2-1))
gap> zz := HomalgRingOfIntegers( ); Z gap> A := HomalgMatrix( "[ 1 ]", zz ); <A 1 x 1 matrix over an internal ring> gap> B := HomalgMatrix( "[ 3 ]", zz ); <A 1 x 1 matrix over an internal ring> gap> Z2 := zz / 2; Z/( 2 ) gap> A := Z2 * A; <A 1 x 1 matrix over a residue class ring> gap> B := Z2 * B; <A 1 x 1 matrix over a residue class ring> gap> Display( A ); [ [ 1 ] ] modulo [ 2 ] gap> Display( B ); [ [ 3 ] ] modulo [ 2 ] gap> A = B; true
‣ GetColumnIndependentUnitPositions ( A, poslist ) | ( operation ) |
Returns: a (possibly empty) list of pairs of positive integers
The list of column independet unit position of the matrix A. We say that a unit A[i,k] is column independet from the unit A[l,j] if i>l and A[l,k]=0. The rows are scanned from top to bottom and within each row the columns are scanned from right to left searching for new units, column independent from the preceding ones. If A[i,k] is a new column independent unit then [i,k] is added to the output list. If A has no units the empty list is returned.
(for the installed standard method see GetColumnIndependentUnitPositions
(B.2-6))
‣ GetRowIndependentUnitPositions ( A, poslist ) | ( operation ) |
Returns: a (possibly empty) list of pairs of positive integers
The list of row independet unit position of the matrix A. We say that a unit A[k,j] is row independet from the unit A[i,l] if j>l and A[k,l]=0. The columns are scanned from left to right and within each column the rows are scanned from bottom to top searching for new units, row independent from the preceding ones. If A[k,j] is a new row independent unit then [j,k] (yes [j,k]) is added to the output list. If A has no units the empty list is returned.
(for the installed standard method see GetRowIndependentUnitPositions
(B.2-7))
‣ GetUnitPosition ( A, poslist ) | ( operation ) |
Returns: a (possibly empty) list of pairs of positive integers
The position [i,j] of the first unit A[i,j] in the matrix A, where the rows are scanned from top to bottom and within each row the columns are scanned from left to right. If A[i,j] is the first occurrence of a unit then the position pair [i,j] is returned. Otherwise fail
is returned.
(for the installed standard method see GetUnitPosition
(B.2-8))
‣ Eliminate ( rel, indets ) | ( operation ) |
Returns: a homalg matrix
Eliminate the independents indets from the matrix (or list of ring elements) rel, i.e. compute a generating set of the ideal defined as the intersection of the ideal generated by the entries of the list rel with the subring generated by all indeterminates except those in indets. by the list of indeterminates indets.
‣ BasisOfRowModule ( M ) | ( operation ) |
Returns: a homalg matrix
Let R be the ring over which M is defined (R:=HomalgRing
( M )) and S be the row span of M, i.e. the R-submodule of the free left module R^(1 × NumberColumns( M )) spanned by the rows of M. A solution to the submodule membership problem
is an algorithm which can decide if an element m in R^(1 × NumberColumns( M )) is contained in S or not. And exactly like the Gaussian (resp. Hermite) normal form when R is a field (resp. principal ideal ring), the row span of the resulting matrix B coincides with the row span S of M, and computing B is typically the first step of such an algorithm. (--> Appendix A)
‣ BasisOfColumnModule ( M ) | ( operation ) |
Returns: a homalg matrix
Let R be the ring over which M is defined (R:=HomalgRing
( M )) and S be the column span of M, i.e. the R-submodule of the free right module R^(NumberRows( M ) × 1) spanned by the columns of M. A solution to the submodule membership problem
is an algorithm which can decide if an element m in R^(NumberRows( M ) × 1) is contained in S or not. And exactly like the Gaussian (resp. Hermite) normal form when R is a field (resp. principal ideal ring), the column span of the resulting matrix B coincides with the column span S of M, and computing B is typically the first step of such an algorithm. (--> Appendix A)
‣ DecideZeroRows ( A, B ) | ( operation ) |
Returns: a homalg matrix
Let A and B be matrices having the same number of columns and defined over the same ring R (:=HomalgRing
( A )) and S be the row span of B, i.e. the R-submodule of the free left module R^(1 × NumberColumns( B )) spanned by the rows of B. The result is a matrix C having the same shape as A, for which the i-th row C^i is equivalent to the i-th row A^i of A modulo S, i.e. C^i-A^i is an element of the row span S of B. Moreover, the row C^i is zero, if and only if the row A^i is an element of S. So DecideZeroRows
decides which rows of A are zero modulo the rows of B. (--> Appendix A)
‣ DecideZeroColumns ( A, B ) | ( operation ) |
Returns: a homalg matrix
Let A and B be matrices having the same number of rows and defined over the same ring R (:=HomalgRing
( A )) and S be the column span of B, i.e. the R-submodule of the free right module R^(NumberRows( B ) × 1) spanned by the columns of B. The result is a matrix C having the same shape as A, for which the i-th column C_i is equivalent to the i-th column A_i of A modulo S, i.e. C_i-A_i is an element of the column span S of B. Moreover, the column C_i is zero, if and only if the column A_i is an element of S. So DecideZeroColumns
decides which columns of A are zero modulo the columns of B. (--> Appendix A)
‣ SyzygiesGeneratorsOfRows ( M ) | ( operation ) |
Returns: a homalg matrix
Let R be the ring over which M is defined (R:=HomalgRing
( M )). The matrix of row syzygies SyzygiesGeneratorsOfRows
( M ) is a matrix whose rows span the left kernel of M, i.e. the R-submodule of the free left module R^(1 × NumberRows( M )) consisting of all rows X satisfying XM=0. (--> Appendix A)
‣ SyzygiesGeneratorsOfColumns ( M ) | ( operation ) |
Returns: a homalg matrix
Let R be the ring over which M is defined (R:=HomalgRing
( M )). The matrix of column syzygies SyzygiesGeneratorsOfColumns
( M ) is a matrix whose columns span the right kernel of M, i.e. the R-submodule of the free right module R^(NumberColumns( M ) × 1) consisting of all columns X satisfying MX=0. (--> Appendix A)
‣ SyzygiesGeneratorsOfRows ( M, M2 ) | ( operation ) |
Returns: a homalg matrix
Let R be the ring over which M is defined (R:=HomalgRing
( M )). The matrix of relative row syzygies SyzygiesGeneratorsOfRows
( M, M2 ) is a matrix whose rows span the left kernel of M modulo M2, i.e. the R-submodule of the free left module R^(1 × NumberRows( M )) consisting of all rows X satisfying XM+YM2=0 for some row Y ∈ R^(1 × NumberRows( M2 )). (--> Appendix A)
‣ SyzygiesGeneratorsOfColumns ( M, M2 ) | ( operation ) |
Returns: a homalg matrix
Let R be the ring over which M is defined (R:=HomalgRing
( M )). The matrix of relative column syzygies SyzygiesGeneratorsOfColumns
( M, M2 ) is a matrix whose columns span the right kernel of M modulo M2, i.e. the R-submodule of the free right module R^(NumberColumns( M ) × 1) consisting of all columns X satisfying MX+M2Y=0 for some column Y ∈ R^(NumberColumns( M2 ) × 1). (--> Appendix A)
‣ ReducedBasisOfRowModule ( M ) | ( operation ) |
Returns: a homalg matrix
Like BasisOfRowModule
( M ) but where the matrix SyzygiesGeneratorsOfRows
( ReducedBasisOfRowModule
( M ) ) contains no units. This can easily be achieved starting from B:=BasisOfRowModule
( M ) (and using GetColumnIndependentUnitPositions
(5.5-24) applied to the matrix of row syzygies of B, etc). (--> Appendix A)
‣ ReducedBasisOfColumnModule ( M ) | ( operation ) |
Returns: a homalg matrix
Like BasisOfColumnModule
( M ) but where the matrix SyzygiesGeneratorsOfColumns
( ReducedBasisOfColumnModule
( M ) ) contains no units. This can easily be achieved starting from B:=BasisOfColumnModule
( M ) (and using GetRowIndependentUnitPositions
(5.5-25) applied to the matrix of column syzygies of B, etc.). (--> Appendix A)
‣ ReducedSyzygiesGeneratorsOfRows ( M ) | ( operation ) |
Returns: a homalg matrix
Like SyzygiesGeneratorsOfRows
( M ) but where the matrix SyzygiesGeneratorsOfRows
( ReducedSyzygiesGeneratorsOfRows
( M ) ) contains no units. This can easily be achieved starting from C:=SyzygiesGeneratorsOfRows
( M ) (and using GetColumnIndependentUnitPositions
(5.5-24) applied to the matrix of row syzygies of C, etc.). (--> Appendix A)
‣ ReducedSyzygiesGeneratorsOfColumns ( M ) | ( operation ) |
Returns: a homalg matrix
Like SyzygiesGeneratorsOfColumns
( M ) but where the matrix SyzygiesGeneratorsOfColumns
( ReducedSyzygiesGeneratorsOfColumns
( M ) ) contains no units. This can easily be achieved starting from C:=SyzygiesGeneratorsOfColumns
( M ) (and using GetRowIndependentUnitPositions
(5.5-25) applied to the matrix of column syzygies of C, etc.). (--> Appendix A)
‣ BasisOfRowsCoeff ( M, T ) | ( operation ) |
Returns: a homalg matrix
Returns B:=BasisOfRowModule
( M ) and assigns the void matrix T (--> HomalgVoidMatrix
(5.2-5)) such that B = T M. (--> Appendix A)
‣ BasisOfColumnsCoeff ( M, T ) | ( operation ) |
Returns: a homalg matrix
Returns B:=BasisOfRowModule
( M ) and assigns the void matrix T (--> HomalgVoidMatrix
(5.2-5)) such that B = M T. (--> Appendix A)
‣ DecideZeroRowsEffectively ( A, B, T ) | ( operation ) |
Returns: a homalg matrix
Returns M:=DecideZeroRows
( A, B ) and assigns the void matrix T (--> HomalgVoidMatrix
(5.2-5)) such that M = A + TB. (--> Appendix A)
‣ DecideZeroColumnsEffectively ( A, B, T ) | ( operation ) |
Returns: a homalg matrix
Returns M:=DecideZeroColumns
( A, B ) and assigns the void matrix T (--> HomalgVoidMatrix
(5.2-5)) such that M = A + BT. (--> Appendix A)
‣ BasisOfRows ( M ) | ( operation ) |
‣ BasisOfRows ( M, T ) | ( operation ) |
Returns: a homalg matrix
With one argument it is a synonym of BasisOfRowModule
(5.5-28). with two arguments it is a synonym of BasisOfRowsCoeff
(5.5-40).
‣ BasisOfColumns ( M ) | ( operation ) |
‣ BasisOfColumns ( M, T ) | ( operation ) |
Returns: a homalg matrix
With one argument it is a synonym of BasisOfColumnModule
(5.5-29). with two arguments it is a synonym of BasisOfColumnsCoeff
(5.5-41).
‣ DecideZero ( mat, rel ) | ( operation ) |
Returns: a homalg matrix
InstallMethod( DecideZero, "for sets of ring relations", [ IsHomalgMatrix, IsHomalgRingRelations ], function( mat, rel ) return DecideZero( mat, MatrixOfRelations( rel ) ); end );
‣ SyzygiesOfRows ( M ) | ( operation ) |
‣ SyzygiesOfRows ( M, M2 ) | ( operation ) |
Returns: a homalg matrix
With one argument it is a synonym of SyzygiesGeneratorsOfRows
(5.5-32). with two arguments it is a synonym of SyzygiesGeneratorsOfRows
(5.5-34).
‣ SyzygiesOfColumns ( M ) | ( operation ) |
‣ SyzygiesOfColumns ( M, M2 ) | ( operation ) |
Returns: a homalg matrix
With one argument it is a synonym of SyzygiesGeneratorsOfColumns
(5.5-33). with two arguments it is a synonym of SyzygiesGeneratorsOfColumns
(5.5-35).
‣ ReducedSyzygiesOfRows ( M ) | ( operation ) |
‣ ReducedSyzygiesOfRows ( M, M2 ) | ( operation ) |
Returns: a homalg matrix
With one argument it is a synonym of ReducedSyzygiesGeneratorsOfRows
(5.5-38). With two arguments it calls ReducedBasisOfRowModule
( SyzygiesGeneratorsOfRows
( M, M2 ) ). (--> ReducedBasisOfRowModule
(5.5-36) and SyzygiesGeneratorsOfRows
(5.5-34))
‣ ReducedSyzygiesOfColumns ( M ) | ( operation ) |
‣ ReducedSyzygiesOfColumns ( M, M2 ) | ( operation ) |
Returns: a homalg matrix
With one argument it is a synonym of ReducedSyzygiesGeneratorsOfColumns
(5.5-39). With two arguments it calls ReducedBasisOfColumnModule
( SyzygiesGeneratorsOfColumns
( M, M2 ) ). (--> ReducedBasisOfColumnModule
(5.5-37) and SyzygiesGeneratorsOfColumns
(5.5-35))
‣ RightDivide ( B, A ) | ( operation ) |
Returns: a homalg matrix or fail
Let B and A be matrices having the same number of columns and defined over the same ring. The matrix RightDivide
( B, A ) is a particular solution of the inhomogeneous (one sided) linear system of equations XA=B in case it is solvable. Otherwise fail
is returned. The name RightDivide
suggests X=BA^-1
. This generalizes LeftInverse
(5.5-2) for which B becomes the identity matrix. (--> SyzygiesGeneratorsOfRows
(5.5-32))
‣ LeftDivide ( A, B ) | ( operation ) |
Returns: a homalg matrix or fail
Let A and B be matrices having the same number of rows and defined over the same ring. The matrix LeftDivide
( A, B ) is a particular solution of the inhomogeneous (one sided) linear system of equations AX=B in case it is solvable. Otherwise fail
is returned. The name LeftDivide
suggests X=A^-1B
. This generalizes RightInverse
(5.5-3) for which B becomes the identity matrix. (--> SyzygiesGeneratorsOfColumns
(5.5-33))
‣ RightDivide ( B, A, L ) | ( operation ) |
Returns: a homalg matrix or fail
Let B, A and L be matrices having the same number of columns and defined over the same ring. The matrix RightDivide
( B, A, L ) is a particular solution of the inhomogeneous (one sided) linear system of equations XA+YL=B in case it is solvable (for some Y which is forgotten). Otherwise fail
is returned. The name RightDivide
suggests X=BA^-1 modulo L
. (Cf. [BR08, Subsection 3.1.1])
InstallMethod( RightDivide, "for homalg matrices", [ IsHomalgMatrix, IsHomalgMatrix, IsHomalgMatrix ], function( B, A, L ) ## CAUTION: Do not use lazy evaluation here!!! local R, BL, ZA, AL, ZB, T, B_; R := HomalgRing( B ); BL := BasisOfRows( L ); ## first reduce A modulo L ZA := DecideZeroRows( A, BL ); AL := UnionOfRows( ZA, BL ); ## also reduce B modulo L ZB := DecideZeroRows( B, BL ); ## B_ = ZB + T * AL T := HomalgVoidMatrix( R ); B_ := DecideZeroRowsEffectively( ZB, AL, T ); ## if B_ does not vanish if not IsZero( B_ ) then return fail; fi; T := CertainColumns( T, [ 1 .. NumberRows( A ) ] ); ## check assertion Assert( 5, IsZero( DecideZeroRows( B + T * A, BL ) ) ); return -T; end );
‣ LeftDivide ( A, B, L ) | ( operation ) |
Returns: a homalg matrix or fail
Let A, B and L be matrices having the same number of columns and defined over the same ring. The matrix LeftDivide
( A, B, L ) is a particular solution of the inhomogeneous (one sided) linear system of equations AX+LY=B in case it is solvable (for some Y which is forgotten). Otherwise fail
is returned. The name LeftDivide
suggests X=A^-1B modulo L
. (Cf. [BR08, Subsection 3.1.1])
InstallMethod( LeftDivide, "for homalg matrices", [ IsHomalgMatrix, IsHomalgMatrix, IsHomalgMatrix ], function( A, B, L ) ## CAUTION: Do not use lazy evaluation here!!! local R, BL, ZA, AL, ZB, T, B_; R := HomalgRing( B ); BL := BasisOfColumns( L ); ## first reduce A modulo L ZA := DecideZeroColumns( A, BL ); AL := UnionOfColumns( ZA, BL ); ## also reduce B modulo L ZB := DecideZeroColumns( B, BL ); ## B_ = ZB + AL * T T := HomalgVoidMatrix( R ); B_ := DecideZeroColumnsEffectively( ZB, AL, T ); ## if B_ does not vanish if not IsZero( B_ ) then return fail; fi; T := CertainRows( T, [ 1 .. NumberColumns( A ) ] ); ## check assertion Assert( 5, IsZero( DecideZeroColumns( B + A * T, BL ) ) ); return -T; end );
‣ SafeRightDivide ( B, A ) | ( operation ) |
Returns: a homalg matrix
Same as RightDivide
(5.5-51), but asserts that the result is not fail
.
‣ SafeLeftDivide ( A, B ) | ( operation ) |
Returns: a homalg matrix
Same as LeftDivide
(5.5-52), but asserts that the result is not fail
.
‣ UniqueRightDivide ( B, A ) | ( operation ) |
Returns: a homalg matrix
Same as SafeRightDivide
(5.5-55), but asserts at assertion level 5 that the solution is unique.
‣ UniqueLeftDivide ( A, B ) | ( operation ) |
Returns: a homalg matrix
Same as SafeLeftDivide
(5.5-56), but asserts at assertion level 5 that the solution is unique.
‣ GenerateSameRowModule ( M, N ) | ( operation ) |
Returns: true
or false
Check if the row span of M and of N are identical or not (--> RightDivide
(5.5-51)).
‣ GenerateSameColumnModule ( M, N ) | ( operation ) |
Returns: true
or false
Check if the column span of M and of N are identical or not (--> LeftDivide
(5.5-52)).
‣ SimplifyHomalgMatrixByLeftAndRightMultiplicationWithInvertibleMatrices ( M ) | ( operation ) |
Returns: a list of 5 homalg matrices
The input is a homalg matrix M. The output is a 5-tuple of homalg matrices S, U, V, UI, VI, such that U M V = S. Moreover, U and V are invertible with inverses UI, VI, respectively. The idea is that the matrix S should look "simpler" than M.
‣ SimplifyHomalgMatrixByLeftMultiplicationWithInvertibleMatrix ( M ) | ( operation ) |
Returns: a list of 3 homalg matrices
The input is a homalg matrix M. The output is a 3-tuple of homalg matrices S, T, TI such that T M = S. Moreover, T is invertible with inverse TI. The idea is that the matrix S should look "simpler" than M.
‣ SimplifyHomalgMatrixByRightMultiplicationWithInvertibleMatrix ( M ) | ( operation ) |
Returns: a list of 3 homalg matrices
The input is a homalg matrix M. The output is a 3-tuple of homalg matrices S, T, TI such that M T = S. Moreover, T is invertible with inverse TI. The idea is that the matrix S should look "simpler" than M.
‣ CoefficientsWithGivenMonomials ( M, monomials ) | ( method ) |
Returns: a homalg matrix
Let R := HomalgRing(
M)
. monomials
must be a homalg matrix with the same number of columns as M
consisting of monomials of R
. This method computes a homalg matrix coeffs
(with entries in the coefficients ring of R
, yet still considered as elements of R
) such that M = coeffs * monomials
. If no such matrix exists, the behavior is undefined. If the first argument is a homalg ring element, it is viewed as a homalg matrix with a single entry. If the second argument is a list of monomials, it is viewed as a column matrix with the list elements as entries.
generated by GAPDoc2HTML