File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
cirq-core/cirq/contrib/qasm_import Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -1014,25 +1014,21 @@ def test_two_qubit_param_gates(
1014
1014
"qasm_gate" , [g [0 ] for g in two_qubit_gates ] + [g [0 ] for g in two_qubit_param_gates .keys ()]
1015
1015
)
1016
1016
def test_two_qubit_gates_not_enough_qubits (qasm_gate : str ):
1017
- if qasm_gate in ("cu1" , "crz" ):
1018
- qasm = f"""
1017
+ qasm = """
1019
1018
OPENQASM 2.0;
1020
1019
include "qelib1.inc";
1021
1020
qreg q[2];
1021
+ """
1022
+ if qasm_gate in ("cu1" , "crz" ):
1023
+ qasm += f"""
1022
1024
{ qasm_gate } (0.1) q[0];
1023
1025
"""
1024
1026
elif qasm_gate == "cu3" :
1025
- qasm = f"""
1026
- OPENQASM 2.0;
1027
- include "qelib1.inc";
1028
- qreg q[2];
1027
+ qasm += f"""
1029
1028
{ qasm_gate } (0.1, 0.2, 0.3) q[0];
1030
1029
"""
1031
1030
else :
1032
- qasm = f"""
1033
- OPENQASM 2.0;
1034
- include "qelib1.inc";
1035
- qreg q[2];
1031
+ qasm += f"""
1036
1032
{ qasm_gate } q[0];
1037
1033
"""
1038
1034
You can’t perform that action at this time.
0 commit comments