2828 "cx" : CNOT ,
2929 "cz" : CZ ,
3030 "swap" : SWAP ,
31- "2cx" : CCNOT ,
3231 "h" : H ,
3332 "x" : X ,
3433 "y" : Y ,
@@ -63,11 +62,6 @@ def convert_to_cirq(qrisp_circuit):
6362 qrisp_circ_num_qubits = qrisp_circuit .num_qubits ()
6463 qrisp_circ_ops_data = qrisp_circuit .data
6564
66- # create generic 'ncx' keys in qrisp_cirq_ops_dict for the possibility of multicontrolled cx gates
67- for n in range (3 , qrisp_circ_num_qubits + 1 ):
68- # start at 3 because 2cx is a Toffoli gate which already exists in Cirq
69- qrisp_cirq_ops_dict [f"{ n } cx" ] = None
70-
7165 # create an empty Cirq circuit
7266 cirq_circuit = Circuit ()
7367 cirq_qubits = [LineQubit (i ) for i in range (qrisp_circ_num_qubits )]
@@ -88,6 +82,8 @@ def convert_to_cirq(qrisp_circuit):
8882
8983 if op_i not in qrisp_cirq_ops_dict :
9084 try :
85+ # this code block also ends up transpiling a mcx gate
86+ # qrisp allows for different types of control state but cirq does not
9187 def transpile_predicate (op ):
9288 if op .name == op_i :
9389 return True
@@ -111,7 +107,6 @@ def transpile_predicate(op):
111107 "cx" ,
112108 "cz" ,
113109 "swap" ,
114- "2cx" ,
115110 "h" ,
116111 "x" ,
117112 "y" ,
@@ -130,10 +125,6 @@ def transpile_predicate(op):
130125 "sx" ,
131126 "sx_dg" ,
132127 ]
133- # create generic 'ncx' keys in the cirq gates filter for the possibility of multicontrolled cx gates
134- for n in range (3 , qrisp_circ_num_qubits + 1 ):
135- # start at 3 because 2cx is a Toffoli gate which already exists in Cirq
136- cirq_gates_filter .append (f"{ n } cx" )
137128
138129 if (op_i not in cirq_gates_filter ) and instr .op .definition :
139130 new_circ = instr .op .definition
@@ -190,11 +181,6 @@ def transpile_predicate(op):
190181 cirq_circuit .append (
191182 cirq_gate (* cirq_ctrl_qubits , * cirq_target_qubits )
192183 )
193- # for multi-qubit controlled operations mcx
194- else :
195- cirq_circuit .append (
196- X (* cirq_target_qubits ).controlled_by (* cirq_ctrl_qubits )
197- )
198184
199185 else :
200186 # for simple single qubit gates
0 commit comments