Repository navigation
Fix Qiskit stage plugins and release 0.1.2 - #1
Merged
Merged
Conversation
The westquant layout/routing/optimization stage plugins crashed on Qiskit 2.x (QuantumCircuit.from_instructions(dag) on a DAGCircuit) and the candidate path relied on the private tqc._layout.dag. Failed candidates were swallowed. - Reimplement each stage as a deterministic best-of over Qiskit built-ins that sets layout/final_layout correctly and reuses Qiskit's embed and routing stage wrappers; record every candidate in property_set and raise when all candidates fail. - Add end-to-end tests: discovery, unitary equivalence, measurement distribution, coupling-map compliance, applied candidate, all-fail error. - Bring the BackendV2 Target support that shipped in the 0.1.1 wheel but was never committed into the source tree, with a test. - CI: visible nightly failures, single gated publish path, Qiskit 2.5.2 and 2.6.1 test matrix. Version 0.1.2 (0.1.0a5 and 0.1.1 are already on PyPI). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the P0 "Qiskit stage plugin" finding from the 2026-10-24 release review and prepares westquant-qiskit 0.1.2.
The plugin was broken, not only a no-op. On Qiskit 2.5.2 and 2.6.1,
generate_preset_pass_manager(layout_method="westquant")orrouting_method="westquant"raisedTypeError: 'DAGCircuit' object is not iterablefromQuantumCircuit.from_instructions(dag). The candidate path also read the privatetqc._layout.dagand swallowed every exception.stage.pyrewritten. Each stage is a deterministic best-of over Qiskit's own strategies, scored by two-qubit cost (SWAP = 3) and then depth:property_set["layout"], then Qiskit's standard embed passes.final_layout; wrapped incommon.generate_routing_passmanager, so it only runs when the circuit is not already mapped.property_set["westquant_selection"]and failures are logged. If every candidate fails, aTranspilerErroris raised.optimization_level=0is no longer replaced by 2.Targetsupport inadapter.noise_aware_metricsthat was never committed. It is now in git, with aGenericBackendV2test. Without this, the next release would have removed that feature.Test plan
tests/test_stage.py(13 tests): 10 fail against the oldstage.py, all pass nowtest_noise_aware_metrics_backend_v2_targetfails without the ported adapter, passes with ittwine check --strictpasses, both installed in clean venvs withpip check, suite passes against the installed packageGenerated with Devin