Testing Matrices for Definiteness

The functions in this section test matrices for positive definiteness, etc. They may applied to any symmetric matrix over a real subring (i.e., Z, Q, or a real field), though the SemiDefinite functions must be over Z or Q. Each function works by calling the function OrthogonalizeGram on its argument and then determining whether the resulting diagonal matrix has the appropriate form. Over a real field, a numerical check is made that the matrix has enough stability to determine definiteness.

IsPositiveDefinite(F) : Mtrx -> BoolElt
Given a symmetric matrix F over the rationals or integers or a real field, return whether F is positive definite, i.e., whether vFvtr > 0 for all non-zero vectors v∈Rn. Over a real field, it will fail in numerically unstable situations.
IsPositiveSemiDefinite(F) : Mtrx -> BoolElt
Given a symmetric matrix F over the rationals or integers, return whether F is positive semi-definite, i.e., whether vFvtr ≥0 for all non-zero vectors v∈Rn.
IsNegativeDefinite(F) : Mtrx -> BoolElt
Given a symmetric matrix F over the rationals or integers or a real field, return whether F is negative definite, i.e., whether vFvtr < 0 for all non-zero vectors v∈Rn. Over a real field, it will fail in numerically unstable situations.
IsNegativeSemiDefinite(F) : Mtrx -> BoolElt
Given a symmetric matrix F over the rationals or integers, return whether F is negative semi-definite, i.e., whether vFvtr ≤0 for all non-zero vectors v∈Rn.
Signature(F) : Mtrx -> RngIntElt, RngIntElt, RngIntElt
Given a symmetric matrix F over the rationals or integers, return the signature of F, i.e. the number of positive, negative and zero eigenvalues.
NumericalSignature(M) : Mtrx -> RngIntElt, RngIntElt
Given a symmetric matrix over a real field, return its signature, that is, the number of positive and negative eigenvalues. Fails if (at least) one of the eigenvalues is too close to zero.
V2.28, 13 July 2023