Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalidate parameters cache on circuit copy #12619

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

jakelishman
Copy link
Member

Summary

Previously, the caching of the parameter view could persist between copies of the circuit because it was part of the copy.copy.

Details and comments

Fix #12617.

I verified that this is present in 1.1.0 as well.

Previously, the caching of the parameter view could persist between
copies of the circuit because it was part of the `copy.copy`.
@jakelishman jakelishman added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Jun 20, 2024
@jakelishman jakelishman requested a review from a team as a code owner June 20, 2024 15:45
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@jakelishman jakelishman added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jun 20, 2024
@jakelishman jakelishman added this to the 1.1.2 milestone Jun 20, 2024
@Cryoris Cryoris enabled auto-merge June 20, 2024 16:05
@jakelishman
Copy link
Member Author

@Mergifyio backport stable/0.46 stable/1.1

Copy link
Contributor

mergify bot commented Jun 20, 2024

backport stable/0.46 stable/1.1

✅ Backports have been created

@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9600462226

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 89.74%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 6 92.37%
Totals Coverage Status
Change from base Build 9598580526: 0.003%
Covered Lines: 63573
Relevant Lines: 70841

💛 - Coveralls

@Cryoris Cryoris added this pull request to the merge queue Jun 20, 2024
Merged via the queue into Qiskit:main with commit b6c6166 Jun 20, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Jun 20, 2024
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
mergify bot pushed a commit that referenced this pull request Jun 20, 2024
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
@jakelishman jakelishman deleted the fix-parameter-cache branch June 20, 2024 18:16
github-merge-queue bot pushed a commit that referenced this pull request Jun 21, 2024
* 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

* Fix conflict

---------

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Jun 21, 2024
* 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 <jake.lishman@ibm.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
Previously, the caching of the parameter view could persist between
copies of the circuit because it was part of the `copy.copy`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameter cache is preserved after copy_empty_like
4 participants