IsHermitian
Tests if a matrix is Hermitian.
Syntax
-
IsHermitian(A[, ε])-
Ais a matrix -
εis a positive number
-
Description
If A is a matrix, then IsHermitian(A) returns true iff A is Hermitian (self-adjoint), that is, iff A is square and A[i, j] = A[j, i]* for all valid indices i and j. (Here, the asterisk denotes complex conjugation of a complex number.) Floating-point comparisons are made with epsilon ε.
Examples
A ≔ ❨❨5, 1, 2, 3❩, ❨1, 6, 3, 7❩, ❨2, 3, 5, i❩, ❨3, 7, i, 4❩❩
⎛5 1 2 3⎞ ⎜1 6 3 7⎟ ⎜2 3 5 i⎟ ⎝3 7 i 4⎠
IsHermitian(A)
false
A ≔ ❨❨5, 1, 2, 3❩, ❨1, 6, 3, 7❩, ❨2, 3, 5, i❩, ❨3, 7, −i, 4❩❩
⎛ 5 1 2 3⎞ ⎜ 1 6 3 7⎟ ⎜ 2 3 5 i⎟ ⎝ 3 7 −i 4⎠
IsHermitian(A)
true