Skip to content

Commit

Permalink
rebase to CX gates to redirect ECR gates
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdilkes committed Oct 16, 2024
1 parent c1db493 commit a8ff759
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pytket/extensions/qiskit/backends/ibm.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,9 @@ def default_compilation_pass_offline(
]
)

if supports_rz:
passlist.extend(
[IBMQBackend.rebase_pass_offline(primitive_gates), RemoveRedundancies()]
)
passlist.extend(
[IBMQBackend.rebase_pass_offline(primitive_gates), RemoveRedundancies()]
)
return SequencePass(passlist, False)

@property
Expand Down
2 changes: 2 additions & 0 deletions pytket/extensions/qiskit/backends/ibm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from pytket.architecture import Architecture
from pytket.backends.status import StatusEnum
from pytket.transform import Transform
from pytket.passes import RebaseTket

from ..qiskit_convert import tk_to_qiskit, qiskit_to_tk

Expand Down Expand Up @@ -126,6 +127,7 @@ def lightsabre(circuit: Circuit) -> Circuit:
c: Circuit = qiskit_to_tk(sabre_pass.run(tk_to_qiskit(circuit)))
c.remove_blank_wires()
c.rename_units({q: Node(q.index[0]) for q in c.qubits})
RebaseTket().apply(c)
Transform.DecomposeCXDirected(architecture).apply(c)
return c

Expand Down

0 comments on commit a8ff759

Please sign in to comment.