Currently, the hopping matrices can either all be stored as dense matrices, or all sparse. It might make sense to mix sparse and dense matrices though.
Since there's anyway a compatibility layer in the form of _array_cast and empty_matrix, it might not be too hard to implement.
What's more difficult is probably adjusting the sparsity dynamically. A good starting point could be analyzing the matrices in set_sparse, and then set each according to some heuristic for the filling factor (adjustable?).
To be checked:
- Find some models where mixed sparse / dense provides measurable benefit.
- Find cut-off where storing dense / sparse is more efficient
- Check impact on Hamiltonian evaluation
- Are there places where matrix manipulation relies on it all being the same data type?
Currently, the hopping matrices can either all be stored as dense matrices, or all sparse. It might make sense to mix sparse and dense matrices though.
Since there's anyway a compatibility layer in the form of
_array_castandempty_matrix, it might not be too hard to implement.What's more difficult is probably adjusting the sparsity dynamically. A good starting point could be analyzing the matrices in
set_sparse, and then set each according to some heuristic for the filling factor (adjustable?).To be checked: