QuantumInfo.ForMathlib.Matrix
92 declarations
Let be an matrix over a field , where the index set is finite. If the rank of the matrix is 0, then is the zero matrix.
is Hermitian if is self-adjoint
#smul_selfAdjointLet be a Hermitian matrix and be a scalar in a field (where is or ). If is self-adjoint (meaning , or equivalently, is real-valued), then the scalar product is also a Hermitian matrix.
is Hermitian if and is Hermitian
#smul_im_zeroLet be a Hermitian matrix and be a scalar in a field (where is or ). If the imaginary part of is zero, then the scalar product is also a Hermitian matrix.
Real Scalar Multiplication Preserves Hermitian Property of Matrices
#smul_realLet be a Hermitian matrix and be a real number. Then the scalar product is also a Hermitian matrix. Here, a matrix is Hermitian if it equals its conjugate transpose (), and denotes the multiplication of each entry of by the real scalar .
The -subspace of Hermitian matrices
#HermitianSubspaceGiven a finite set and a field that is either the real numbers or the complex numbers (an `RCLike` field), the set of all Hermitian matrices (where ) forms a subspace of the vector space of all matrices over , when considered as a vector space over the real numbers .
The trace of a Hermitian matrix is real ()
#re_trace_eq_traceLet be a Hermitian matrix. Then the real part of the trace of is equal to the trace of , implying that the trace of is a real number: .
for Hermitian
#sum_eigenvalues_eq_traceLet be a Hermitian matrix. The sum of the eigenvalues of , denoted as , is equal to the trace of the matrix, . Here, ranges over the index set of the matrix dimensions.
If for Hermitian , then
#eigenvalues_zero_eq_zeroLet be a Hermitian matrix. If all the eigenvalues of are equal to zero for all , then is the zero matrix ().
Let and be two matrices. The conjugate transpose (Hermitian conjugate) of the Kronecker product of and , denoted , is equal to the Kronecker product of their respective conjugate transposes, .
The Kronecker product of Hermitian matrices is Hermitian
#kroneckerMap_IsHermitianLet and be Hermitian matrices. Then their Kronecker product is also a Hermitian matrix.
for positive semidefinite matrices
#trace_zeroLet be a positive semidefinite matrix. If the trace of is zero (), then must be the zero matrix ().
for positive semidefinite
#trace_zero_iffLet be a positive semidefinite matrix. Then the trace of is zero if and only if is the zero matrix, i.e., .
Let be an element of a field that is either the real numbers or the complex numbers . The squared norm of , denoted as (or `normSq z`), is equal to the product of its complex conjugate and itself, i.e., .
Finsupp sum as a conditional sum over a finite type
#sum_eq_iteLet be a finite set and be types such that has a zero element and is an additive commutative monoid. For any finitely supported function (denoted by `f : α →₀ M`) and any function , the sum of over the support of is equal to the sum over all of the conditional expression: if then , otherwise . That is,
The outer product is positive semidefinite.
#outer_self_conjLet be a vector in , where is either the real or complex numbers. Let denote the complex conjugate vector of (given by ). Then the outer product of and its conjugate, defined as the matrix (represented by `vecMulVec v (conj v)`), is a positive semidefinite matrix.
A non-negative linear combination of positive semidefinite matrices is positive semidefinite
#convex_coneLet and be positive semidefinite matrices and let be scalars such that and . Then the linear combination is also a positive semidefinite matrix.
A positive standard basis matrix is positive semidefinite iff row equals column
#stdBasisMatrix_iff_eqLet be a matrix defined such that the entry at row and column is , where is a positive constant (), and all other entries are zero. Then is positive semidefinite if and only if .
The Kronecker product of positive semidefinite matrices is positive semidefinite
#PosSemidef_kroneckerLet and be positive semidefinite matrices. Then their Kronecker product is also a positive semidefinite matrix.
for all iff
#zero_dotProduct_zero_iffLet be a positive semidefinite matrix. Then for all vectors , the quadratic form if and only if , where denotes the conjugate transpose of .
If is positive semidefinite and , then is positive semidefinite
#pos_smulLet be a matrix and be a scalar in a field . If the scalar product is a positive semidefinite matrix and , then is also a positive semidefinite matrix.
and if and only if
#zero_posSemidef_neg_posSemidef_iffLet be a matrix. Then is positive semidefinite and its negation is also positive semidefinite if and only if is the zero matrix ().
The kernel of a positive definite matrix is trivial ()
#toLin_ker_eq_botLet be a positive definite matrix. Then the kernel of the linear map associated with is trivial, i.e., (represented as ).
A positive semidefinite matrix with trivial kernel is positive definite
#of_toLin_ker_eq_botLet be a matrix. If the kernel of the linear map defined by is trivial (i.e., ) and is positive semidefinite, then is positive definite.
for Hermitian Matrices
#ker_range_antitoneLet be a finite type with decidable equality, and let and be Hermitian matrices over the complex numbers . The kernel of the linear map associated with is a subspace of the kernel of the linear map associated with if and only if the range of the linear map associated with is a subspace of the range of the linear map associated with . That is, if and only if .
An additive map is monotonic if it maps positive semidefinite matrices to non-negative values
#le_of_nonneg_impLet be a type that forms an ordered additive abelian group (specifically, an `AddCommGroup` with a `PartialOrder` such that addition is monotonic). Let be an additive group homomorphism. If maps every positive semidefinite matrix to a non-negative element in (i.e., ), then is monotonic with respect to the Loewner order: for any matrices and , if , then .
for Positive-Preserving Homomorphisms into Matrices
#le_of_nonneg_imp'Let be an ordered additive abelian group and let be an additive group homomorphism. Suppose that for every , if , then the matrix is positive semidefinite. Then for any such that , it follows that in the Loewner order (i.e., is positive semidefinite).
for matrices
#mul_mul_conjTranspose_monoLet be Hermitian matrices and be an arbitrary matrix. If in the Loewner order (meaning is a positive semidefinite matrix), then it holds that , where denotes the conjugate transpose of .
for matrices
#conjTranspose_mul_mul_monoLet be Hermitian matrices and be an arbitrary matrix. If in the Loewner order (meaning is a positive semidefinite matrix), then it holds that , where denotes the conjugate transpose of .
Let be a Hermitian matrix in and let be the proof of its Hermiticity. The matrix is positive semidefinite () if and only if all of its eigenvalues are non-negative, i.e., for all , where denotes the eigenvalues of provided by .
The Diagonal Map is Monotone with Respect to the Loewner Order
#diag_monotoneLet be a field with a partial order (specifically one where matrices can be positive semidefinite, such as or ). The diagonal map , which associates a square matrix with the vector of its diagonal entries , is monotone with respect to the Loewner order on matrices and the entrywise order on vectors. That is, if in the sense that is a positive semidefinite matrix, then for every index , the diagonal entries satisfy .
Let and be square matrices. If with respect to the Loewner order (meaning is a positive semidefinite matrix), then for every index , the diagonal entries satisfy , where and denote the -th elements of the diagonal vectors of and respectively.
The trace function is monotone with respect to the Loewner order
#trace_monotoneThe trace function is monotone with respect to the Loewner order. Specifically, if and are square matrices over such that (meaning is positive semidefinite), then .
for Positive Semidefinite Matrices
#trace_monoLet and be positive semidefinite matrices of the same size with entries in a field . If with respect to the Loewner order (meaning is positive semidefinite), then the trace of is less than or equal to the trace of , i.e., .
The `diagonal` matrix construction is monotone with respect to the Loewner order
#diagonal_monotoneThe function `diagonal`, which maps a vector to a diagonal matrix with entries , is monotone. That is, for any vectors , if component-wise, then the corresponding diagonal matrices satisfy in the Loewner order (i.e., their difference is positive semidefinite).
for Positive Semidefinite Matrices
#diagonal_monoLet and be vectors of length with entries in a field . If (entrywise), then the diagonal matrix formed from is less than or equal to the diagonal matrix formed from in the Loewner order (i.e., is a positive semidefinite matrix).
For any two vectors , the inequality holds component-wise if and only if the corresponding diagonal matrices satisfy the Loewner order partial regulation, denoted by . Here, represents the square matrix with elements of on the main diagonal and zeros elsewhere, and the inequality between matrices refers to the positive semidefiniteness of their difference.
for Hermitian Matrices
#le_smul_one_of_eigenvalues_iffLet be a Hermitian matrix and be a scalar. Then all the eigenvalues of satisfy if and only if in the Loewner order, where is the identity matrix and means that is a positive semidefinite matrix.
Let be an Hermitian matrix over a field , and let be a real number. Then for all eigenvalues of if and only if in the Loewner order, where is the identity matrix and the inequality indicates that is a positive semidefinite matrix.
Left partial trace of a matrix
#traceLeftGiven a matrix with row indices in and column indices in over a ring , the left partial trace is a matrix in . Each entry of the resulting matrix at position is defined as the sum over the common first index : This operation corresponds to taking the partial trace over the first subsystem in a tensor product space.
Right partial trace of a matrix
#traceRightGiven a matrix with row indices in and column indices in over a ring , the right partial trace is a matrix in . Each entry of the resulting matrix at position is defined as the sum over the common second index : This operation corresponds to taking the partial trace over the second subsystem in a tensor product space.
Let be a matrix with row and column indices in over a ring . The trace of the left partial trace of is equal to the trace of : where is the partial trace over the first subsystem.
Let be a matrix with row and column indices in over a ring . The trace of the right partial trace of is equal to the trace of , i.e., where is the partial trace over the second subsystem.
The Partial Trace over the Left Subsystem of a Hermitian Matrix is Hermitian
#traceLeftLet be a matrix of shape over a ring with an involution. If is a Hermitian matrix, then its partial trace over the left subsystem, denoted by , is also a Hermitian matrix.
The Partial Trace over the Right Subsystem of a Hermitian Matrix is Hermitian
#traceRightLet be a matrix of shape over a ring . If is a Hermitian matrix, then its partial trace over the right subsystem, denoted by , is also a Hermitian matrix.
Let be a ring, and let be a block matrix. For any matrix , the trace of the product of and the Kronecker product of with the identity matrix is equal to the trace of the product of the partial trace of over the second subsystem and . That is, , where denotes the partial trace `traceRight`.
Let be a ring, and let be a matrix of shape over . For any matrix of shape , the trace of the product of and the Kronecker product of the identity matrix and is equal to the trace of the product of the partial trace of over the first system and . That is, where denotes the partial trace over the left subsystem (`traceLeft`).
The partial trace over the first subsystem preserves positive semidefiniteness.
#traceLeftLet be a positive semidefinite block matrix in . Then its partial trace over the first subsystem, denoted by , is also positive semidefinite.
The Right Partial Trace of a Positive Semidefinite Matrix is Positive Semidefinite
#traceRightLet be a matrix with row and column indices in over a field . If is positive semidefinite, then its right partial trace , which is a matrix of size defined by , is also positive semidefinite.
The Kronecker product of two positive definite matrices is positive definite.
#kronLet and be finite types with decidable equality, and let be a field with a structure of a conjugate-closed field (such as or ). For any two square matrices and , if is positive definite and is positive definite, then their Kronecker product is also positive definite.
An injective submatrix of a positive definite matrix is positive definite
#submatrixLet be a field which is either the real numbers or the complex numbers . Let and be finite types. Let be a square matrix. If is positive definite and is an injective function, then the submatrix is also positive definite.
If is positive definite, then is positive definite
#reindexLet be a field which is either the real numbers or the complex numbers . Let and be finite types with decidable equality. For any square matrix and any equivalence (bijection) , if is positive definite, then the reindexed matrix is also positive definite.
is positive definite is positive definite
#reindex_iffLet be a field which is either the real numbers or the complex numbers . Let and be finite types. For any square matrix and any equivalence (bijection) , the matrix is positive definite if and only if the reindexed matrix is positive definite.
and implies for complex matrices
#rsmulLet be a complex matrix of size indexed by a finite type. If is positive semidefinite () and is a non-negative real number (), then the scalar product is also positive semidefinite.
The set of positive definite matrices is convex
#ConvexLet be either the real numbers or the complex numbers , and let be a finite indexing type. The set of positive definite square matrices of size over is a convex set over the real numbers. That is, for any two positive definite matrices and any , the linear combination is also positive definite.
iff is Hermitian and has strictly positive eigenvalues
#PosDef_iff_eigenvalues'Let be a square matrix of size over a field (where is either or ). is positive definite () if and only if is Hermitian and all of its eigenvalues are strictly positive.
Eigenvalues of are applied to eigenvalues of Hermitian matrix
#cfc_eigenvaluesLet be a Hermitian matrix in , where is a conjugate-reals-like field (such as or ), and let be a function. Let denote the matrix obtained by applying the continuous functional calculus to with respect to . Then there exists a permutation of the indices such that the eigenvalues of are given by the composition , where represents the eigenvalues of . In other words, the set of eigenvalues of is .
Eigenvalues of a unitarily diagonalizable Hermitian matrix are a permutation of its diagonal entries
#eigenvalues_eq_of_unitary_similarity_diagonalLet be a finite index set and be a field or . Let be a Hermitian matrix over . If there exists a unitary matrix and a diagonal matrix with real entries such that is unitarily similar to , i.e., then there exists a permutation of the index set such that the eigenvalues of are given by the entries of permuted by , specifically:
The linear map of the identity matrix is the identity operator
#toEuclideanLin_oneLet be the identity matrix over a ring . Then the linear map associated with acting on the Euclidean space , denoted by , is the identity linear operator .
Functional calculus for diagonal matrices:
#cfc_diagonalLet be a finite index set and be either or . Given a function and a real-valued function , let be the diagonal matrix whose entries are the values of cast into . Then the continuous functional calculus (cfc) of applied to is equal to the diagonal matrix whose entries are the values of , specifically:
Eigenvalues of a Positive Semidefinite Matrix are Non-negative
#pos_of_mem_spectrumLet be a matrix over a field (where is or ). If is a positive semidefinite matrix, then every element in the spectrum of —that is, every eigenvalue —satisfies .
for Positive Semidefinite
#pow_addLet be a positive semidefinite matrix over (where is either or ). For any real numbers and such that their sum is non-zero (), the continuous functional calculus of the power function applied to is equal to the continuous functional calculus of the product of power functions applied to . That is,
The Law of Exponents for the Continuous Functional Calculus of a Positive Semidefinite Matrix
#pow_mulLet be a positive semidefinite matrix over a field (where is or ). For any real numbers and , the matrix constructed via the continuous functional calculus (cfc) using the function is equal to the matrix constructed using the function . That is,
for any bijection
#trace_submatrixLet be a square matrix of size with entries in . Let be a bijection (index equivalence) between the index sets and . Then the trace of the submatrix of formed by reindexing both rows and columns by is equal to the trace of . That is, .
Spectrum of Kronecker Product of Hermitian Matrices is the Product of Spectra
#spectrum_prodLet and be finite types with decidable equality. Let be a matrix and be a matrix over a field . If and are both Hermitian matrices, then the spectrum of their Kronecker product is equal to the set-wise product of their individual spectra, i.e., .
A positive definite matrix is strictly greater than zero
#zero_ltLet be a finite non-empty type and be an matrix over the complex numbers . If is positive definite ( in the sense of matrices), then is strictly greater than the zero matrix.
The Spectrum of a Hermitian Matrix is the Set of its Eigenvalues
#spectrum_eq_image_eigenvaluesLet be a finite type and be an Hermitian matrix over . The spectrum of (as a set of real numbers) is equal to the set of its eigenvalues, i.e., , where denotes the eigenvalues associated with the Hermitian matrix .
Cardinality of spectrum equals the number of distinct eigenvalues for Hermitian
#card_spectrum_eq_imageLet be a finite index set and be a Hermitian matrix. Assume that the spectrum of over , denoted , is a finite set. Then the cardinality of is equal to the number of distinct values in the set of eigenvalues of .
is Positive Semidefinite for Hermitian
#sub_iInf_eignevaluesLet be a Hermitian matrix. Then the matrix is positive semidefinite, where denotes the infimum of the eigenvalues of and denotes the identity matrix.
for Hermitian matrix
#iInf_eigenvalues_le_dotProduct_mulVecLet be a Hermitian matrix and be a vector. Then the product of the infimum of the eigenvalues of and the squared norm of (calculated as ) is less than or equal to the quadratic form , where denotes the smallest eigenvalue of . In symbols, .
If is Positive Semidefinite, then
#iInf_eigenvalues_le_of_posSemidefLet and be Hermitian matrices. If the difference is positive semidefinite, then the infimum of the eigenvalues of is less than or equal to the infimum of the eigenvalues of , that is, .
Let and be Hermitian matrices. If in the Loewner order, then the smallest eigenvalue of is less than or equal to the smallest eigenvalue of , i.e., .
Let be a Hermitian matrix and let denote the smallest eigenvalue of . Then the product of the smallest eigenvalue and the identity matrix is less than or equal to in the Loewner order, i.e., .
If is positive semidefinite, the spectrum of is bounded below by the minimum eigenvalue of
#spectrum_subset_Ici_of_subLet be a finite type and be a real-complex-like field (such as or ). Let and be matrices over . If is a Hermitian matrix and the matrix is positive semidefinite, then the real spectrum of is a subset of the interval , where is the minimum eigenvalue of .
If is positive semidefinite, the spectrum of is bounded above by the maximum eigenvalue of .
#spectrum_subset_Iic_of_subLet be a finite type and be a field with a structure of a real-complex-like field (such as or ). Let and be matrices over . If is a Hermitian matrix and the matrix is positive semidefinite, then the real spectrum of is a subset of the interval , where is the maximum eigenvalue of .
The spectrum of is contained in if and are positive semidefinite
#spectrum_subset_of_mem_IccLet be a finite type and be a field with the structure of a real-complex-like field (such as or ). Let , and be matrices over . If and are Hermitian matrices, and the matrices and are both positive semidefinite, then the real spectrum of is contained within the closed interval , where is the minimum eigenvalue of and is the maximum eigenvalue of .
Right partial trace equals left partial trace after swapping tensor factors
#traceRight_eq_traceLeft_reindexLet be an additive commutative monoid and be finite types. For any matrix of size with entries in , the right partial trace of is equal to the left partial trace of the matrix obtained by reindexing using the swap of the tensor factors (the commutativity of the Cartesian product ). That is, where denotes the reindexed matrix .
The trace of a nonzero positive semidefinite matrix is strictly positive
#trace_posLet be a field with a structure of a real-complex like field (such as or ) and be a finite type. For any matrix , if is positive semidefinite and is not the zero matrix, then the trace of is strictly greater than zero, i.e., .
Additivity of the left partial trace
#traceLeft_addLet be an additive commutative monoid, and let be finite types. For any matrices , the left partial trace of their sum is the sum of their individual left partial traces:
The partial trace over the left subsystem is compatible with negation:
#traceLeft_negFor any matrix whose row and column indices are structured as products and respectively, the partial trace over the left-hand subsystem satisfies the property . Here, denotes the operation of taking the trace specifically over the first component of the index product.
The partial trace over the left subsystem is distributive over subtraction:
#traceLeft_subFor any matrices and whose row and column indices are structured as and respectively, the partial trace over the left-hand subsystem satisfies the linearity property . Here, denotes the operation of taking the trace specifically over the first component of the index product.
The partial trace over the right subsystem is additive:
#traceRight_addFor any matrices and whose row and column indices are structured as and respectively, the partial trace over the right-hand subsystem satisfies the linearity property . Here, denotes the operation of taking the trace specifically over the second component of the index product.
The partial trace over the right subsystem is compatible with negation:
#traceRight_negFor any matrix with row indices in and column indices in , the right partial trace of its additive inverse is the additive inverse of its right partial trace, i.e., .
The right partial trace is distributive over subtraction:
#traceRight_subFor any matrices and whose row and column indices are structured as and over a ring , the right partial trace satisfies the distributive property over subtraction: where denotes the matrix obtained by summing over the second component of the index product.
Let be a square-block matrix of type with entries in , and let be a scalar from a ring . The partial trace of the scalar product over the first subsystem (left trace) is equal to the scalar multiplied by the partial trace of over the first subsystem, i.e., .
Let be a matrix in and be a scalar in . The right partial trace of the scalar multiplication is equal to the scalar multiplied by the right partial trace of , i.e., .
Rows of a Unitary Matrix have Unit Norm
#unitaryGroup_row_normLet be a finite type and be an element of the unitary group of complex matrices. For any row index , the sum of the squared norms of the entries in that row (or column, depending on indexing convention) is equal to 1:
Kronecker product of a family of matrices
#piProdLet be a commutative monoid and let be a collection of square matrices where each is a matrix with entries in . The function `Matrix.piProd` constructs a new matrix with dimensions , indexed by the Cartesian product of the original index sets. The entries of this matrix are defined by the product of the entries of the individual matrices: where and are vectors such that . This construction corresponds to the Kronecker product (tensor product) of the family of matrices .
The Kronecker product of Hermitian matrices is Hermitian
#piProdLet be a commutative semiring with a star-ring structure (an involution ), and let be a family of square matrices over . If every matrix in the family is Hermitian (i.e., ), then their Kronecker product (denoted as `piProd A`) is also a Hermitian matrix.
Let be a commutative semiring and let be a family of square matrices over indexed by . Then the trace of the Kronecker (tensor) product of these matrices, denoted by , is equal to the product of the traces of the individual matrices: where denotes the product construction for matrices (corresponding to the tensor product on the block diagonal or the Kronecker product depending on the indexing convention).
Matrix.PosSemidef.piProd
#piProd[RCLike R] (hA : ∀ i, (A i).PosSemidef) : (piProd A).PosSemidef
Submatrix Equals Product of Indexing Matrices and
#submatrix_eq_mul_mulLet be a semiring and let be types such that is finite and has decidable equality. Let be a square matrix of size over . Given two indexing maps and , the submatrix of formed by these maps is equal to the product of an indexing matrix, the matrix , and another indexing matrix: More precisely, , where denotes the identity matrix over and is the identity map on .
Let be finite types and be a commutative star-ring. Given matrices , , , and , then the conjugate of the Kronecker product by the Kronecker product satisfies: where denotes the Kronecker product and denotes the conjugate transpose (Hermitian adjoint) of a matrix .
