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

Do not retain and expose old elements of ParameterVector #12561

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

garrison
Copy link
Member

@garrison garrison commented Jun 13, 2024

Summary

This fixes #12541 according to #12545 (review).

Details and comments

Note that qpy does not appear to store the _root_uuid, so if one deserializes a ParameterVector and then removes elements and later adds new ones, the uuids of the regenerated elements will change.

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 9491859150

Details

  • 4 of 5 (80.0%) changed or added relevant lines in 1 file are covered.
  • 11 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.008%) to 89.596%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/parametervector.py 4 5 80.0%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.62%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 9483656494: -0.008%
Covered Lines: 62521
Relevant Lines: 69781

💛 - Coveralls

@garrison garrison marked this pull request as ready for review June 13, 2024 02:47
@garrison garrison requested a review from a team as a code owner June 13, 2024 02:47
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core
  • @mtreinish
  • @nkanazawa1989

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@jakelishman jakelishman added Changelog: None Do not include in changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Jun 13, 2024
@jakelishman jakelishman added this to the 1.1.1 milestone Jun 13, 2024
@jakelishman jakelishman added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jun 13, 2024
@jakelishman jakelishman added this pull request to the merge queue Jun 13, 2024
Merged via the queue into Qiskit:main with commit 8a1bcc2 Jun 13, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Jun 13, 2024
* Do not retain and expose old elements of `ParameterVector`

This fixes #12541 according to
#12545 (review).

* Fix test

(cherry picked from commit 8a1bcc2)
github-merge-queue bot pushed a commit that referenced this pull request Jun 13, 2024
…12565)

* Do not retain and expose old elements of `ParameterVector`

This fixes #12541 according to
#12545 (review).

* Fix test

(cherry picked from commit 8a1bcc2)

Co-authored-by: Jim Garrison <garrison@ibm.com>
@garrison garrison deleted the strange-parametervector2 branch June 14, 2024 01:49
@ElePT ElePT modified the milestones: 1.1.1, 1.2.0 Jun 20, 2024
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
)

* Do not retain and expose old elements of `ParameterVector`

This fixes Qiskit#12541 according to
Qiskit#12545 (review).

* Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in 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.

Strange things about ParameterVector
5 participants