Skip to content

Conversation

jakelishman
Copy link
Member

Summary

In Qiskit 2.2 we inadvertently exposed the default registry only from the location qiskit.transpiler.passes.utils.wrap_angles.WRAP_ANGLES_REGISTRY, which traverses two private modules. We had to document that location in Qiskit 2.2 since it was already released when we spotted it, but had we caught it before, we'd have changed the import path to something easier and already public.

This PR attaches the default registry to the class; the WrapAngles pass is called out as "special" from the Target as handling these angle wrappings, so it seems appropriate for its default registry to be attached there as well.

Details and comments

Unstable follow-up to #15100.

We forgot to do this in Qiskit 2.2.0, while including examples saying
that it was something you were allowed to do.  This meant that we were
breaking our own public-API policy: suggesting that people use an object
that was not correctly documented at any path.

This corrects the documentation oversight in a stable manner, but
unfortunately we cannot give it a more sensible import path within the
2.2 series, and we've inadvertently made this very wordy import path
subject to the deprecation policy.  Regardless, it would be better to
follow up by giving it a better location.
@jakelishman jakelishman added this to the 2.3.0 milestone Oct 1, 2025
@jakelishman jakelishman requested a review from a team as a code owner October 1, 2025 15:12
@jakelishman jakelishman added on hold Can not fix yet documentation Something is not clear or an error documentation Changelog: API Change Include in the "Changed" section of the changelog mod: transpiler Issues and PRs related to Transpiler labels Oct 1, 2025
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

In Qiskit 2.2 we inadvertently exposed the default registry only from
the location
`qiskit.transpiler.passes.utils.wrap_angles.WRAP_ANGLES_REGISTRY`, which
traverses two private modules.  We had to document that location in
Qiskit 2.2 since it was already released when we spotted it, but had we
caught it before, we'd have changed the import path to something easier
and already public.

This PR attaches the default registry to the class; the `WrapAngles`
pass is called out as "special" from the `Target` as handling these
angle wrappings, so it seems appropriate for its default registry to be
attached there as well.
@jakelishman jakelishman force-pushed the relocate-wrap-angles-registry branch from 3c4b429 to cd58d67 Compare October 1, 2025 15:35
@jakelishman jakelishman requested a review from kt474 as a code owner October 1, 2025 15:35
kt474
kt474 previously approved these changes Oct 1, 2025
Originally I thought I needed the extra `.. autoattribute` because I
hadn't cleaned my docs build when I tried it.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18168330353

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 16 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.005%) to 88.298%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 92.29%
crates/qasm2/src/parse.rs 12 97.09%
Totals Coverage Status
Change from base Build 18109283345: -0.005%
Covered Lines: 92877
Relevant Lines: 105186

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog documentation Something is not clear or an error documentation mod: transpiler Issues and PRs related to Transpiler on hold Can not fix yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants