MatricesForHomalg

Documentation for MatricesForHomalg.

Base.:*Method
R * mat

Rewrite the matrix mat over the ring R (if possible)

julia> mat = HomalgMatrix([1,2,3,4,5,6], 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> QQ * mat
[1   2   3]
[4   5   6]

julia> qmat = QQ * mat
[1   2   3]
[4   5   6]

julia> ZZ * qmat == mat
true
source
MatricesForHomalg.BasisOfColumnsMethod
BasisOfColumns(mat)

Return the triangular form of mat

julia> mat = HomalgMatrix(1:9, 3, 3, ZZ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> BasisOfColumns(mat)
[1   0]
[1   3]
[1   6]

julia> mat = HomalgMatrix(1:9, 3, 3, QQ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> BasisOfColumns(mat)
[ 1   0]
[ 0   1]
[-1   2]
source
MatricesForHomalg.BasisOfRowsMethod
BasisOfRows(mat)

Return the triangular form of mat

julia> mat = HomalgMatrix(1:9, 3, 3, ZZ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> BasisOfRows(mat)
[1   2   3]
[0   3   6]

julia> mat = HomalgMatrix(1:9, 3, 3, QQ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> BasisOfRows(mat)
[1   0   -1]
[0   1    2]
source
MatricesForHomalg.CertainColumnsMethod
CertainColumns(mat, list)

Return the matrix of which the i-th column is the k-th column of the homalg matrix M, where k=list[i].

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> CertainColumns(mat, [2, 2, 1])
[2   2   1]
[5   5   4]

julia> CertainColumns(mat, [])
2 by 0 empty matrix

julia> CertainColumns(mat, 4:3)
2 by 0 empty matrix
source
MatricesForHomalg.CertainRowsMethod
CertainRows(mat, list)

Return the matrix of which the i-th row is the k-th row of the homalg matrix M, where k=list[i].

julia> mat = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> CertainRows(mat, [2, 2, 1])
[4   5]
[4   5]
[2   3]

julia> CertainRows(mat, [])
0 by 2 empty matrix

julia> CertainRows(mat, 4:3)
0 by 2 empty matrix
source
MatricesForHomalg.ColumnRankOfMatrixMethod
ColumnRankOfMatrix(mat)

Returns the column rank of the matrix mat as a nonnegative integer.

julia> mat1 = TransposedMatrix(HomalgMatrix(4:9, 3, 2, ZZ))
[4   6   8]
[5   7   9]

julia> ColumnRankOfMatrix(mat1)
2

julia> mat2 = HomalgIdentityMatrix(3, ZZ)
[1   0   0]
[0   1   0]
[0   0   1]

julia> ColumnRankOfMatrix(mat2)
3
source
MatricesForHomalg.ConvertMatrixToColumnMethod
ConvertMatrixToColumn(mat)

Unfold the matrix M column-wise into a column.

julia> mat = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> ConvertMatrixToColumn(mat)
[2]
[4]
[6]
[3]
[5]
[7]
source
MatricesForHomalg.ConvertMatrixToRowMethod
ConvertMatrixToRow(mat)

Unfold the matrix M row-wise into a row.

julia> mat = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> ConvertMatrixToRow(mat)
[2   3   4   5   6   7]
source
MatricesForHomalg.DecideZeroColumnsMethod
DecideZeroColumns(B, A)

Returns: a homalg matrix

Let B and A be matrices having the same number of rows and defined over the same ring R and S be the column span of A, i.e. the R-submodule of the free right module R(NrRows(A)×1) spanned by the columns of A. The result is a matrix B′ having the same shape as B, for which the i-th column B′i is equivalent to the i-th column Bi of B modulo S, i.e. B′i−Bi is an element of the column span S of A. Moreover, the column B′i is zero, if and only if the column Bi is an element of S. So DecideZeroColumns decides which columns of B are zero modulo the columns of A.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix([3, 1, 7, 1, 11, 1], 3, 2, ZZ)
[ 3   1]
[ 7   1]
[11   1]

julia> DecideZeroColumns(B, A)
[0   0]
[0   0]
[0   0]
source
MatricesForHomalg.DecideZeroRowsMethod
DecideZeroRows(B, A)

Returns: a homalg matrix

Let B and A be matrices having the same number of columns and defined over the same ring R and S be the row span of A, i.e. the R-submodule of the free left module R(1×NrColumns(A)) spanned by the rows of A. The result is a matrix B′ having the same shape as B, for which the i-th row B′^i is equivalent to the i-th row B^i of B modulo S, i.e. B′^i−B^i is an element of the row span S of A. Moreover, the row B′^i is zero, if and only if the row B^i is an element of S. So DecideZeroRows decides which rows of B are zero modulo the rows of A.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> A′ = DecideZeroRows(B, A)
[0   1]
[0   1]
[0   1]

julia> RightDivide(B, A)
"fail"

julia> RightDivide(B - A′, A)
[0   -1   1]
[0   -2   2]
[0   -3   3]

julia> DecideZeroRows(A, A)
[0   0]
[0   0]
[0   0]

julia> C = HomalgMatrix([4, 6, 2, 2], 2, 2, ZZ)
[4   6]
[2   2]

julia> DecideZeroRows(C, A)
[0   0]
[0   0]

julia> DecideZeroRows(A, C)
[1   0]
[1   0]
[1   0]
source
MatricesForHomalg.FirstZeroColumnMethod
FirstZeroColumn(mat)

Return a positive integer of the first zero column.

julia> mat = HomalgMatrix(4:9, 2, 3, ZZ)
[4   5   6]
[7   8   9]

julia> FirstZeroColumn(mat)
4

julia> mat = HomalgMatrix([0, 2, 0, 0, 0, 0], 2, 3, ZZ)
[0   2   0]
[0   0   0]

julia> FirstZeroColumn(mat)
1

julia> mat = HomalgZeroMatrix(3,3,ZZ)
[0   0   0]
[0   0   0]
[0   0   0]

julia> FirstZeroColumn(mat)
1
source
MatricesForHomalg.FirstZeroRowMethod
FirstZeroRow(mat)

Return a positive integer of the first zero row.

julia> mat = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> FirstZeroRow(mat)
4

julia> mat = HomalgMatrix([0, 2, 6, 0, 0, 0], 3, 2, ZZ)
[0   2]
[6   0]
[0   0]

julia> FirstZeroRow(mat)
3

julia> mat = HomalgMatrix([0, 0, 6, 0, 0, 0], 3, 2, ZZ)
[0   0]
[6   0]
[0   0]

julia> FirstZeroRow(mat)
1
source
MatricesForHomalg.HomalgColumnVectorMethod
HomalgColumnVector(L, r, R)

Construct a (r x 1)-matrix over the ring R with entries in the list L

julia> mat = HomalgColumnVector(1:5, 5, ZZ)
[1]
[2]
[3]
[4]
[5]
source
MatricesForHomalg.HomalgColumnVectorMethod
HomalgColumnVector(L, r, R)

Construct a (r x 1)-matrix over the ring R with entries in the list L, where r = length(L)

julia> mat = HomalgColumnVector(1:5, ZZ)
[1]
[2]
[3]
[4]
[5]
source
MatricesForHomalg.HomalgDiagonalMatrixMethod
HomalgDiagonalMatrix(L, R)

Construct a diagonal matrix over the ring R using the list L of diagonal entries

julia> mat = HomalgDiagonalMatrix(1:5, ZZ)
[1   0   0   0   0]
[0   2   0   0   0]
[0   0   3   0   0]
[0   0   0   4   0]
[0   0   0   0   5]
source
MatricesForHomalg.HomalgMatrixMethod
HomalgMatrix(L, r, c, R)

Construct a (r x c)-matrix over the ring R with L as list of entries

julia> mat1 = HomalgMatrix([1,2,3,4,5,6], 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> mat2 = HomalgMatrix([[1,2,3],[4,5,6]], 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> mat1 == mat2
true
source
MatricesForHomalg.HomalgRingMethod
HomalgRing(mat)

Return the ring underlying the matrix mat.

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> HomalgRing(mat)
Integer ring

julia> mat = HomalgMatrix(1:6, 2, 3, QQ)
[1   2   3]
[4   5   6]

julia> HomalgRing(mat)
Rational field
source
MatricesForHomalg.HomalgRowVectorMethod
HomalgRowVector(L, c, R)

Construct a (1 x c)-matrix over the ring R with entries in the list L

julia> mat = HomalgRowVector(1:5, 5, ZZ)
[1   2   3   4   5]
source
MatricesForHomalg.HomalgRowVectorMethod
HomalgRowVector(L, R)

Construct a (1 x c)-matrix over the ring R with entries in the list L, where c = length(L)

julia> mat = HomalgRowVector(1:5, ZZ)
[1   2   3   4   5]
source
MatricesForHomalg.IsEmptyMatrixMethod
IsEmptyMatrix(mat)

Return true if mat does not contain any entry, otherwise false

julia> mat = HomalgMatrix([], 0, 0, ZZ)
0 by 0 empty matrix

julia> IsEmptyMatrix(mat)
true
source
MatricesForHomalg.IsOneMethod
IsOne(mat)

Return true if mat is an identity matrix, otherwise false

julia> mat = HomalgIdentityMatrix(3, ZZ)
[1   0   0]
[0   1   0]
[0   0   1]

julia> IsOne(mat)
true
source
MatricesForHomalg.IsSymmetricMatrixMethod
IsSymmetricMatrix(mat)

Return true if the matrix mat is symmetric with respect to its main diagonal, otherwise false

julia> mat = HomalgMatrix([1,2,3,2,4,5,3,5,6], 3, 3, ZZ)
[1   2   3]
[2   4   5]
[3   5   6]

julia> IsSymmetricMatrix(mat)
true
source
MatricesForHomalg.IsZeroMethod
IsZero(mat)

Return true if mat is a zero matrix, otherwise false

julia> mat = HomalgZeroMatrix(3, 2, ZZ)
[0   0]
[0   0]
[0   0]

julia> IsZero(mat)
true
source
MatricesForHomalg.KroneckerMatMethod
KroneckerMat(mat1, mat2)

Return the Kronecker (or tensor) product of the two homalg matrices mat1 and mat2.

julia> mat1 = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> mat2 = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> KroneckerMat(mat1, mat2)
[ 2    3    4    6    6    9]
[ 4    5    8   10   12   15]
[ 6    7   12   14   18   21]
[ 8   12   10   15   12   18]
[16   20   20   25   24   30]
[24   28   30   35   36   42]

julia> KroneckerMat(mat2, mat1)
[ 2    4    6    3    6    9]
[ 8   10   12   12   15   18]
[ 4    8   12    5   10   15]
[16   20   24   20   25   30]
[ 6   12   18    7   14   21]
[24   30   36   28   35   42]
source
MatricesForHomalg.LeftDivideMethod
LeftDivide(A, B, L)

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"

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> L = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> B = HomalgMatrix([5, 5, 11, 9, 17, 13], 3, 2, ZZ)
[ 5    5]
[11    9]
[17   13]

julia> LeftDivide(A, B, L)
[0   0]
[0   0]

julia> B = HomalgMatrix([3, 5, 0, 9, 11, 13], 3, 2, ZZ)
[ 3    5]
[ 0    9]
[11   13]

julia> LeftDivide(A, B, L)
"fail"
source
MatricesForHomalg.LeftDivideMethod
LeftDivide(A, B)

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^{-1}B".

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> C = HomalgMatrix([1,0,0,0,0,0], 3, 2, ZZ)
[1   0]
[0   0]
[0   0]

julia> LeftDivide(B, B)
[1   0]
[0   1]

julia> LeftDivide(A, B)
[0   -1]
[1    2]

julia> LeftDivide(C, B)
"fail"
source
MatricesForHomalg.NumberColumnsMethod
NumberColumns(mat)

The number of columns of the matrix mat

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> NumberColumns(mat)
3
source
MatricesForHomalg.NumberRowsMethod
NumberRows(mat)

The number of rows of the matrix mat

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> NumberRows(mat)
2
source
MatricesForHomalg.RightDivideMethod
RightDivide(B, A, L)

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".

julia> A = HomalgMatrix(1:9, 3, 3, ZZ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> B = HomalgMatrix([3, 5, 7, 13, 16, 19, 29, 33, 37], 3, 3, ZZ)
[ 3    5    7]
[13   16   19]
[29   33   37]

julia> L = HomalgMatrix(2:10, 3, 3, ZZ)
[2   3    4]
[5   6    7]
[8   9   10]

julia> X = RightDivide(B, A, L)
[0   0   -2]
[0   0   -1]
[0   0    0]

julia> B = HomalgMatrix([3, 5, 7, 0, 16, 19, 0, 33, 37], 3, 3, ZZ)
[3    5    7]
[0   16   19]
[0   33   37]

julia> RightDivide(B, A, L)
"fail"
source
MatricesForHomalg.RightDivideMethod
RightDivide(B, A)

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".

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(3:8, 3, 2, ZZ)
[3   4]
[5   6]
[7   8]

julia> RightDivide(B, A)
[0    1   0]
[0    0   1]
[0   -1   2]

julia> RightDivide(A, B)
[0   3   -2]
[0   2   -1]
[0   1    0]

julia> C = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> RightDivide(A, C)
"fail"

julia> RightDivide(C, A)
"fail"
source
MatricesForHomalg.RingNameMethod
RingName(ring)

Returns the name of the ring as a string.

julia> ring = HomalgRingOfIntegers()
Integer ring

julia> RingName(ring)
"Z"

julia> field = HomalgFieldOfRationals()
Rational field

julia> RingName(field)
"Q"
source
MatricesForHomalg.RowRankOfMatrixMethod
RowRankOfMatrix(mat)

Returns the row rank of the matrix mat as a nonnegative integer.

julia> mat1 = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> RowRankOfMatrix(mat1)
2

julia> mat2 = HomalgIdentityMatrix(3, ZZ)
[1   0   0]
[0   1   0]
[0   0   1]

julia> RowRankOfMatrix(mat2)
3
source
MatricesForHomalg.RowReducedEchelonFormMethod
RowReducedEchelonForm(mat)

Return the reduced row-echelon form and the rank of the matrix mat.

```jldoctest julia> mat = HomalgMatrix(reverse(1:9), 3, 3, ZZ) [9 8 7] [6 5 4] [3 2 1]

julia> RowReducedEchelonForm(mat) ([3 0 -3; 0 1 2; 0 0 0], 2)

julia> mat = HomalgMatrix(reverse(1:9), 3, 3, QQ) [9 8 7] [6 5 4] [3 2 1]

julia> RowReducedEchelonForm(mat) ([1 0 -1; 0 1 2; 0 0 0], 2)

source
MatricesForHomalg.SafeLeftDivideMethod
SafeLeftDivide(A, B, L)

Returns: a homalg matrix

Same as LeftDivide, but asserts that the result is not fail.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> L = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> B = HomalgMatrix([5, 5, 11, 9, 17, 13], 3, 2, ZZ)
[ 5    5]
[11    9]
[17   13]

julia> SafeLeftDivide(A, B, L)
[0   0]
[0   0]

julia> B = HomalgMatrix([3, 5, 0, 9, 11, 13], 3, 2, ZZ)
[ 3    5]
[ 0    9]
[11   13]

julia> SafeLeftDivide(A, B, L)
ERROR: Unable to solve linear system
source
MatricesForHomalg.SafeLeftDivideMethod
SafeLeftDivide(A, B)

Returns: a homalg matrix

Same as LeftDivide, but asserts that the result is not fail.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> C = HomalgMatrix([1,0,0,0,0,0], 3, 2, ZZ)
[1   0]
[0   0]
[0   0]

julia> SafeLeftDivide(B, B)
[1   0]
[0   1]

julia> SafeLeftDivide(A, B)
[0   -1]
[1    2]

julia> SafeLeftDivide(C, B)
ERROR: Unable to solve linear system
source
MatricesForHomalg.SafeRightDivideMethod
SafeRightDivide(B, A, L)

Returns: a homalg matrix

Same as RightDivide, but asserts that the result is not fail.

julia> A = HomalgMatrix(1:9, 3, 3, ZZ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> B = HomalgMatrix([3, 5, 7, 13, 16, 19, 29, 33, 37], 3, 3, ZZ)
[ 3    5    7]
[13   16   19]
[29   33   37]

julia> L = HomalgMatrix(2:10, 3, 3, ZZ)
[2   3    4]
[5   6    7]
[8   9   10]

julia> X = SafeRightDivide(B, A, L)
[0   0   -2]
[0   0   -1]
[0   0    0]

julia> Y = HomalgMatrix([1, 3, 0, 0, 4, 0, -3, 7, 0], 3, 3, ZZ)
[ 1   3   0]
[ 0   4   0]
[-3   7   0]

julia> X*A+Y*L
[ 3    5    7]
[13   16   19]
[29   33   37]

julia> B = HomalgMatrix([3, 5, 7, 0, 16, 19, 0, 33, 37], 3, 3, ZZ)
[3    5    7]
[0   16   19]
[0   33   37]

julia> SafeRightDivide(B, A, L)
ERROR: Unable to solve linear system
source
MatricesForHomalg.SafeRightDivideMethod
SafeRightDivide(B, A)

Returns: a homalg matrix

Same as RightDivide, but asserts that the result is not fail.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(3:8, 3, 2, ZZ)
[3   4]
[5   6]
[7   8]

julia> SafeRightDivide(B, A)
[0    1   0]
[0    0   1]
[0   -1   2]

julia> SafeRightDivide(A, B)
[0   3   -2]
[0   2   -1]
[0   1    0]

julia> SafeRightDivide(B, B)
[0   2   -1]
[0   1    0]
[0   0    1]

julia> B = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> SafeRightDivide(A, B)
ERROR: Unable to solve linear system
source
MatricesForHomalg.StringDisplayMethod
StringDisplay(mat)

Returns the matrix mat as a string.

julia> mat = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> StringDisplay(mat)
"[4 5; 6 7; 8 9]"
source
MatricesForHomalg.SyzygiesOfColumnsMethod
SyzygiesOfColumns(A, N)

Returns: a homalg matrix

Let R be the ring over which M is defined. The matrix of relative column syzygies SyzygiesOfColumns(A,N) is a matrix whose columns span the right kernel of A modulo N, i.e. the R-submodule of the free right module R(NrColumns(A)×1)consisting of all columns K satisfying AK+NL=0 for some column L∈R(NrColumns(N)×1).

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> N = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> SyzygiesOfColumns(A, N)
[1   0]
[0   1]
source
MatricesForHomalg.SyzygiesOfColumnsMethod
SyzygiesOfColumns(A)

Return a homalg matrix. Let R be the ring over which A is defined (R:=HomalgRing(A)). The matrix of column syzygies SyzygiesGeneratorsOfColumns(A) is a matrix whose columns span the right kernel of A, i.e. the R-submodule of the free right module R(NrColumns(A)x1) consisting of all columns X satisfying AX=0

julia> A = TransposedMatrix(HomalgMatrix(4:9, 3, 2, ZZ))
[4   6   8]
[5   7   9]

julia> S = SyzygiesOfColumns(A)
[ 1]
[-2]
[ 1]

julia> A*S
[0]
[0]
source
MatricesForHomalg.SyzygiesOfRowsMethod
SyzygiesOfRows(A, N)

Returns: a homalg matrix

Let R be the ring over which A is defined. The matrix of relative row syzygies SyzygiesOfRows(A, N) is a matrix whose rows span the left kernel of A modulo N, i.e. the R-submodule of the free left module R(1×NrRows(A)) consisting of all rows K satisfying KA+LN=0 for some row L∈R(1×NrRows(N)).

julia> A = HomalgMatrix(1:9, 3, 3, ZZ)
[1   2   3]
[4   5   6]
[7   8   9]

julia> N = HomalgMatrix(2:10, 3, 3, ZZ)
[2   3    4]
[5   6    7]
[8   9   10]

julia> SyzygiesOfRows(A, N)
[1   0   2]
[0   1   2]
[0   0   3]

julia> SyzygiesOfRows(A,A)
[1   0   0]
[0   1   0]
[0   0   1]
source
MatricesForHomalg.SyzygiesOfRowsMethod
SyzygiesOfRows(A)

Return a homalg matrix. Let R be the ring over which A is defined (R:= HomalgRing(A)). The matrix of row syzygies SyzygiesGeneratorsOfRows(A) is a matrix whose rows span the left kernel of A, i.e. the R-submodule of the free left module R(1xNrRows(A)) consisting of all rows X satisfying XA=0

julia> A = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> S = SyzygiesOfRows(A)
[1   -2   1]

julia> S*A
[0   0]
source
MatricesForHomalg.TransposedMatrixMethod
TransposedMatrix(mat)

Return the transposed matrix of mat

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> TransposedMatrix(mat)
[1   4]
[2   5]
[3   6]
source
MatricesForHomalg.UnionOfColumnsMethod
UnionOfColumns(R, nr_rows, list)

Return the matrices in list augmented, where all of them have same number of rows nr_rows. .

julia> UnionOfColumns(ZZ, 2, [])
2 by 0 empty matrix

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> UnionOfColumns(ZZ, 2, [mat, mat])
[1   2   3   1   2   3]
[4   5   6   4   5   6]
source
MatricesForHomalg.UnionOfRowsMethod
UnionOfRows(R, nr_cols, list)

Return the matrices in list stacked, where all of them have same number of columns nr_cols.

julia> UnionOfRows(ZZ, 3, [])
0 by 3 empty matrix

julia> mat = HomalgMatrix(1:6, 2, 3, ZZ)
[1   2   3]
[4   5   6]

julia> UnionOfRows(ZZ, 3, [mat, mat])
[1   2   3]
[4   5   6]
[1   2   3]
[4   5   6]
source
MatricesForHomalg.UniqueLeftDivideMethod
UniqueLeftDivide(A, B)

Returns: a homalg matrix

Same as SafeLeftDivide, but asserts that the solution is unique.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(2:7, 3, 2, ZZ)
[2   3]
[4   5]
[6   7]

julia> UniqueLeftDivide(B, B)
[1   0]
[0   1]

julia> A = HomalgMatrix([1,2,3,0,5,6,0,0,0], 3, 3, ZZ)
[1   2   3]
[0   5   6]
[0   0   0]

julia> B = HomalgMatrix([1,2,0], 3, 1, ZZ)
[1]
[2]
[0]

julia> UniqueLeftDivide(A, B)
ERROR: The inhomogeneous linear system of equations AX=B has no unique solution
source
MatricesForHomalg.UniqueRightDivideMethod
UniqueRightDivide(B, A)

Returns: a homalg matrix

Same as SafeRightDivide, but asserts that the solution is unique.

julia> A = HomalgMatrix(1:6, 3, 2, ZZ)
[1   2]
[3   4]
[5   6]

julia> B = HomalgMatrix(3:8, 3, 2, ZZ)
[3   4]
[5   6]
[7   8]

julia> RightDivide(B, A)
[0    1   0]
[0    0   1]
[0   -1   2]

julia> UniqueRightDivide(B, A)
ERROR: The inhomogeneous linear system of equations XA=B has no unique solution

julia> mat = HomalgIdentityMatrix(3, ZZ)
[1   0   0]
[0   1   0]
[0   0   1]

julia> UniqueRightDivide(mat, mat)
[1   0   0]
[0   1   0]
[0   0   1]
source
MatricesForHomalg.ZeroColumnsMethod
ZeroColumns(mat)

Return a (possibly empty) list of positive integers. The list of zero columns of the matrix A.

julia> mat = HomalgMatrix(4:9, 2, 3, ZZ)
[4   5   6]
[7   8   9]

julia> ZeroColumns(mat)
Int64[]

julia> mat = HomalgMatrix([0, 2, 6, 0, 0, 0], 2, 3, ZZ)
[0   2   6]
[0   0   0]

julia> ZeroColumns(mat)
1-element Vector{Int64}:
 1

julia> mat = HomalgZeroMatrix(3,3,ZZ)
[0   0   0]
[0   0   0]
[0   0   0]

julia> ZeroColumns(mat)
3-element Vector{Int64}:
 1
 2
 3
source
MatricesForHomalg.ZeroRowsMethod
ZeroRows(mat)

Return a (possibly empty) list of positive integers. The list of zero rows of the matrix A.

julia> mat = HomalgMatrix(4:9, 3, 2, ZZ)
[4   5]
[6   7]
[8   9]

julia> ZeroRows(mat)
Int64[]

julia> mat = HomalgMatrix([0, 2, 6, 0, 0, 0], 3, 2, ZZ)
[0   2]
[6   0]
[0   0]

julia> ZeroRows(mat)
1-element Vector{Int64}:
 3

julia> mat = HomalgZeroMatrix(3,3,ZZ)
[0   0   0]
[0   0   0]
[0   0   0]

julia> ZeroRows(mat)
3-element Vector{Int64}:
 1
 2
 3
source