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

Fix v2 pulse drawer #12608

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Fix v2 pulse drawer #12608

merged 3 commits into from
Jun 20, 2024

Conversation

nkanazawa1989
Copy link
Contributor

Summary

v2 pulse drawer crashes when the draw function is called with a V2 backend that doesn't have configuration and defaults attributes. Since qiskit-ibm-runtime 0.24 was released and fake V1 backends were deprecated, we should to support visualization with fake V2 backends that doen't have configuration and defaults attributes.

Details and comments

@nkanazawa1989 nkanazawa1989 added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jun 20, 2024
@nkanazawa1989 nkanazawa1989 requested review from nonhermitian and a team as code owners June 20, 2024 06:32
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @nkanazawa1989

@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9592725734

Details

  • 1 of 36 (2.78%) changed or added relevant lines in 1 file are covered.
  • 17 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.04%) to 89.715%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/pulse_v2/device_info.py 1 36 2.78%
Files with Coverage Reduction New Missed Lines %
qiskit/visualization/pulse_v2/device_info.py 1 39.71%
crates/qasm2/src/lex.rs 4 91.86%
crates/qasm2/src/parse.rs 12 96.23%
Totals Coverage Status
Change from base Build 9585515412: -0.04%
Covered Lines: 63554
Relevant Lines: 70840

💛 - Coveralls

Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @nkanazawa1989, if you'd like we can try to include it in the 1.1.1 release today, I want to do it in a few hours, so all we need is for lint to pass (added a suggestion below). Else, we can always just add it to 1.2.

qubit_channel_map[qind].extend(configuration.control(qubits=(qind, tind)))
except BackendConfigurationError:
pass
elif isinstance(backend, BackendV2):
Copy link
Contributor

@ElePT ElePT Jun 20, 2024

Choose a reason for hiding this comment

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

Lint is complaining about this being an elif instead of an else. I think it is reasonable to assume that the default is BackendV2 and not do the instance check

Copy link
Member

Choose a reason for hiding this comment

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

The other thing we sometimes do is to be more defensive and do the check, in order to raise an explicit RuntimeError("backend object not yet supported") for a clearer message - we don't have a BackendV3, but it's not inconceivable that we will expand in the future and have this same bug again.

@ElePT ElePT added this to the 1.1.1 milestone Jun 20, 2024
@ElePT ElePT added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jun 20, 2024
ElePT
ElePT previously approved these changes Jun 20, 2024
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

LGTM, I pushed Jake's suggestion to be able to include the PR in 1.1.1.

@ElePT ElePT enabled auto-merge June 20, 2024 11:10
@ElePT
Copy link
Contributor

ElePT commented Jun 20, 2024

https://github.com/Mergifyio backport stable/0.46 stable/1.1

Copy link
Contributor

mergify bot commented Jun 20, 2024

backport stable/0.46 stable/1.1

✅ Backports have been created

@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9596352057

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

  • 1 of 36 (2.78%) changed or added relevant lines in 1 file are covered.
  • 11 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.01%) to 89.742%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/pulse_v2/device_info.py 1 36 2.78%
Files with Coverage Reduction New Missed Lines %
qiskit/visualization/pulse_v2/device_info.py 1 39.71%
crates/qasm2/src/lex.rs 4 92.62%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 9585515412: -0.01%
Covered Lines: 63573
Relevant Lines: 70840

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9596940272

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

  • 1 of 36 (2.78%) changed or added relevant lines in 1 file are covered.
  • 13 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.03%) to 89.722%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/pulse_v2/device_info.py 1 36 2.78%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
qiskit/visualization/pulse_v2/device_info.py 1 39.71%
crates/qasm2/src/lex.rs 5 92.37%
crates/qasm2/src/parse.rs 6 96.69%
Totals Coverage Status
Change from base Build 9585515412: -0.03%
Covered Lines: 63559
Relevant Lines: 70840

💛 - Coveralls

@ElePT ElePT added this pull request to the merge queue Jun 20, 2024
Merged via the queue into Qiskit:main with commit 7d1731b Jun 20, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Jun 20, 2024
* fix error when V2 model is set

* Apply suggestions from code review

* Fix black

---------

Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
(cherry picked from commit 7d1731b)
mergify bot pushed a commit that referenced this pull request Jun 20, 2024
* fix error when V2 model is set

* Apply suggestions from code review

* Fix black

---------

Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
(cherry picked from commit 7d1731b)
github-merge-queue bot pushed a commit that referenced this pull request Jun 20, 2024
* fix error when V2 model is set

* Apply suggestions from code review

* Fix black

---------

Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
(cherry picked from commit 7d1731b)

Co-authored-by: Naoki Kanazawa <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Jun 20, 2024
* fix error when V2 model is set

* Apply suggestions from code review

* Fix black

---------

Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
(cherry picked from commit 7d1731b)

Co-authored-by: Naoki Kanazawa <[email protected]>
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
* fix error when V2 model is set

* Apply suggestions from code review

* Fix black

---------

Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[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 stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants