88import abc
99from typing import Dict , List , Optional , Set , Tuple , Union
1010
11- from netqasm .lang .instr import DebugInstruction , NetQASMInstruction , core , nv , vanilla , trapped_ion_individual
11+ from netqasm .lang .instr import (
12+ DebugInstruction ,
13+ NetQASMInstruction ,
14+ core ,
15+ nv ,
16+ trapped_ion_individual ,
17+ vanilla ,
18+ )
1219from netqasm .lang .instr .flavour import REIDSFlavour
1320from netqasm .lang .operand import Immediate , Register , RegisterName
1421from netqasm .lang .subroutine import Subroutine
@@ -805,26 +812,25 @@ def _transpile_two_qubit_gate(self, instr: core.TwoQubitInstruction):
805812 # TODO Different implementation per CNOT or CPHASE or MOV
806813 if isinstance (instr , vanilla .CnotInstruction ):
807814 return [
808- trapped_ion_individual .RotXInstruction (
809- lineno = instr .lineno ,
810- reg = instr .reg0 ,
811- imm0 = Immediate (24 ),
812- imm1 = Immediate (4 )),
813-
814- trapped_ion_individual .MSGateInstruction (
815- lineno = instr .lineno ,
816- reg0 = instr .reg0 ,
817- reg1 = instr .reg1 ,
818- )] # TODO This is just a draft, not acually the proper CNOT transpile
815+ trapped_ion_individual .RotXInstruction (
816+ lineno = instr .lineno ,
817+ reg = instr .reg0 ,
818+ imm0 = Immediate (24 ),
819+ imm1 = Immediate (4 ),
820+ ),
821+ trapped_ion_individual .MSGateInstruction (
822+ lineno = instr .lineno ,
823+ reg0 = instr .reg0 ,
824+ reg1 = instr .reg1 ,
825+ ),
826+ ] # TODO This is just a draft, not acually the proper CNOT transpile
819827 elif isinstance (instr , vanilla .CphaseInstruction ):
820828 return [] # TODO add instructions
821829 elif isinstance (instr , vanilla .MovInstruction ):
822830 return [] # TODO add instructions
823831 else :
824832 raise KeyError ("" )
825833
826-
827-
828834 def _handle_single_qubit_gate (
829835 self ,
830836 instr : Union [core .SingleQubitInstruction , core .RotationInstruction ],
@@ -979,4 +985,4 @@ def _map_single_gate(
979985 else :
980986 raise ValueError (
981987 f"Don't know how to map instruction { instr } of type { type (instr )} "
982- )
988+ )
0 commit comments