Closed pavoljuhas closed 2 months ago
Thanks for raising the issue. Yes the problem is that quimb
has moved to contengra
for all contraction related functionality. And the 'proper' path which cotengra
calculates for a scalar contraction is the empty sequence, i.e. eq="->"
which requires no ops, and triggers this error.
I'll either fix this opt_einsum
side or put in a guard somewhere in quimb
.
Also note in general I'd recommend using the cotengra.ContractionTree
object now for inspecting contractions - it calculates all the relevant quantities lazily and a bit more efficiently.
I've just put in an explicit catch for this, and will release a new version soon.
Thank you!
What happened?
After upgrading to quimb-1.8.0 Cirq unit tests started failing with DivisionByZero error. I have tracked this down to the TensorNetwork.contract(get="path-info") which may get called with a tensor network consisting of a single scalar tensor. Please see the example below. The same code passes without a problem with quimb-1.6.0.
What did you expect to happen?
TensorNetwork.contract would return a PathInfo object as in version 1.6.0.
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
No response
Environment