33import warnings
44from copy import deepcopy
55import numpy as np
6- from math import pi # Don't remove
6+ from math import pi # Don't remove
77
88from qutip_qip .circuit import QubitCircuit
99from qutip_qip .operations import (
1414)
1515from qutip_qip .qasm import qasm_tokenize
1616
17+
1718class QasmGate :
1819 """
1920 Class which stores the gate definitions as specified in the QASM file.
@@ -25,6 +26,7 @@ def __init__(self, name, gate_args, gate_regs):
2526 self .gate_regs = gate_regs
2627 self .gates_inside = []
2728
29+
2830def _get_qiskit_gates ():
2931 """
3032 Create and return a dictionary containing a few commonly used qiskit gates
@@ -54,7 +56,6 @@ def ch():
5456 return {"ch" : ch , "tdg" : tdg , "id" : id , "u2" : u2 , "sdg" : sdg , "cu3" : cu3 }
5557
5658
57-
5859def _gate_processor (command ):
5960 """
6061 Process tokens for a gate call statement separating them into args and regs.
@@ -214,7 +215,7 @@ def _initialize_pass(self):
214215 continue
215216 else :
216217 raise SyntaxError ("QASM: incorrect bracket formatting" )
217-
218+
218219 elif open_bracket_mode :
219220 # Define the decomposition of custom QASM gate
220221 if command [0 ] == "{" :
@@ -269,7 +270,7 @@ def _initialize_pass(self):
269270 self .num_cbits += num_regs
270271 else :
271272 raise SyntaxError ("QASM: incorrect bracket formatting" )
272-
273+
273274 elif command [0 ] == "reset" :
274275 raise NotImplementedError (
275276 ("QASM: reset functionality " "is not supported." )
0 commit comments