Skip to content

Commit

Permalink
Remove unnecessary canonicalisation steps before non-adjacent two-qub…
Browse files Browse the repository at this point in the history
…it 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.
  • Loading branch information
PabloAndresCQ authored Jan 24, 2025
1 parent 52991f5 commit 57b7a20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytket/extensions/cutensornet/structured_state/mps_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 57b7a20

Please sign in to comment.