In mathematics, a symmetric matrix formula_1 with real entries is positive-definite if the real number formula_2 is positive for every nonzero real column vector formula_3 where formula_4 is the row vector transpose of formula_5 More generally, a Hermitian matrix (that is, a complex matrix equal to its conjugate transpose) is positive-definite if the real number formula_6 is positive for every nonzero complex column vector formula_7 where formula_8 denotes the conjugate transpose of formula_9 Positive semi-definite matrices are defined similarly, except that the scalars formula_2 and formula_6 are required to be positive "or zero" (that is, nonnegative). Negative-definite and negative semi-definite matrices are defined analogously. A matrix that is not positive semi-definite and not negative semi-definite is sometimes called "indefinite". Some authors use more general definitions of definiteness, permitting the matrices to be non-symmetric or non-Hermitian. The properties of these generalized definite matrices are explored in , below, but are not the main focus of this article. Ramifications. It follows from the above definitions that a matrix is positive-definite if and only if it is the matrix of a positive-definite quadratic form or Hermitian form. In other words, a matrix is positive-definite if and only if it defines an inner product. Positive-definite and positive-semidefinite matrices can be characterized in many ways, which may explain the importance of the concept in various parts of mathematics. A matrix is positive-definite if and only if it satisfies any of the following equivalent conditions. A matrix is positive semi-definite if it satisfies similar equivalent conditions where "positive" is replaced by "nonnegative", "invertible matrix" is replaced by "matrix", and the word "leading" is removed. Positive-definite and positive-semidefinite real matrices are at the basis of convex optimization, since, given a function of several real variables that is twice differentiable, then if its Hessian matrix (matrix of its second partial derivatives) is positive-definite at a point formula_18 then the function is convex near , and, conversely, if the function is convex near formula_18 then the Hessian matrix is positive-semidefinite at formula_20 The set of positive definite matrices is an open convex cone, while the set of positive semi-definite matrices is a closed convex cone. Definitions. In the following definitions, formula_4 is the transpose of formula_3 formula_8 is the conjugate transpose of formula_7 and formula_25 denotes the zero-vector. Definitions for real matrices. An formula_26 symmetric real matrix formula_1 is said to be positive-definite if formula_28 for all non-zero formula_29 in formula_30 Formally, An formula_26 symmetric real matrix formula_1 is said to be positive-semidefinite or non-negative-definite if formula_33 for all formula_29 in formula_35 Formally, An formula_26 symmetric real matrix formula_1 is said to be negative-definite if formula_38 for all non-zero formula_29 in formula_40 Formally, An formula_26 symmetric real matrix formula_1 is said to be negative-semidefinite or non-positive-definite if formula_43 for all formula_29 in formula_35 Formally, An formula_26 symmetric real matrix which is neither positive semidefinite nor negative semidefinite is called indefinite. Definitions for complex matrices. The following definitions all involve the term formula_47 Notice that this is always a real number for any Hermitian square matrix formula_48 An formula_26 Hermitian complex matrix formula_1 is said to be positive-definite if formula_51 for all non-zero formula_52 in formula_53 Formally, An formula_26 Hermitian complex matrix formula_1 is said to be positive semi-definite or non-negative-definite if formula_56 for all formula_52 in formula_53 Formally, An formula_26 Hermitian complex matrix formula_1 is said to be negative-definite if formula_61 for all non-zero formula_52 in formula_53 Formally, An formula_26 Hermitian complex matrix formula_1 is said to be negative semi-definite or non-positive-definite if formula_66 for all formula_52 in formula_53 Formally, An formula_26 Hermitian complex matrix which is neither positive semidefinite nor negative semidefinite is called indefinite. Consistency between real and complex definitions. Since every real matrix is also a complex matrix, the definitions of "definiteness" for the two classes must agree. For complex matrices, the most common definition says that formula_1 is positive-definite if and only if formula_71 is real and positive for every non-zero complex column vectors formula_72 This condition implies that formula_1 is Hermitian (i.e. its transpose is equal to its conjugate), since formula_71 being real, it equals its conjugate transpose formula_75 for every formula_7 which implies formula_77 By this definition, a positive-definite "real" matrix formula_1 is Hermitian, hence symmetric; and formula_79 is positive for all non-zero "real" column vectors formula_72 However the last condition alone is not sufficient for formula_1 to be positive-definite. For example, if formula_82 then for any real vector formula_52 with entries formula_84 and formula_85 we have formula_86 which is always positive if formula_52 is not zero. However, if formula_52 is the complex vector with entries and , one gets formula_89 which is not real. Therefore, formula_1 is not positive-definite. On the other hand, for a "symmetric" real matrix formula_91 the condition "formula_92 for all nonzero real vectors formula_52" "does" imply that formula_1 is positive-definite in the complex sense. Notation. If a Hermitian matrix formula_1 is positive semi-definite, one sometimes writes formula_96 and if formula_1 is positive-definite one writes formula_98 To denote that formula_1 is negative semi-definite one writes formula_100 and to denote that formula_1 is negative-definite one writes formula_102 The notion comes from functional analysis where positive semidefinite matrices define positive operators. If two matrices formula_103 and formula_15 satisfy formula_105 we can define a non-strict partial order formula_106 that is reflexive, antisymmetric, and transitive; It is not a total order, however, as formula_107 in general, may be indefinite. A common alternative notation is formula_108 formula_109 formula_110 and formula_111 for positive semi-definite and positive-definite, negative semi-definite and negative-definite matrices, respectively. This may be confusing, as sometimes nonnegative matrices (respectively, nonpositive matrices) are also denoted in this way. Eigenvalues. Let formula_1 be an formula_26 Hermitian matrix (this includes real symmetric matrices). All eigenvalues of formula_1 are real, and their sign characterize its definiteness: Let formula_120 be an eigendecomposition of formula_91 where formula_122 is a unitary complex matrix whose columns comprise an orthonormal basis of eigenvectors of formula_91 and formula_124 is a "real" diagonal matrix whose main diagonal contains the corresponding eigenvalues. The matrix formula_1 may be regarded as a diagonal matrix formula_124 that has been re-expressed in coordinates of the (eigenvectors) basis formula_127 Put differently, applying formula_1 to some vector formula_7 giving formula_130 is the same as changing the basis to the eigenvector coordinate system using formula_131 giving formula_132 applying the stretching transformation formula_124 to the result, giving formula_134 and then changing the basis back using formula_135 giving formula_136 With this in mind, the one-to-one change of variable formula_137 shows that formula_71 is real and positive for any complex vector formula_52 if and only if formula_140 is real and positive for any formula_141 in other words, if formula_124 is positive definite. For a diagonal matrix, this is true only if each element of the main diagonal – that is, every eigenvalue of formula_1 – is positive. Since the spectral theorem guarantees all eigenvalues of a Hermitian matrix to be real, the positivity of eigenvalues can be checked using Descartes' rule of alternating signs when the characteristic polynomial of a real, symmetric matrix formula_1 is available. Decomposition. Let formula_1 be an formula_26 Hermitian matrix. formula_1 is positive semidefinite if and only if it can be decomposed as a product formula_148 of a matrix formula_15 with its conjugate transpose. When formula_1 is real, formula_15 can be real as well and the decomposition can be written as formula_152 formula_1 is positive definite if and only if such a decomposition exists with formula_15 invertible. More generally, formula_1 is positive semidefinite with rank formula_156 if and only if a decomposition exists with a formula_157 matrix formula_15 of full row rank (i.e. of rank formula_156). Moreover, for any decomposition formula_160 formula_161 </math> as the diagonal matrix whose entries are non-negative square roots of eigenvalues. Then formula_162 for formula_163 If moreover formula_1 is positive definite, then the eigenvalues are (strictly) positive, so formula_165 is invertible, and hence formula_166 is invertible as well. If formula_1 has rank formula_168 then it has exactly formula_156 positive eigenvalues and the others are zero, hence in formula_166 all but formula_156 rows are all zeroed. Cutting the zero rows gives a formula_157 matrix formula_173 such that formula_174 The columns formula_175 of formula_15 can be seen as vectors in the complex or real vector space formula_177 respectively. Then the entries of formula_1 are inner products (that is dot products, in the real case) of these vectors formula_179 In other words, a Hermitian matrix formula_1 is positive semidefinite if and only if it is the Gram matrix of some vectors formula_181 It is positive definite if and only if it is the Gram matrix of some linearly independent vectors. In general, the rank of the Gram matrix of vectors formula_175 equals the dimension of the space spanned by these vectors. Uniqueness up to unitary transformations. The decomposition is not unique: if formula_183 for some formula_157 matrix formula_15 and if formula_186 is any unitary formula_187 matrix (meaning formula_188), then formula_189 for formula_190 However, this is the only way in which two decompositions can differ: The decomposition is unique up to unitary transformations. More formally, if formula_103 is a formula_157 matrix and formula_15 is a formula_194 matrix such that formula_195 then there is a formula_196 matrix formula_186 with orthonormal columns (meaning formula_198) such that formula_199 When formula_200 this means formula_186 is unitary. This statement has an intuitive geometric interpretation in the real case: let the columns of formula_103 and formula_15 be the vectors formula_204 and formula_175 in formula_206 A real unitary matrix is an orthogonal matrix, which describes a rigid transformation (an isometry of Euclidean space formula_207) preserving the 0 point (i.e. rotations and reflections, without translations). Therefore, the dot products formula_208 and formula_209 are equal if and only if some rigid transformation of formula_207 transforms the vectors formula_204 to formula_212 (and 0 to 0). Square root. A Hermitian matrix formula_1 is positive semidefinite if and only if there is a positive semidefinite matrix formula_15 (in particular formula_15 is Hermitian, so formula_216) satisfying formula_217 This matrix formula_15 is unique, is called the "non-negative square root" of formula_91 and is denoted with formula_220 When formula_1 is positive definite, so is formula_222 hence it is also called the "positive square root" of formula_223 The non-negative square root should not be confused with other decompositions formula_17 Some authors use the name "square root" and formula_225 for any such decomposition, or specifically for the Cholesky decomposition, or any decomposition of the form formula_226 others only use it for the non-negative square root. If formula_227 then formula_228 Cholesky decomposition. A Hermitian positive semidefinite matrix formula_1 can be written as formula_230 where formula_231 is lower triangular with non-negative diagonal (equivalently formula_232 where formula_233 is upper triangular); this is the Cholesky decomposition. If formula_1 is positive definite, then the diagonal of formula_231 is positive and the Cholesky decomposition is unique. Conversely if formula_231 is lower triangular with nonnegative diagonal then formula_237 is positive semidefinite. The Cholesky decomposition is especially useful for efficient numerical calculations. A closely related decomposition is the LDL decomposition, formula_238 where formula_124 is diagonal and formula_231 is lower unitriangular. Williamson theorem. Any formula_241 positive definite Hermitian real matrix formula_242 can be diagonalized via symplectic (real) matrices. More precisely, Williamson's theorem ensures the existence of symplectic formula_243 and diagonal real positive formula_244 such that formula_245. Other characterizations. Let formula_1 be an formula_26 real symmetric matrix, and let formula_248 be the "unit ball" defined by formula_48 Then we have the following Let formula_1 be an formula_26 Hermitian matrix. The following properties are equivalent to formula_1 being positive definite: A positive semidefinite matrix is positive definite if and only if it is invertible. A matrix formula_1 is negative (semi)definite if and only if formula_296 is positive (semi)definite. Quadratic forms. The (purely) quadratic form associated with a real formula_26 matrix formula_1 is the function formula_299 such that formula_300 for all formula_5 formula_1 can be assumed symmetric by replacing it with formula_303 since any asymmetric part will be zeroed-out in the double-sided product. A symmetric matrix formula_1 is positive definite if and only if its quadratic form is a strictly convex function. More generally, any quadratic function from formula_305 to formula_306 can be written as formula_307 where formula_1 is a symmetric formula_26 matrix, formula_310 is a real  vector, and formula_311 a real constant. In the formula_312 case, this is a parabola, and just like in the formula_312 case, we have Theorem: This quadratic function is strictly convex, and hence has a unique finite global minimum, if and only if formula_1 is positive definite. Proof: If formula_1 is positive definite, then the function is strictly convex. Its gradient is zero at the unique point of formula_316 which must be the global minimum since the function is strictly convex. If formula_1 is not positive definite, then there exists some vector formula_318 such that formula_319 so the function formula_320 is a line or a downward parabola, thus not strictly convex and not having a global minimum. For this reason, positive definite matrices play an important role in optimization problems. Simultaneous diagonalization. One symmetric matrix and another matrix that is both symmetric and positive definite can be simultaneously diagonalized. This is so although simultaneous diagonalization is not necessarily performed with a similarity transformation. This result does not extend to the case of three or more matrices. In this section we write for the real case. Extension to the complex case is immediate. Let formula_1 be a symmetric and formula_266 a symmetric and positive definite matrix. Write the generalized eigenvalue equation as formula_323 where we impose that formula_29 be normalized, i.e. formula_325 Now we use Cholesky decomposition to write the inverse of formula_266 as formula_327 Multiplying by formula_186 and letting formula_329 we get formula_330 which can be rewritten as formula_331 where formula_332 Manipulation now yields formula_333 where formula_334 is a matrix having as columns the generalized eigenvectors and formula_335 is a diagonal matrix of the generalized eigenvalues. Now premultiplication with formula_336 gives the final result: formula_337 and formula_338 but note that this is no longer an orthogonal diagonalization with respect to the inner product where formula_332 In fact, we diagonalized formula_1 with respect to the inner product induced by formula_341 Note that this result does not contradict what is said on simultaneous diagonalization in the article Diagonalizable matrix, which refers to simultaneous diagonalization by a similarity transformation. Our result here is more akin to a simultaneous diagonalization of two quadratic forms, and is useful for optimization of one form under conditions on the other. Properties. Induced partial ordering. For arbitrary square matrices formula_91 formula_266 we write formula_344 if formula_345 i.e., formula_346 is positive semi-definite. This defines a partial ordering on the set of all square matrices. One can similarly define a strict partial ordering formula_347 The ordering is called the Loewner order. Inverse of positive definite matrix. Every positive definite matrix is invertible and its inverse is also positive definite. If formula_348 then formula_349 Moreover, by the min-max theorem, the th largest eigenvalue of formula_1 is greater than or equal to the th largest eigenvalue of formula_341 Scaling. If formula_1 is positive definite and formula_353 is a real number, then formula_354 is positive definite. Trace. The diagonal entries formula_376 of a positive-semidefinite matrix are real and non-negative. As a consequence the trace, formula_377 Furthermore, since every principal sub-matrix (in particular, 2-by-2) is positive semidefinite, formula_378 and thus, when formula_379 formula_380 An formula_26 Hermitian matrix formula_1 is positive definite if it satisfies the following trace inequalities: formula_383 Another important result is that for any formula_1 and formula_266 positive-semidefinite matrices, formula_386 This follows by writing formula_387 The matrix formula_388 is positive-semidefinite and thus has non-negative eigenvalues, whose sum, the trace, is therefore also non-negative. Hadamard product. If formula_389 although formula_369 is not necessary positive semidefinite, the Hadamard product is, formula_391 (this result is often called the Schur product theorem). Regarding the Hadamard product of two positive semidefinite matrices formula_392 formula_393 there are two notable inequalities: Kronecker product. If formula_389 although formula_369 is not necessary positive semidefinite, the Kronecker product formula_398 Frobenius product. If formula_389 although formula_369 is not necessary positive semidefinite, the Frobenius inner product formula_401 (Lancaster–Tismenetsky, "The Theory of Matrices", p. 218). Convexity. The set of positive semidefinite symmetric matrices is convex. That is, if formula_1 and formula_266 are positive semidefinite, then for any formula_404 between and , formula_405 is also positive semidefinite. For any vector formula_29: formula_407 This property guarantees that semidefinite programming problems converge to a globally optimal solution. Relation with cosine. The positive-definiteness of a matrix formula_103 expresses that the angle formula_409 between any vector formula_29 and its image formula_411 is always formula_412 formula_413 the angle between formula_29 and formula_415 Block matrices and submatrices. A positive formula_440 matrix may also be defined by blocks: formula_441 where each block is formula_442 By applying the positivity condition, it immediately follows that formula_103 and formula_124 are hermitian, and formula_445 We have that formula_446 for all complex formula_7 and in particular for formula_448 Then formula_449 A similar argument can be applied to formula_450 and thus we conclude that both formula_103 and formula_124 must be positive definite. The argument can be extended to show that any principal submatrix of formula_1 is itself positive definite. Converse results can be proved with stronger conditions on the blocks, for instance, using the Schur complement. Local extrema. A general quadratic form formula_454 on formula_455 real variables formula_456 can always be written as formula_2 where formula_29 is the column vector with those variables, and formula_1 is a symmetric real matrix. Therefore, the matrix being positive definite means that formula_460 has a unique minimum (zero) when formula_29 is zero, and is strictly positive for any other formula_5 More generally, a twice-differentiable real function formula_460 on formula_455 real variables has local minimum at arguments formula_456 if its gradient is zero and its Hessian (the matrix of all second derivatives) is positive semi-definite at that point. Similar statements can be made for negative definite and semi-definite matrices. Covariance. In statistics, the covariance matrix of a multivariate probability distribution is always positive semi-definite; and it is positive definite unless one variable is an exact linear function of the others. Conversely, every positive semi-definite matrix is the covariance matrix of some multivariate distribution. Extension for non-Hermitian square matrices. The definition of positive definite can be generalized by designating any complex matrix formula_1 (e.g. real non-symmetric) as positive definite if formula_467 for all non-zero complex vectors formula_7 where formula_469 denotes the real part of a complex number formula_470 Only the Hermitian part formula_471 determines whether the matrix is positive definite, and is assessed in the narrower sense above. Similarly, if formula_29 and formula_1 are real, we have formula_474 for all real nonzero vectors formula_29 if and only if the symmetric part formula_476 is positive definite in the narrower sense. It is immediately clear that formula_477is insensitive to transposition of formula_48 A non-symmetric real matrix with only positive eigenvalues may have a symmetric part with negative eigenvalues, in which case it will not be positive (semi)definite. For example, the matrix formula_479 has positive eigenvalues 1 and 7, yet formula_480 with the choice formula_481. In summary, the distinguishing feature between the real and complex case is that, a bounded positive operator on a complex Hilbert space is necessarily Hermitian, or self adjoint. The general claim can be argued using the polarization identity. That is no longer true in the real case. Applications. Heat conductivity matrix. Fourier's law of heat conduction, giving heat flux formula_482 in terms of the temperature gradient formula_483 is written for anisotropic media as formula_484 in which formula_485 is the thermal conductivity matrix. The negative is inserted in Fourier's law to reflect the expectation that heat will always flow from hot to cold. In other words, since the temperature gradient formula_486 always points from cold to hot, the heat flux formula_482 is expected to have a negative inner product with formula_486 so that formula_489 Substituting Fourier's law then gives this expectation as formula_490 implying that the conductivity matrix should be positive definite. Ordinarily formula_485 should be symmetric, however it becomes nonsymmetric in the presence of a magnetic field as in a thermal Hall effect. More generally in thermodynamics, the flow of heat and particles is a fully coupled system as described by the Onsager reciprocal relations, and the coupling matrix is required to be positive semi-definite (possibly non-symmetric) in order that entropy production be nonnegative.