Inverse of Hermitian
complex matrix giving wrong results
#54229
Labels
bug
Indicates an unexpected problem or unintended behavior
complex
Complex numbers
linear algebra
Linear algebra
I noticed a problem with
Hermitian
matrices, especially the inverse of them. For any given invertible square matrixx,
x / x
andx \ x
should be the identity matrix (or at least close to it). Invoking this on aHermitian
complex matrixy = Hermitian(x)
results in a filled complex matrix, that is not even hermitian. At leasty / y
is the hermitian conjugate ofy \ y
.Using
z = hermitianpart(y)
does however give correct results forz / z
andz \ z
. Notably,z == y
andtypeof(z) == typeof(y)
istrue
. The inverse also works for Hermitian real matrices.Minimal working example:
Output is
false
forbut expected to be
true
.Output of versioninfo():
The text was updated successfully, but these errors were encountered: