Skip to content

Commit

Permalink
fix for #231
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed May 7, 2024
1 parent 656e933 commit 0e99f56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions quimb/tensor/contraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,11 @@ def array_contract_pathinfo(*args, **kwargs):
path = tree.get_path()
eq = tree.get_eq()

if (eq == "->") and (len(path) == 0):
# XXX: opt_einsum does not support empty paths
# https://github.com/jcmgray/quimb/issues/231
# https://github.com/dgasmith/opt_einsum/pull/229
path = ((0,),)

return oe.contract_path(eq, *shapes, shapes=True, optimize=path)[1]

0 comments on commit 0e99f56

Please sign in to comment.