forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new
get_control_flow_name_mapping
function (Qiskit#13472)
* Add new get_control_flow_name_mapping function, replace use in generate_preset_pass_manager and add reno. * Document function * Reword documentation * Use get_control_flow_name_mapping in convert_to_target
- Loading branch information
Showing
5 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
releasenotes/notes/add-ctrl-flow-name-mapping-21842a23726e6e77.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
features_circuits: | ||
- | | ||
Added a new :func:`.get_control_flow_name_mapping` convenience function that returns a | ||
mapping of Qiskit's control-flow operation names to their corresponding class. | ||
Example usage: | ||
.. code-block:: python | ||
from qiskit.circuit import get_control_flow_name_mapping | ||
ctrl_flow_name_map = get_control_flow_name_mapping() | ||
if_else_object = ctrl_flow_name_map["if_else"] | ||
print(if_else_object) | ||
.. code-block:: text | ||
<class 'qiskit.circuit.controlflow.if_else.IfElseOp'> |