Skip to content

Conversation

@ToroData
Copy link
Contributor

@ToroData ToroData commented Sep 5, 2025

Summary

Fix documentation example for the transpiler stage plugin in Qiskit SDK v2.1.2.

  • I have added the tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Details and comments

Fixes #14985.

Docs-only change: updates the example under qiskit.transpiler.preset_passmanagers.plugin to replace PassManager.append(..., condition=...) with ConditionalController, remove backend_properties, pass target, add the missing comma in max_trials, and guard property_set lookups with .get(...).

…t#14985)

Fixes Qiskit#14985 issue.

Updates the example under `qiskit.transpiler.preset_passmanagers.plugin`
so it runs on Qiskit SDK v2.1.2.

- Replace `PassManager.append(..., condition=...)` with `ConditionalController`.
- Remove usage of `backend_properties` from `PassManagerConfig`.
- Pass `target=pass_manager_config.target` to `VF2Layout`.
- Add the missing comma in `max_trials=...`.
- Guard property_set lookups with `.get(...)` and check against
  `VF2LayoutStopReason.SOLUTION_FOUND`.

Tested with `generate_preset_pass_manager(..., layout_method="vf2lite")`
at `optimization_level=1..3` on SDK v2.1.2.
@ToroData ToroData requested a review from a team as a code owner September 5, 2025 11:19
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Sep 5, 2025
@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

@CLAassistant
Copy link

CLAassistant commented Sep 5, 2025

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Sep 9, 2025

Pull Request Test Coverage Report for Build 18169540117

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

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2061 unchanged lines in 54 files lost coverage.
  • Overall coverage decreased (-0.1%) to 88.246%

Files with Coverage Reduction New Missed Lines %
crates/cext/src/transpiler/passes/split_2q_unitaries.rs 1 90.63%
crates/cext/src/transpiler/passes/vf2.rs 1 82.61%
crates/accelerate/src/twirling.rs 2 94.47%
crates/cext/src/transpiler/passes/remove_identity_equiv.rs 2 78.26%
crates/synthesis/src/clifford/bm_synthesis.rs 2 99.14%
crates/transpiler/src/commutation_checker.rs 2 88.42%
crates/transpiler/src/passes/consolidate_blocks.rs 2 91.08%
qiskit/result/sampled_expval.py 2 93.94%
qiskit/transpiler/passes/layout/sabre_pre_layout.py 2 96.55%
crates/cext/src/transpiler/passes/unitary_synthesis.rs 3 96.67%
Totals Coverage Status
Change from base Build 17583494075: -0.1%
Covered Lines: 93129
Relevant Lines: 105533

💛 - Coveralls

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.

Sorry for the slow review - thanks for the fix!

@jakelishman jakelishman added documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Oct 1, 2025
@jakelishman jakelishman enabled auto-merge October 1, 2025 16:56
@jakelishman jakelishman added this pull request to the merge queue Oct 1, 2025
Merged via the queue into Qiskit:main with commit cbe1f20 Oct 1, 2025
23 checks passed
mergify bot pushed a commit that referenced this pull request Oct 1, 2025
… (#14991)

* docs(transpiler-plugins): fix layout plugin example for v2.1.2 (#14985)

Fixes #14985 issue.

Updates the example under `qiskit.transpiler.preset_passmanagers.plugin`
so it runs on Qiskit SDK v2.1.2.

- Replace `PassManager.append(..., condition=...)` with `ConditionalController`.
- Remove usage of `backend_properties` from `PassManagerConfig`.
- Pass `target=pass_manager_config.target` to `VF2Layout`.
- Add the missing comma in `max_trials=...`.
- Guard property_set lookups with `.get(...)` and check against
  `VF2LayoutStopReason.SOLUTION_FOUND`.

Tested with `generate_preset_pass_manager(..., layout_method="vf2lite")`
at `optimization_level=1..3` on SDK v2.1.2.

* Fix lint error in plugin.py docstring (line too long)

* Fix spacing

---------

Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit cbe1f20)
github-merge-queue bot pushed a commit that referenced this pull request Oct 1, 2025
… (#14991) (#15103)

* docs(transpiler-plugins): fix layout plugin example for v2.1.2 (#14985)

Fixes #14985 issue.

Updates the example under `qiskit.transpiler.preset_passmanagers.plugin`
so it runs on Qiskit SDK v2.1.2.

- Replace `PassManager.append(..., condition=...)` with `ConditionalController`.
- Remove usage of `backend_properties` from `PassManagerConfig`.
- Pass `target=pass_manager_config.target` to `VF2Layout`.
- Add the missing comma in `max_trials=...`.
- Guard property_set lookups with `.get(...)` and check against
  `VF2LayoutStopReason.SOLUTION_FOUND`.

Tested with `generate_preset_pass_manager(..., layout_method="vf2lite")`
at `optimization_level=1..3` on SDK v2.1.2.

* Fix lint error in plugin.py docstring (line too long)

* Fix spacing

---------


(cherry picked from commit cbe1f20)

Co-authored-by: Ricard Santiago Raigada García <[email protected]>
Co-authored-by: Jake Lishman <[email protected]>
aaryav-3 pushed a commit to aaryav-3/qiskit that referenced this pull request Oct 21, 2025
…t#14985) (Qiskit#14991)

* docs(transpiler-plugins): fix layout plugin example for v2.1.2 (Qiskit#14985)

Fixes Qiskit#14985 issue.

Updates the example under `qiskit.transpiler.preset_passmanagers.plugin`
so it runs on Qiskit SDK v2.1.2.

- Replace `PassManager.append(..., condition=...)` with `ConditionalController`.
- Remove usage of `backend_properties` from `PassManagerConfig`.
- Pass `target=pass_manager_config.target` to `VF2Layout`.
- Add the missing comma in `max_trials=...`.
- Guard property_set lookups with `.get(...)` and check against
  `VF2LayoutStopReason.SOLUTION_FOUND`.

Tested with `generate_preset_pass_manager(..., layout_method="vf2lite")`
at `optimization_level=1..3` on SDK v2.1.2.

* Fix lint error in plugin.py docstring (line too long)

* Fix spacing

---------

Co-authored-by: Jake Lishman <[email protected]>
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 Community PR PRs from contributors that are not 'members' of the Qiskit repo documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Transpiler stage plugin example breaks on v2.1.2 (VF2Layout)

5 participants