Skip to content

Fix handling of control flow instructions in convert_to_target()#11877

Merged
1ucian0 merged 1 commit intoQiskit:mainfrom
mtreinish:fix-convert-target-control-flow
Feb 26, 2024
Merged

Fix handling of control flow instructions in convert_to_target()#11877
1ucian0 merged 1 commit intoQiskit:mainfrom
mtreinish:fix-convert-target-control-flow

Conversation

@mtreinish
Copy link
Copy Markdown
Member

Summary

This commit fixes an issue in the convert_to_target() function where it wasn't looking for control flow instructions in the proper location. Typically the control flow instructions are put in the supported_instructions field of the BackendConfiguration, but the convert_to_target() function was ignoring this field. This commit updates the function to check supported_instructions for the control flow instructions. It doesn't more broadly look at the supported_instructions field, because on other backends this field is used to list the supported pulse instructions which might have name conflicts with other instructions and cause issues building a target.

Details and comments

Fixes #11872

This commit fixes an issue in the convert_to_target() function where it
wasn't looking for control flow instructions in the proper location.
Typically the control flow instructions are put in the
supported_instructions field of the BackendConfiguration, but the
convert_to_target() function was ignoring this field. This commit
updates the function to check supported_instructions for the control
flow instructions. It doesn't more broadly look at
the supported_instructions field, because on other backends this field
is used to list the supported pulse instructions which might have name
conflicts with other instructions and cause issues building a target.

Fixes Qiskit#11872
@mtreinish mtreinish added stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge. Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. labels Feb 23, 2024
@mtreinish mtreinish added this to the 1.0.2 milestone Feb 23, 2024
@mtreinish mtreinish requested review from a team and jyu00 as code owners February 23, 2024 21:26
@qiskit-bot
Copy link
Copy Markdown
Collaborator

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

  • @Qiskit/terra-core

@mtreinish
Copy link
Copy Markdown
Member Author

@Mergifyio backport stable/0.46

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Feb 23, 2024

backport stable/0.46

✅ Backports have been created

Details

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 8025271898

Details

  • 0 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 89.302%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.19%
Totals Coverage Status
Change from base Build 8023329404: 0.0%
Covered Lines: 58908
Relevant Lines: 65965

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

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

Thanks Matthew for the quick fix. This looks good to me.

Copy link
Copy Markdown
Member

@1ucian0 1ucian0 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 quick fix!

@1ucian0 1ucian0 added this pull request to the merge queue Feb 26, 2024
Merged via the queue into Qiskit:main with commit 65ab965 Feb 26, 2024
mergify Bot pushed a commit that referenced this pull request Feb 26, 2024
)

This commit fixes an issue in the convert_to_target() function where it
wasn't looking for control flow instructions in the proper location.
Typically the control flow instructions are put in the
supported_instructions field of the BackendConfiguration, but the
convert_to_target() function was ignoring this field. This commit
updates the function to check supported_instructions for the control
flow instructions. It doesn't more broadly look at
the supported_instructions field, because on other backends this field
is used to list the supported pulse instructions which might have name
conflicts with other instructions and cause issues building a target.

Fixes #11872

(cherry picked from commit 65ab965)

# Conflicts:
#	qiskit/providers/backend_compat.py
mergify Bot pushed a commit that referenced this pull request Feb 26, 2024
)

This commit fixes an issue in the convert_to_target() function where it
wasn't looking for control flow instructions in the proper location.
Typically the control flow instructions are put in the
supported_instructions field of the BackendConfiguration, but the
convert_to_target() function was ignoring this field. This commit
updates the function to check supported_instructions for the control
flow instructions. It doesn't more broadly look at
the supported_instructions field, because on other backends this field
is used to list the supported pulse instructions which might have name
conflicts with other instructions and cause issues building a target.

Fixes #11872

(cherry picked from commit 65ab965)
@mtreinish mtreinish deleted the fix-convert-target-control-flow branch February 26, 2024 16:18
github-merge-queue Bot pushed a commit that referenced this pull request Feb 29, 2024
) (#11884)

This commit fixes an issue in the convert_to_target() function where it
wasn't looking for control flow instructions in the proper location.
Typically the control flow instructions are put in the
supported_instructions field of the BackendConfiguration, but the
convert_to_target() function was ignoring this field. This commit
updates the function to check supported_instructions for the control
flow instructions. It doesn't more broadly look at
the supported_instructions field, because on other backends this field
is used to list the supported pulse instructions which might have name
conflicts with other instructions and cause issues building a target.

Fixes #11872

(cherry picked from commit 65ab965)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Feb 29, 2024
This commit fixes an issue in the convert_to_target() function where it
wasn't looking for control flow instructions in the proper location.
Typically the control flow instructions are put in the
supported_instructions field of the BackendConfiguration, but the
convert_to_target() function was ignoring this field. This commit
updates the function to check supported_instructions for the control
flow instructions. It doesn't more broadly look at the
supported_instructions field, because on other backends this field is
used to list the supported pulse instructions which might have name
conflicts with other instructions and cause issues building a target.

This is the spiritual backport of Qiskit#11877, but because the state of the
convert_to_target() function on stable/0.46 is very different very
little code is carried over from the version on main and stable/1.0,
basically only the tests. This is actually closer in implementation to
the equivalent PR on qiskit-ibm-runtime: Qiskit/qiskit-ibm-runtime#1443
as the internal conversion function in that repository is very similar
to the function on the stable/0.46 branch.
github-merge-queue Bot pushed a commit that referenced this pull request Feb 29, 2024
)

* Fix handling of control flow instructions in convert_to_target()

This commit fixes an issue in the convert_to_target() function where it
wasn't looking for control flow instructions in the proper location.
Typically the control flow instructions are put in the
supported_instructions field of the BackendConfiguration, but the
convert_to_target() function was ignoring this field. This commit
updates the function to check supported_instructions for the control
flow instructions. It doesn't more broadly look at the
supported_instructions field, because on other backends this field is
used to list the supported pulse instructions which might have name
conflicts with other instructions and cause issues building a target.

This is the spiritual backport of #11877, but because the state of the
convert_to_target() function on stable/0.46 is very different very
little code is carried over from the version on main and stable/1.0,
basically only the tests. This is actually closer in implementation to
the equivalent PR on qiskit-ibm-runtime: Qiskit/qiskit-ibm-runtime#1443
as the internal conversion function in that repository is very similar
to the function on the stable/0.46 branch.

* Add release note

* Fix tests

* Fix import cycle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qiskit.provider.back_compat.convert_to_target doesn't add control flow instructions to the target

5 participants