diff --git a/quimb/tensor/tensor_3d.py b/quimb/tensor/tensor_3d.py index 8bc9a800..8f2f011f 100644 --- a/quimb/tensor/tensor_3d.py +++ b/quimb/tensor/tensor_3d.py @@ -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, @@ -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,