Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TranspileErrors to routing passes for coupling_map=None #7141

Merged
merged 5 commits into from
Feb 20, 2023

Conversation

mcbennet
Copy link
Contributor

@mcbennet mcbennet commented Oct 15, 2021

Summary

This pull request closes issue #7127 .

Details and comments

This PR adds TranspileErrors when routing passes attempt to run with coupling_map=None.

Example of such an error can be produced with the following snippet:

from qiskit.circuit.random import random_circuit
from qiskit.transpiler.passes import SabreSwap

sab = SabreSwap(coupling_map=None)
qc = random_circuit(4, 4)
sab(qc)

Catches added for StochasticSwap, SabreSwap, LookaheadSwap, and BasicSwap .

@mcbennet mcbennet requested a review from a team as a code owner October 15, 2021 03:34
@mcbennet mcbennet changed the title Adding TranspileErrors to routing passes when coupling_map=None Add TranspileErrors to routing passes for coupling_map=None Oct 15, 2021
@ecpeterson
Copy link
Contributor

Hello! This PR looks reasonable enough. Would you add a changelog item using reno?

@mcbennet
Copy link
Contributor Author

Thanks @ecpeterson , changelog added.

@coveralls
Copy link

coveralls commented Nov 3, 2021

Pull Request Test Coverage Report for Build 4224614097

  • 4 of 8 (50.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 85.251%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/passes/routing/basic_swap.py 1 2 50.0%
qiskit/transpiler/passes/routing/lookahead_swap.py 1 2 50.0%
qiskit/transpiler/passes/routing/sabre_swap.py 1 2 50.0%
qiskit/transpiler/passes/routing/stochastic_swap.py 1 2 50.0%
Totals Coverage Status
Change from base Build 4206554412: -0.03%
Covered Lines: 67109
Relevant Lines: 78719

💛 - Coveralls

@HuangJunye HuangJunye added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jun 21, 2022
@javabster javabster requested a review from mtreinish February 20, 2023 14:20
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, it seems straightforward enough. Thanks for doing this and sorry that it fell through he cracks and took so long to review.

@mtreinish mtreinish added Changelog: Bugfix Include in the "Fixed" section of the changelog automerge labels Feb 20, 2023
@mergify mergify bot merged commit d1bd232 into Qiskit:main Feb 20, 2023
Eric-Arellano pushed a commit to Eric-Arellano/qiskit-terra that referenced this pull request Feb 23, 2023
)

* Adding TranspileErrors to routing passes that run with coupling_map=None

* Add changelog

---------

Co-authored-by: Matthew Treinish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants