19
19
from typing import (
20
20
Callable ,
21
21
Optional ,
22
- Union ,
23
22
Any ,
24
23
Iterable ,
25
24
cast ,
82
81
from pytket .pauli import Pauli , QubitPauliString
83
82
from pytket .architecture import Architecture , FullyConnected
84
83
from pytket .utils import QubitPauliOperator , gen_term_sequence_circuit
85
- from pytket .passes import RebaseCustom
84
+ from pytket .passes import AutoRebase
86
85
87
86
if TYPE_CHECKING :
88
87
from qiskit_ibm_runtime .ibm_backend import IBMBackend # type: ignore
@@ -762,9 +761,6 @@ def append_tk_command_to_qiskit(
762
761
return qcirc .append (g , qargs = qargs )
763
762
764
763
765
- # Define varibles for RebaseCustom
766
- _cx_replacement = Circuit (2 ).CX (0 , 1 )
767
-
768
764
# The set of tket gates that can be converted directly to qiskit gates
769
765
_supported_tket_gates = set (_known_gate_rev_phase .keys ())
770
766
@@ -779,18 +775,8 @@ def append_tk_command_to_qiskit(
779
775
)
780
776
781
777
782
- Param = Union [float , "sympy.Expr" ] # Type for TK1 and U3 parameters
783
-
784
-
785
- # Use the U3 gate for tk1_replacement as this is a member of _supported_tket_gates
786
- def _tk1_to_u3 (a : Param , b : Param , c : Param ) -> Circuit :
787
- tk1_circ = Circuit (1 )
788
- tk1_circ .add_gate (OpType .U3 , [b , a - 1 / 2 , c + 1 / 2 ], [0 ]).add_phase (- (a + c ) / 2 )
789
- return tk1_circ
790
-
791
-
792
778
# This is a rebase to the set of tket gates which have an exact substitution in qiskit
793
- supported_gate_rebase = RebaseCustom (_protected_tket_gates , _cx_replacement , _tk1_to_u3 )
779
+ supported_gate_rebase = AutoRebase (_protected_tket_gates )
794
780
795
781
796
782
def tk_to_qiskit (
0 commit comments