Skip to content

Commit 0eb2aaa

Browse files
smaller diff refactoring
Signed-off-by: Bharath <[email protected]>
1 parent b406949 commit 0eb2aaa

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

cirq-core/cirq/contrib/qasm_import/_parser_test.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,25 +1014,21 @@ def test_two_qubit_param_gates(
10141014
"qasm_gate", [g[0] for g in two_qubit_gates] + [g[0] for g in two_qubit_param_gates.keys()]
10151015
)
10161016
def test_two_qubit_gates_not_enough_qubits(qasm_gate: str):
1017-
if qasm_gate in ("cu1", "crz"):
1018-
qasm = f"""
1017+
qasm = """
10191018
OPENQASM 2.0;
10201019
include "qelib1.inc";
10211020
qreg q[2];
1021+
"""
1022+
if qasm_gate in ("cu1", "crz"):
1023+
qasm += f"""
10221024
{qasm_gate}(0.1) q[0];
10231025
"""
10241026
elif qasm_gate == "cu3":
1025-
qasm = f"""
1026-
OPENQASM 2.0;
1027-
include "qelib1.inc";
1028-
qreg q[2];
1027+
qasm += f"""
10291028
{qasm_gate}(0.1, 0.2, 0.3) q[0];
10301029
"""
10311030
else:
1032-
qasm = f"""
1033-
OPENQASM 2.0;
1034-
include "qelib1.inc";
1035-
qreg q[2];
1031+
qasm += f"""
10361032
{qasm_gate} q[0];
10371033
"""
10381034

0 commit comments

Comments
 (0)