-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raise an exception with a custom gate with clbits or no qubits (#10438)
* raise an exception with a custom gate with no qubits or with one-or-more clbits * QASM2ExportError * test_circuit_raises_invalid_custom_gate_1 * test_circuit_raises_invalid_custom_gate_2 * reno * Split error messages to be more specific * Fix testing bug * Fixup release note --------- Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
- Loading branch information
1 parent
cab90ca
commit 208c29a
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/qasm_invalid_custom_instruction-7738db7ba1a1a5cf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
Qiskit can represent custom instructions that act on zero qubits, or on a non-zero number of | ||
classical bits. These cannot be exported to OpenQASM 2, but previously :meth:`.QuantumCircuit.qasm` | ||
would try, and output invalid OpenQASM 2. Instead, a :exc:`.QASM2ExportError` will now correctly | ||
be raised. See `#7351 <https://github.com/Qiskit/qiskit-terra/issues/7351>`__ and | ||
`#10435 <https://github.com/Qiskit/qiskit-terra/issues/10435>`__. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters