Skip to content

Commit

Permalink
Add release note
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorrivero committed Jun 10, 2022
1 parent 41f78c1 commit b9b22e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions releasenotes/notes/clear-circuit-b8edd4126f47d75a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Adds :py:meth:`clear` and :py:meth:`copy_empty_like` functionality to QuantumCircuit.
* Clear functionality to erase all instructions from a QuantumCircuit. We clear both the data and the parameter table.
* Copy empty functionality to get a cleared copy of a QuantumCircuit. This is logically equivalent to `qc.copy().clear()` however, it is done avoiding a deepcopy of the original QuantumCircuit, and therefore it is more efficient. This functionality is already implemented for DAGCircuit, and retains all relevant circuit properties other than the instructions and associated parameters (e.g. registers, bits, name, metadata). Contrary to the implementation in DAGCircuit, this method allows for an optional parameter to update the name of the copied circuit, mimicking `qc.copy(name)`.

0 comments on commit b9b22e9

Please sign in to comment.