Struggling with isposdef and floating point errors

You can use Hermitian to tell the program that a matrix is supposed to be Hermitian. Then it will only look at half the matrix (by default, the upper triangle) and assume that the opposite triangle is conjugate-equal.

julia> using LinearAlgebra

julia> Hermitian([1 2; 3 4], :U) # :U is the default
2×2 Hermitian{Int64, Matrix{Int64}}:
 1  2
 2  4

julia> Hermitian([1 2; 3 4], :L)
2×2 Hermitian{Int64, Matrix{Int64}}:
 1  3
 3  4
3 Likes