netket.operator.to_sparse_cached#
- netket.operator.to_sparse_cached(Ô)[source]#
Returns the sparse matrix representation of the operator with caching.
Equivalent to
DiscreteOperator.to_sparse()but, caches the result of the last 5 calls to avoid recomputing the sparse matrix multiple times for the same operator.- Parameters:
Ô – The discrete operator to convert to sparse format.
Ô (DiscreteOperator)
- Return type: