Skip to content

Commit fd76818

Browse files
committed
TN: fix callable j for classical spin system builders
1 parent a24d4f2 commit fd76818

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quimb/tensor/tensor_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ def parse_j_coupling_to_function(j):
21182118
function.
21192119
"""
21202120
if callable(j):
2121-
return j
2121+
return functools.cache(j)
21222122

21232123
elif isinstance(j, dict):
21242124

0 commit comments

Comments
 (0)