A positive semidefinite matrix is a real symmetric or complex Hermitian matrix for which for every vector of the appropriate dimension. Here denotes the conjugate transpose, which reduces to the ordinary transpose for real vectors. Positive semidefinite matrices describe nonnegative quadratic quantities, including variances, squared lengths, and quadratic energy functions. They are fundamental in linear algebra, statistics, optimization, and numerical computation.
Definition and conventions
A complex square matrix is positive semidefinite if
The condition says that is a Hermitian matrix. For real matrices, the corresponding definition requires and
The standard notation is
The sets of real symmetric and complex Hermitian positive semidefinite matrices are commonly denoted by and , respectively.
The expression is the quadratic form associated with . “Semidefinite” allows this expression to vanish for a nonzero vector. By contrast, a positive definite matrix satisfies
Positive definite matrices are therefore positive semidefinite, but the converse need not hold. The zero matrix is positive semidefinite.
Symmetry is an important part of the standard real-matrix definition. For an arbitrary real square matrix ,
Consequently, nonnegativity of this expression alone constrains only the symmetric part of . Some authors use “positive semidefinite” more broadly in this setting, so conventions should be checked when nonsymmetric matrices occur.
Equivalent characterizations
For a Hermitian matrix , the following statements are equivalent:
.
Every eigenvalue of is nonnegative.
There is a possibly rectangular matrix such that
Every principal minor of is nonnegative.
has a Hermitian positive semidefinite square root.
These equivalences connect the quadratic-form definition with spectral, algebraic, and geometric descriptions.
Spectral decomposition and square roots
By the spectral theorem, a Hermitian matrix has a decomposition
where is unitary and has real diagonal entries. Writing gives
This is nonnegative for every precisely when every .
For such a matrix, its unique Hermitian positive semidefinite square root is
Thus , establishing a factorization of the form .
If has rank , the matrix can be chosen with exactly rows. Its columns then represent as a Gram matrix:
Conversely, every Gram matrix is positive semidefinite because
Principal minors
A principal submatrix is obtained by choosing the same index set for rows and columns. Its determinant is a principal minor. A Hermitian matrix is positive semidefinite exactly when all its principal minors are nonnegative.
Checking only the leading principal minors is not sufficient. For example,
has leading principal minors and , but is not positive semidefinite. Its principal minor corresponding to the second diagonal entry is .
This differs from the positive definite case, where positivity of all leading principal minors is sufficient.
Examples and entrywise consequences
A real symmetric matrix
is positive semidefinite exactly when
For example,
is positive semidefinite because
Its eigenvalues are and , so it is not positive definite.
Positive semidefiniteness is not the same as having nonnegative entries. The matrix
is positive semidefinite, whereas
has only positive entries but has eigenvalues and .
For any positive semidefinite matrix,
The second inequality follows from its principal minors and is also a manifestation of the Cauchy–Schwarz inequality in a Gram representation. In particular, a zero diagonal entry forces every entry in the corresponding row and column to be zero.
Algebraic and geometric properties
Closure and transformations
If and , then
Thus positive semidefinite matrices form a convex cone. This cone is closed, and its interior in the space of Hermitian matrices consists exactly of the positive definite matrices.
For every compatible matrix ,
If is invertible, this transformation preserves positive semidefiniteness in both directions. Taking to select coordinates shows that every principal submatrix of a positive semidefinite matrix is positive semidefinite.
The ordinary product of two positive semidefinite matrices need not be Hermitian and therefore need not be positive semidefinite. If and commute, their product is positive semidefinite. By contrast, their entrywise product is always positive semidefinite; this is the Schur product theorem.
Null directions and seminorms
For ,
Thus the zero directions of its quadratic form are exactly its null space.
The expression
defines a seminorm. It is a genuine norm precisely when is positive definite. Similarly, defines a possibly degenerate inner product, becoming an inner product when is positive definite.
The eigenvalues also show that
A positive semidefinite matrix is positive definite exactly when it is invertible, or equivalently when its determinant is strictly positive. Neither nonnegative trace nor nonnegative determinant alone is sufficient to establish positive semidefiniteness.
The Loewner order
For Hermitian matrices of the same size, define
This relation, called the Loewner order, is a partial order, not an entrywise comparison. It means
Using the trace pairing, the positive semidefinite cone is self-dual:
where is Hermitian. This property is important in optimization duality.
Applications
Covariance matrices
For a real random vector with finite second moments, its covariance matrix is
For every vector ,
Hence every covariance matrix is positive semidefinite.
Singularity has a precise statistical meaning: some nonzero linear combination of the centered variables vanishes almost surely. Conversely, every real symmetric positive semidefinite matrix is the covariance matrix of some random vector, including a possibly degenerate multivariate normal vector.
The nonnegative eigenvalues of a covariance matrix represent variances along orthogonal directions, providing the spectral basis of principal component analysis.
Convexity and optimization
For the quadratic function
with real symmetric, convexity is equivalent to .
More generally, a twice continuously differentiable function on an open convex domain is convex if and only if its Hessian matrix is positive semidefinite everywhere on that domain. This connects matrix positivity with convex optimization.
In semidefinite programming, a linear objective is optimized subject to affine constraints and positive semidefiniteness requirements. A typical constraint is the linear matrix inequality
These problems include applications in control, estimation, and relaxations of discrete optimization problems.
Block matrix constraints can often be simplified using a Schur complement. If , then
When is singular, an analogous criterion requires a generalized inverse and an additional range condition.
Kernel methods and graph energies
In machine learning, a positive semidefinite kernel produces a positive semidefinite Gram matrix for every finite collection of inputs. This makes the kernel interpretable as an inner product in a feature space and supports methods such as support vector machines and Gaussian process models.
In graph theory, the Laplacian of an undirected graph with symmetric nonnegative edge weights satisfies
The Laplacian is therefore positive semidefinite. Its null space consists of vectors that are constant on each connected component.
Computation and numerical limitations
For a symmetric or Hermitian matrix, computing its eigenvalues provides a direct test for positive semidefiniteness. In floating-point arithmetic, however, a matrix that is theoretically positive semidefinite may acquire small negative eigenvalues through rounding or approximation. Numerical tests therefore commonly compare the smallest eigenvalue against a tolerance related to matrix scale and computational accuracy.
Cholesky decomposition is particularly effective for positive definite matrices. Positive semidefinite matrices also admit triangular square-root factorizations in exact arithmetic, but zero pivots require special handling, and standard positive-definite Cholesky routines may stop on singular input. Pivoted factorizations or eigenvalue-based methods are often used when rank deficiency is expected.
Two common modifications serve different purposes:
- Diagonal shifting: replacing by , with , makes a positive semidefinite matrix positive definite.
- Eigenvalue clipping: for a Hermitian matrix, replacing negative eigenvalues by zero gives its nearest positive semidefinite matrix in the Frobenius norm.
Such changes alter the original matrix. In statistical and optimization applications, they may therefore change the covariance model, objective, or feasible set rather than merely improve numerical behavior.