Skip to content

Promote CONTROL_FLOW_OP_NAMES to public API#13057

Merged
mtreinish merged 1 commit intoQiskit:mainfrom
jakelishman:control-flow-op-names
Aug 30, 2024
Merged

Promote CONTROL_FLOW_OP_NAMES to public API#13057
mtreinish merged 1 commit intoQiskit:mainfrom
jakelishman:control-flow-op-names

Conversation

@jakelishman
Copy link
Copy Markdown
Member

Summary

This is generally useful for Qiskit's built-in transpiler passes, and we've had some interest in using it for the same reasons from outside the library. While the control-flow structure from within Rust might change in the future, in the immediate term and from Python space, it feels fair to expose this as public API, since all the information contained in it is certainly already public.

Details and comments

Minor request from @ihincks.

This is generally useful for Qiskit's built-in transpiler passes, and
we've had some interest in using it for the same reasons from outside
the library.  While the control-flow structure from within Rust might
change in the future, in the immediate term and from Python space, it
feels fair to expose this as public API, since all the information
contained in it is certainly already public.
@jakelishman jakelishman added Changelog: Added Add an "Added" entry in the GitHub Release changelog. mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Aug 29, 2024
@jakelishman jakelishman added this to the 1.3.0 milestone Aug 29, 2024
@jakelishman jakelishman marked this pull request as ready for review August 29, 2024 22:33
@jakelishman jakelishman requested a review from a team as a code owner August 29, 2024 22:33
@qiskit-bot
Copy link
Copy Markdown
Collaborator

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

  • @Qiskit/terra-core

@mtreinish mtreinish enabled auto-merge August 29, 2024 22:47
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 10623602313

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 32 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.03%) to 89.171%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/accelerate/src/two_qubit_decompose.rs 1 90.82%
crates/qasm2/src/lex.rs 6 91.48%
crates/qasm2/src/parse.rs 24 95.77%
Totals Coverage Status
Change from base Build 10598013395: -0.03%
Covered Lines: 71623
Relevant Lines: 80321

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@ihincks ihincks left a comment

Choose a reason for hiding this comment

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

Thanks @jakelishman !

@mtreinish mtreinish added this pull request to the merge queue Aug 29, 2024
Merged via the queue into Qiskit:main with commit f37bd68 Aug 30, 2024
@jakelishman jakelishman deleted the control-flow-op-names branch August 30, 2024 09:13
@wshanks
Copy link
Copy Markdown
Contributor

wshanks commented Nov 20, 2024

Lazy follow up request -- it would be nice to have an equivalent to get_standard_gate_name_mapping as well to standardize code like this:

name_mapping = {
"if_else": IfElseOp,
"while_loop": WhileLoopOp,
"for_loop": ForLoopOp,
"switch_case": SwitchCaseOp,
}

It came up in Qiskit/qiskit-ibm-runtime#2044 (comment). I will keep it on my list but I can't do it at the moment.

@ElePT
Copy link
Copy Markdown
Contributor

ElePT commented Nov 21, 2024

@wshanks FYI: #13472. Targeted for 2.0.

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

Labels

Changelog: Added Add an "Added" entry in the GitHub Release changelog. mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants