-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41f78c1
commit b9b22e9
Showing
1 changed file
with
6 additions
and
0 deletions.
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
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)`. |