You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As always, loving this library! I have a use case that makes sense to at least test on the sparse backend. I'm using quimb-1.3.0 (the PyPI version, not the development branch). I noticed that specifying matrices of sparse.COO type is fine until I try to create the MatrixProductOperator or MatrixProductState objects, because sparse.COO.transpose works a bit differently. I was able to fix the problem using autoray, so no new imports on your end. For example, this line becomes
to get the correct behavior. I can confirm that this is all that is necessary to create MPS/MPO with sparse backend tensors. I understand if you don't want to fix this on the master branch, since I've been seeing a lot of activity on the develop branch lately; in that case, maybe this "issue" will help someone with a similar use case.
The text was updated successfully, but these errors were encountered:
Yeah as you have found the idea is to route all functions like transpose through the same interface, clearly there are a few places that don't use the syntax:
do('transpose', x, order)
so quimb-side we just need to update those remaining places (actually in the develop branch it looks like this is already done for MPO/MPS).
Then I'm guessing sparse only provides the method COO.transpose rather than the function sparse.transpose. I think we should add sparse_transpose to autoray directly since the idea of autoray is definitely to include these small translations so that the user doesn't have to modify anything at all.
E.g. here's the custom version of transpose for torch arrays:
Hi @jcmgray,
As always, loving this library! I have a use case that makes sense to at least test on the sparse backend. I'm using quimb-1.3.0 (the PyPI version, not the development branch). I noticed that specifying matrices of
sparse.COO
type is fine until I try to create theMatrixProductOperator
orMatrixProductState
objects, becausesparse.COO.transpose
works a bit differently. I was able to fix the problem usingautoray
, so no new imports on your end. For example, this line becomeswhich can be combined with a quick (on the user side)
to get the correct behavior. I can confirm that this is all that is necessary to create MPS/MPO with sparse backend tensors. I understand if you don't want to fix this on the master branch, since I've been seeing a lot of activity on the develop branch lately; in that case, maybe this "issue" will help someone with a similar use case.
The text was updated successfully, but these errors were encountered: