Predicates

The functions in this section test various properties of matrices. See also the Lattices chapter for a description of the function IsPositiveDefinite and related functions.

IsZero(A) : Mtrx -> BoolElt
Given an m x n matrix A over the ring R, return true iff A is the m x n zero matrix.

IsOne(A) : Mtrx -> BoolElt
Given a square m x m matrix A over the ring R, return true iff A is the m x m identity matrix.

IsMinusOne(A) : Mtrx -> BoolElt
Given a square m x m matrix A over the ring R, return true iff A is the negation of the m x m identity matrix.
IsScalar(A) : Mtrx -> BoolElt
Given a square m x m matrix A over the ring R, return true iff A is scalar, i.e., iff A is the product of some element of R and the m x m identity matrix.
IsDiagonal(A) : Mtrx -> BoolElt
Given a square matrix A over the ring R, return true iff A is diagonal, i.e., iff the only non-zero entries of A are on the diagonal.
IsSymmetric(A) : Mtrx -> BoolElt
Given a square matrix A over the ring R, return true iff A is symmetric, i.e., iff A equals its transpose.
IsUpperTriangular(A) : Mtrx -> BoolElt
Given a matrix A over the ring R, return true iff A is upper triangular, i.e., iff the only non-zero entries of A are on or above the diagonal.
IsLowerTriangular(A) : Mtrx -> BoolElt
Given a matrix A over the ring R, return true iff A is lower triangular, i.e., iff the only non-zero entries of A are on or below the diagonal.
IsUnit(A) : Mtrx -> BoolElt
Given a square matrix A over the ring R, return true iff A is a unit, i.e., iff A has an inverse. The coefficient ring R may be any commutative ring (since the computation depends on testing if the determinant is a unit -- a calculation which is supported in all commutative rings).
IsSingular(A) : Mtrx -> BoolElt
Given a square m x m matrix A over the ring R, return true iff A is singular, i.e., iff the determinant of A is zero (or, equivalently, iff the rank of A is less than m). Note that (not IsSingular(A)) is not equivalent to IsUnit(A) whenever R is not a field: if the determinant of A is non-zero but not a unit, then A is non-singular but not invertible. The coefficient ring R may be any commutative ring (since the computation involves only computing the determinant and testing whether it is zero).
IsSymplecticMatrix(A) : Mtrx -> BoolElt
Given an m x m matrix A over the integers, return true if and only if A is an integer symplectic matrix, that is, AJ()tA = J, where J = (0 1; -1 0).
V2.28, 13 July 2023