-
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.
Browse files
Browse the repository at this point in the history
* Invalidate `parameters` cache on circuit copy (#12619) Previously, the caching of the parameter view could persist between copies of the circuit because it was part of the `copy.copy`. (cherry picked from commit b6c6166) # Conflicts: # qiskit/circuit/quantumcircuit.py # test/python/circuit/test_parameters.py * Fix conflict * Fix conflict in test * Update test/python/circuit/test_parameters.py --------- Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Elena Peña Tapia <[email protected]>
- Loading branch information
1 parent
2b2be03
commit 35a4c12
Showing
3 changed files
with
32 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
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,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
The :attr:`.QuantumCircuit.parameters` attribute will now correctly be empty | ||
when using :meth:`.QuantumCircuit.copy_empty_like` on a parametric circuit. | ||
Previously, an internal cache would be copied over without invalidation. | ||
Fix `#12617 <https://github.com/Qiskit/qiskit/issues/12617>`__. |
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