Skip to content

Remove `EdResult` and streamline ED interface

Vicentini Filippo requested to merge github/fork/femtobit/ed into master

Created by: femtobit

The existence of the EdResult class was purely for reasons of backwards compatibility with the old C++ interface. The step to version 3.0 provides the ideal oportunity to remove it.

Directly returning the array of eigenvalues and, optionally, eigenvectors is in line with Numpy and Scipy and makes the NetKet interface more comfortable to use. (It is just a thin convenience wrapper anyways.)

Further, AbstractOperator.to_dense returns numpy.ndarray now, instead of numpy.matrix, because the use of numpy.matrix is no longer recommended according to the official documentation and can lead to surprising errors when used in code that expects to deal with ndarrays. (For example: Using numpy.vdot(v[:, 0], op(v[:, 0])) to compute an expectation value of the 0th eigenvector works with ndarray but not with matrix due to differences in how slicing works.)

Merge request reports