Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 18, 2025

Summary

The following commits add the internal method _new_with_prefix, which allows for the one-time replacement of the set prefix name and use of the same instance counter.

Details and comments

Prior implementations would replace the Register's prefix attribute in place which is an unsafe operation. The following commits add a secure path for a provisional replacement of a register's prefix name to fix changed unsafe behavior from #13860 and attempts to fix #14003.


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

* FIx: Create an internal path for custom prefixes in registers.

Prior implementations would replace the Register's prefix attribute inplace which is an unsafe operation. The following commits add a secure path for a provisional replacement of a register's prefix name to fix changed unsafe behavior from #13860.

* Fix: Address review comments
- Add test-case

* Apply suggestions from code review

Co-authored-by: Kevin Hartman <kevin@hart.mn>

* Fix: Address more review comments

* Fix: Lint error

* Update test/python/circuit/test_circuit_operations.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

---------

Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
(cherry picked from commit 56a16ab)
@mergify mergify bot requested a review from a team as a code owner March 18, 2025 16:14
@qiskit-bot
Copy link
Collaborator

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:

  • @Qiskit/terra-core

@github-actions github-actions bot added bug Something isn't working Changelog: None Do not include in changelog labels Mar 18, 2025
@github-actions github-actions bot added this to the 2.0.0 milestone Mar 18, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13928130040

Details

  • 16 of 17 (94.12%) changed or added relevant lines in 3 files are covered.
  • 29 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 88.068%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/quantumcircuit.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.98%
crates/qasm2/src/parse.rs 24 96.22%
Totals Coverage Status
Change from base Build 13904878030: -0.02%
Covered Lines: 72692
Relevant Lines: 82541

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Mar 18, 2025
Merged via the queue into stable/2.0 with commit 78f2391 Mar 18, 2025
23 checks passed
@mtreinish mtreinish deleted the mergify/bp/stable/2.0/pr-14005 branch April 29, 2025 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants