Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
4.83k stars 2.29k forks source link

Invalidate `parameters` cache on circuit copy (backport #12619) #12621

Closed mergify[bot] closed 1 week ago

mergify[bot] commented 1 week ago

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.


This is an automatic backport of pull request #12619 done by Mergify.

mergify[bot] commented 1 week ago

Cherry-pick of b6c61661272c2e242963c416e64a9a2e050ea25d has failed:

On branch mergify/bp/stable/1.1/pr-12619
Your branch is up to date with 'origin/stable/1.1'.

You are currently cherry-picking commit b6c616612.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
    new file:   releasenotes/notes/fix-parameter-cache-05eac2f24477ccb8.yaml
    modified:   test/python/circuit/test_parameters.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
    both modified:   qiskit/circuit/quantumcircuit.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

qiskit-bot commented 1 week ago

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9610728597

Details


Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 2 88.2%
crates/qasm2/src/lex.rs 4 91.86%
crates/qasm2/src/parse.rs 12 96.69%
<!-- Total: 18 -->
Totals Coverage Status
Change from base Build 9600627572: -0.02%
Covered Lines: 61815
Relevant Lines: 68750

💛 - Coveralls