Skip to content

Improve consistency of the matrix wrapper interface in Python

Vicentini Filippo requested to merge github/fork/femtobit/operator into improve_qst

Created by: femtobit

Continuing the discussion in the comments here: https://github.com/netket/netket/commit/32af4c6db6648383790703b76d251a7416e549bc#r33439404

This PR is my suggestion for exposing the matrix wrapper interface to Python (without any of the more radical ideas regarding the AbstractOperator class hierarchy).

Now, in order to get a SciPy sparse matrix from the operator, one needs to write: https://github.com/netket/netket/blob/bc8e0f3bcb8c456b78cea49260e3fffe08cf520e/Examples/ExactDiag/ising1d.py#L28 (The type='sparse' is optional, since sparse is the default in my suggestion.)

Merge request reports