- selfadj_algebra {a : α} : IsSelfAdjoint a → (algebraMap R α) (selfadjMap a) = a
Instances
Every TrivialStar
CommSemiring
is its own maximal self adjoints.
Equations
- instTrivialStar_IsMaximalSelfAdjoint = { selfadjMap := AddMonoidHom.id R, selfadj_smul := ⋯, selfadj_algebra := ⋯ }
ℝ is the maximal self adjoint elements over RCLike
Equations
- instRCLike_IsMaximalSelfAdjoint = { selfadjMap := RCLike.re, selfadj_smul := ⋯, selfadj_algebra := ⋯ }
The type of Hermitian matrices, as a Subtype
. Equivalent to a Matrix n n α
bundled
with the fact that Matrix.IsHermitian
.
Equations
- HermitianMat n α = ↥(selfAdjoint (Matrix n n α))
Instances For
Equations
Instances For
Equations
- HermitianMat.instCoeMatrix = { coe := HermitianMat.toMat }
Alias for HermitianMat.property or HermitianMat.2, this gets the fact that the value
is actually IsHermitian
.
Equations
- HermitianMat.instFun = { coe := fun (M : HermitianMat n α) => ↑M, coe_injective' := ⋯ }
Equations
- HermitianMat.instStar = { star := fun (x : HermitianMat n α) => x }
Equations
- HermitianMat.instInv = { inv := fun (x : HermitianMat n α) => ⟨(↑x)⁻¹, ⋯⟩ }
Equations
- HermitianMat.instZPow = { pow := fun (x : HermitianMat n α) (z : ℤ) => ⟨↑x ^ z, ⋯⟩ }
The Hermitian matrix given by conjugating by a (possibly rectangular) Matrix. If we required B
to be
square, this would apply to any Semigroup
+StarMul
(as proved by IsSelfAdjoint.conjugate
). But this lets
us conjugate to other sizes too, as is done in e.g. Kraus operators. That is, it's a heterogeneous conjguation.
Equations
- A.conj B = ⟨B * ↑A * B.conjTranspose, ⋯⟩
Instances For
The trace of the matrix. This requires a IsMaximalSelfAdjoint R α
instance, and then maps from
HermitianMat n α
to R
. This means that the trace of (say) a HermitianMat n ℤ
gives values in ℤ,
but that the trace of a HermitianMat n ℂ
gives values in ℝ. The fact that traces are "automatically"
real reduces coercions down the line.
Equations
Instances For
HermitianMat.trace
reduces to Matrix.trace
in the algebra.
HermitianMat.trace
reduces to Matrix.trace
when the elements are a TrivialStar
.
HermitianMat.trace
reduces to Matrix.trace
when the elements are RCLike
.
The Hermitian inner product, Tr[AB]
. This is equal to Matrix.trace (A * B)
, but gives real
values when the matrices are complex, using IsMaximalSelfAdjoint
.
Equations
- A.inner B = IsMaximalSelfAdjoint.selfadjMap (↑A * ↑B).trace
Instances For
The inner product for Hermtian matrices is equal to the trace of the product.
HermitianMat.inner
reduces to Matrix.trace (A * B)
when the elements are a TrivialStar
.
The inner product for PSD matrices is nonnegative.
The inner product for PSD matrices is at most the product of their traces.
Matrix power of a positive semidefinite matrix, as given by the elementwise real power of the diagonal in a diagonalized form.
Note that this has the usual Real.rpow
caveats, such as 0 to the power -1 giving 0.
Instances For
Equations
- HermitianMat.instRPow = { pow := HermitianMat.rpow }
Matrix logarithm (base e) of a Hermitian matrix, as given by the elementwise
real logarithm of the diagonal in a diagonalized form, using Real.log
Note that this means that the nullspace of the image includes all of the nullspace of the original matrix. This contrasts to the standard definition, which is only defined for positive definite matrices, and the nullspace of the image is exactly the (λ=1)-eigenspace of the original matrix. It coincides with the standard definition if A is positive definite.