Skip to content

Fix build filter coupling map with mix ideal/physical targets #11009

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

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

mtreinish
Copy link
Member

Summary

This commit fixes a small issue in the Target.build_coupling_map method with filter_idle_qubits=True. Previously the internal method used to filter the idle qubits from the coupling map's creation was not accounting for the case that an instruction in the target could be ideal. This was never caught because normally if you have an ideal fixed width instruction in the target that is modelling a simulator which doesn't have any connectivity constraints and the function would never be called. But in targets that have a mix of both ideal globally defined and physical gates the filter code couldn't handle the None used to represent an ideal globally available gate. This commit fixes that handling to just ignore the global gate like the normal coupling map construction does.

Details and comments

This commit fixes a small issue in the Target.build_coupling_map method
with filter_idle_qubits=True. Previously the internal method used to
filter the idle qubits from the coupling map's creation was not
accounting for the case that an instruction in the target could be
ideal. This was never caught because normally if you have an ideal fixed
width instruction in the target that is modelling a simulator which
doesn't have any connectivity constraints and the function would never
be called. But in targets that have a mix of both ideal globally
defined and physical gates the filter code couldn't handle the None used
to represent an ideal globally available gate. This commit fixes that
handling to just ignore the global gate like the normal coupling map
construction does.
@mtreinish mtreinish added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Oct 12, 2023
@mtreinish mtreinish added this to the 0.25.3 milestone Oct 12, 2023
@mtreinish mtreinish requested a review from a team as a code owner October 12, 2023 19:33
taalexander
taalexander previously approved these changes Oct 12, 2023
Copy link
Contributor

@taalexander taalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Oct 12, 2023
@jakelishman jakelishman added this pull request to the merge queue Oct 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 19, 2023
@jakelishman jakelishman added this pull request to the merge queue Oct 19, 2023
Merged via the queue into Qiskit:main with commit 4dfcba2 Oct 19, 2023
mergify bot pushed a commit that referenced this pull request Oct 19, 2023
* Fix build filter coupling map with mix ideal/physical targets

This commit fixes a small issue in the Target.build_coupling_map method
with filter_idle_qubits=True. Previously the internal method used to
filter the idle qubits from the coupling map's creation was not
accounting for the case that an instruction in the target could be
ideal. This was never caught because normally if you have an ideal fixed
width instruction in the target that is modelling a simulator which
doesn't have any connectivity constraints and the function would never
be called. But in targets that have a mix of both ideal globally
defined and physical gates the filter code couldn't handle the None used
to represent an ideal globally available gate. This commit fixes that
handling to just ignore the global gate like the normal coupling map
construction does.

* Fix lint

(cherry picked from commit 4dfcba2)
@mtreinish mtreinish deleted the fix-none branch October 19, 2023 20:01
github-merge-queue bot pushed a commit that referenced this pull request Oct 24, 2023
#11049)

* Fix build filter coupling map with mix ideal/physical targets

This commit fixes a small issue in the Target.build_coupling_map method
with filter_idle_qubits=True. Previously the internal method used to
filter the idle qubits from the coupling map's creation was not
accounting for the case that an instruction in the target could be
ideal. This was never caught because normally if you have an ideal fixed
width instruction in the target that is modelling a simulator which
doesn't have any connectivity constraints and the function would never
be called. But in targets that have a mix of both ideal globally
defined and physical gates the filter code couldn't handle the None used
to represent an ideal globally available gate. This commit fixes that
handling to just ignore the global gate like the normal coupling map
construction does.

* Fix lint

(cherry picked from commit 4dfcba2)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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.

3 participants