From 57b7a20c7f27c636c3de0249051b33294b6ca1a1 Mon Sep 17 00:00:00 2001 From: Pablo Andres-Martinez <104848389+PabloAndresCQ@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:39:08 +0000 Subject: [PATCH] Remove unnecessary canonicalisation steps before non-adjacent two-qubit gates (#186) No need to canonicalise all the way to `l_pos`, you just need that everything left of `l_pos` is in left canonical form and everything to the right of `r_pos` in right canonical form. --- pytket/extensions/cutensornet/structured_state/mps_gate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytket/extensions/cutensornet/structured_state/mps_gate.py b/pytket/extensions/cutensornet/structured_state/mps_gate.py index 0ca7bed..22b38a8 100644 --- a/pytket/extensions/cutensornet/structured_state/mps_gate.py +++ b/pytket/extensions/cutensornet/structured_state/mps_gate.py @@ -234,7 +234,7 @@ def _apply_2q_unitary_nonadjacent( # Always canonicalise. Even in the case of exact simulation (no truncation) # canonicalisation may reduce the bond dimension (thanks to reduced QR). - self.canonicalise(l_pos, l_pos) + self.canonicalise(l_pos, r_pos) # Reshape into a rank-4 tensor gate_tensor = cp.reshape(unitary, (2, 2, 2, 2))