There seem to be a lot of work on finding the nearest positive semidefinite matrix to a real symmetric matrix, but other than via an eigendecomposition, which is slow (as below), does anyone know of a way to find the nearest PSD matrix to a complex Hermitian matrix?

function project_psd(H)
# take the eigendecomposition, set any negative
# eigenvalues to 0, and reconstruct
D,V = eigen(Hermitian(H))
D .= max.(D,0)
return Hermitian(V*Diagonal(D)*V')
end

I don’t know much about this type of problems, but often methods that work or symmetric matrices work for hermitian as well, by changing transposes to adjoints and adding a few real().