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

Fixed handling of a list of coupling_maps passed to transpile() #9886

Merged
merged 5 commits into from
Apr 4, 2023

Conversation

wshanks
Copy link
Contributor

@wshanks wshanks commented Mar 30, 2023

Closes #9885

@wshanks wshanks requested a review from a team as a code owner March 30, 2023 21:42
@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 the following people are requested to review this:

  • @Qiskit/terra-core

@wshanks
Copy link
Contributor Author

wshanks commented Mar 30, 2023

I can't think of why you would really want to pass a list of different coupling maps to transpile and I see that doing so is already marked for deprecation. I think the main benefit of this PR is sparing someone else like me from staring at these lines trying to figure how they could work 🙂

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.

Lol, yeah that could never work, that definitely slipped through on review in #7789. I guess it kind of confirms the argument broadcasting in transpile() is not widely used. Since this is technically a bugfix it'd be good to have a test case to cover this (it's definitely not worth a release note). Do you mind adding a quick test that is using this deprecated functionality?

@coveralls
Copy link

coveralls commented Mar 30, 2023

Pull Request Test Coverage Report for Build 4574928928

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 37 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.01%) to 85.41%

Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/preset_passmanagers/level3.py 5 92.5%
qiskit/circuit/quantumcircuitdata.py 14 87.04%
qiskit/test/base.py 18 84.03%
Totals Coverage Status
Change from base Build 4569011817: 0.01%
Covered Lines: 67393
Relevant Lines: 78905

💛 - Coveralls

@wshanks
Copy link
Contributor Author

wshanks commented Mar 30, 2023

Yes, adding a test is a good idea, especially since my first pass at the PR was broken 🙂

@wshanks
Copy link
Contributor Author

wshanks commented Mar 31, 2023

I added a test but it failed because it triggers the deprecation warning. How should one test code that triggers a deprecation warning?

@jakelishman
Copy link
Member

jakelishman commented Mar 31, 2023

Wrap the call that warns in a with self.assertWarnsRegex block asserting suitable things about the warning - it serves double duty by testing that the warning fires correctly, while allowing the code within it.

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.

LGTM, thanks for adding the test

@mtreinish mtreinish added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Apr 4, 2023
@mtreinish mtreinish added this pull request to the merge queue Apr 4, 2023
Merged via the queue into Qiskit:main with commit 7e246a2 Apr 4, 2023
giacomoRanieri pushed a commit to giacomoRanieri/qiskit-terra that referenced this pull request Apr 16, 2023
…it#9886)

* Fixed handling of a list of coupling_maps passed to transpile()

Closes Qiskit#9885

* Update qiskit/compiler/transpiler.py

* Add test

* Release note

* Fix test
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
…it#9886)

* Fixed handling of a list of coupling_maps passed to transpile()

Closes Qiskit#9885

* Update qiskit/compiler/transpiler.py

* Add test

* Release note

* Fix test
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logical error in transpiler.py
5 participants