From b444f2e1c438c2fe7e71945ca7033ae767ec7dc1 Mon Sep 17 00:00:00 2001 From: CalMacCQ <93673602+CalMacCQ@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:44:57 +0000 Subject: [PATCH] Add `KAKDecompostion` pass to `optimisation_level=2` after routing (#51) * add post-routing KAKDecomposition pass to OL=2 * consistent syntax * fix bad syntax --- pytket/extensions/pyquil/backends/forest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pytket/extensions/pyquil/backends/forest.py b/pytket/extensions/pyquil/backends/forest.py index 6429d10..4444cb0 100644 --- a/pytket/extensions/pyquil/backends/forest.py +++ b/pytket/extensions/pyquil/backends/forest.py @@ -46,6 +46,7 @@ EulerAngleReduction, CXMappingPass, auto_rebase_pass, + KAKDecomposition, SequencePass, SynthesiseTket, DecomposeBoxes, @@ -165,7 +166,10 @@ def default_compilation_pass(self, optimisation_level: int = 2) -> BasePass: ) passlist.append(NaivePlacementPass(self.backend_info.architecture)) # type: ignore if optimisation_level == 2: - passlist.append(CliffordSimp(False)) + # Add some connectivity preserving optimisations after routing. + passlist.extend( + [KAKDecomposition(allow_swaps=False), CliffordSimp(allow_swaps=False)] + ) if optimisation_level > 0: passlist.append(SynthesiseTket()) passlist.append(self.rebase_pass())