Skip to content

Commit

Permalink
TN: 3d ctmrg change default PBC boundary seq
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed Apr 10, 2024
1 parent 5ad3302 commit 24b21dd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion quimb/tensor/tensor_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ def contract_ctmrg(
lazy=False,
mode="projector",
compress_opts=None,
sequence=("xmin", "xmax", "ymin", "ymax", "zmin", "zmax"),
sequence=None,
xmin=None,
xmax=None,
ymin=None,
Expand All @@ -1518,6 +1518,23 @@ def contract_ctmrg(
# we are implicitly asking for the tensor network
final_contract = False

if sequence is None:
sequence = []
if self.is_cyclic_x():
sequence.append("xmin")
else:
sequence.extend(["xmin", "xmax"])

if self.is_cyclic_y():
sequence.append("ymin")
else:
sequence.extend(["ymin", "ymax"])

if self.is_cyclic_z():
sequence.append("zmin")
else:
sequence.extend(["zmin", "zmax"])

return self._contract_interleaved_boundary_sequence(
contract_boundary_opts=contract_boundary_opts,
canonize=canonize,
Expand Down

0 comments on commit 24b21dd

Please sign in to comment.