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

Bugfix for missing qubit property #11880

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

nkanazawa1989
Copy link
Contributor

Summary

With #11095 handling for the missing qubit property was gone. This PR readds the handling for partly missing qubit property with a unit test.

Details and comments

When some qubit doesn't report qubit properties (i.e. T1, T2, frequency), the convert_to_target function crashes during the conversion of BackendV1 into V2 model.

@nkanazawa1989 nkanazawa1989 added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog labels Feb 26, 2024
@nkanazawa1989 nkanazawa1989 marked this pull request as ready for review February 26, 2024 05:04
@nkanazawa1989 nkanazawa1989 requested review from jyu00 and a team as code owners February 26, 2024 05:04
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8043950737

Details

  • -2 of 7 (71.43%) changed or added relevant lines in 1 file are covered.
  • 37 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 89.249%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/providers/backend_compat.py 5 7 71.43%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 7 91.44%
crates/qasm2/src/parse.rs 30 95.77%
Totals Coverage Status
Change from base Build 8023329404: -0.05%
Covered Lines: 58877
Relevant Lines: 65969

💛 - Coveralls

@nkanazawa1989 nkanazawa1989 added this to the 1.0.2 milestone Feb 27, 2024
@nkanazawa1989 nkanazawa1989 removed the stable backport potential The bug might be minimal and/or import enough to be port to stable label Feb 27, 2024
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Feb 29, 2024
@mtreinish mtreinish self-assigned this Feb 29, 2024
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 fixing this.

Comment on lines +164 to +165
# TODO faulty qubit handling might be needed since
# faulty qubit reporting qubit properties doesn't make sense.
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, looking at the target code:

if qubit_properties is not None:
if not self.num_qubits:
self.num_qubits = len(qubit_properties)
else:
if self.num_qubits != len(qubit_properties):
raise ValueError(
"The value of num_qubits specified does not match the "
"length of the input qubit_properties list"
)
so not filtering faulty qubits is the expected behavior here. If the number of qubits in the properties dict differs from the number of qubits on the backend it'll error.

@mtreinish mtreinish added this pull request to the merge queue Feb 29, 2024
Merged via the queue into Qiskit:main with commit c566b3f Mar 1, 2024
12 checks passed
mergify bot pushed a commit that referenced this pull request Mar 1, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 1, 2024
(cherry picked from commit c566b3f)

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
IsmaelCesar pushed a commit to comp-quantica/qiskit-terra that referenced this pull request Mar 13, 2024
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.

None yet

4 participants