From c00d5ebcb9dddb7f9af760410e1f6785c5da5dbb Mon Sep 17 00:00:00 2001 From: James Brown Date: Fri, 3 Dec 2021 11:37:55 -0500 Subject: [PATCH] list comprehension --- tangelo/linq/translator/translate_cirq.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tangelo/linq/translator/translate_cirq.py b/tangelo/linq/translator/translate_cirq.py index 8169d0add..9cfe94036 100644 --- a/tangelo/linq/translator/translate_cirq.py +++ b/tangelo/linq/translator/translate_cirq.py @@ -83,10 +83,8 @@ def translate_cirq(source_circuit, noise_model=None): # Maps the gate information properly. Different for each backend (order, values) for gate in source_circuit._gates: if (gate.control is not None) and gate.name != 'CNOT': - control_list = [] num_controls = len(gate.control) - for c in gate.control: - control_list.append(qubit_list[c]) + control_list = [qubit_list[c] for c in gate.control] if gate.name in {"H", "X", "Y", "Z", "S", "T"}: target_circuit.append(GATE_CIRQ[gate.name](qubit_list[gate.target[0]])) elif gate.name in {"CH", "CX", "CY", "CZ"}: