Use rust-native error for Sabre #16307
Open
raynelfss wants to merge 3 commits into
Open
Conversation
The following commits modify `DisjointLayout` to use rust-native errors throughout its pipeline, specifically on its `distribute_components` method. We implement the `DisjointLayoutError` enumeration which derives from `DAGError`; and implements two variants: `MultiQEncountered` for when the interaction graph finds a multiqubit operation; `MismatchedComponentSize` for when the circuit and the coupling map have components of differing sizes.
The following commits modify `Sabre` passes to use rust-native errors throughout their pipelines. - `SabreDAG`: for this type we will use `DAGError` as the main error type since it only does `DAGCircuit` manipulation. - `RoutingResult`: All methods do dag manipulation and thus can use `DAGError` freely. - `SabreRoutingAndLayout` pass: Implements the `SabreLayoutError` enumeration which derives from `DAGError`, `TargetCouplingError`, and `DisjointLayoutError`; and implements three variants: -`TargetNoNumQubit` for when the `Target` doesn't define `num_qubits`; - `LayoutQubitsOutOfRange` when partial layouts contain out-of-range physical qubits. - `LayoutVirtualToPhys` when a layout assign a virtual qubit to a physical qubit that the disjoint QPU is unable to map back to. These additions rely on Qiskit#16305.
Collaborator
|
One or more of the following people are relevant to this code:
|
Coverage Report for CI Build 26586767794Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.02%) to 87.677%Details
Uncovered Changes
Coverage Regressions17 previously-covered lines in 3 files lost coverage.
Coverage Stats
💛 - Coveralls |
12 tasks
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.
The following commits modify
Sabrepasses to use rust-native errors throughout their pipelines.SabreDAG: for this type we will useDAGErroras the main error type since it only doesDAGCircuitmanipulation.RoutingResult: All methods do dag manipulation and thus can useDAGErrorfreely.SabreRoutingAndLayoutpass: Implements theSabreLayoutErrorenumeration which derives fromDAGError,TargetCouplingError, andDisjointLayoutError; and implements three variants:TargetNoNumQubitfor when theTargetdoesn't definenum_qubits;LayoutQubitsOutOfRangewhen partial layouts contain out-of-range physical qubits.LayoutVirtualToPhyswhen a layout assign a virtual qubit to a physical qubit that the disjoint QPU is unable to map back to.These additions rely on #16305.
AI/LLM disclosure