Closed marekgluza closed 2 months ago
I think there is an error in the way you loop over the eigenvectors. I believe you should loop over eigen.T
and not eigen
. At least for numpy we are using np.linalg.eigvalsh that returns a (N,N) tensor where the eigenvectors are identified by the column and not by the row, this is why you need to transpose the tensor.
See https://numpy.org/doc/stable/reference/generated/numpy.linalg.eig.html.
As a double check you can see that the ground state in qibo is implemented accordingly
https://github.com/qiboteam/qibo/blob/1bb08d9dab45205875073c371ea4fcefa982221f/src/qibo/hamiltonians/hamiltonians.py#L457-L458
Thanks so much @andrea-pasquale !!
Produces unexpected results: