Closed ghost closed 3 years ago
I believe you are looking for contract_expression
like so:
expression = contract_expression(
"pi,qj,ijkl,rk,sl->pqrs",
C.shape,
C.shape,
I.shape,
C.shape,
C.shape,
optimize="optimal",
)
print(expression)
start = time.time()
my_expr = expression(C, C, I, C, C)
end = time.time()
print(end - start)
Thank you so much! It works!
Hi, I tried to reuse path generated from contract_path. based on https://optimized-einsum.readthedocs.io/en/stable/reusing_paths.html https://optimized-einsum.readthedocs.io/en/stable/autosummary/opt_einsum.contract_path.html https://pypi.org/project/opt-einsum/
The above code leads to
How to let it run normally? Thanks.