Skip to content

Commit

Permalink
Use get_control_flow_name_mapping in convert_to_target
Browse files Browse the repository at this point in the history
  • Loading branch information
ElePT committed Nov 22, 2024
1 parent aed5901 commit 5434583
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions qiskit/providers/backend_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from qiskit.providers.backend import QubitProperties
from qiskit.providers.models.backendconfiguration import BackendConfiguration
from qiskit.providers.models.backendproperties import BackendProperties
from qiskit.circuit.controlflow import CONTROL_FLOW_OP_NAMES
from qiskit.circuit.controlflow import CONTROL_FLOW_OP_NAMES, get_control_flow_name_mapping
from qiskit.providers.models.pulsedefaults import PulseDefaults
from qiskit.providers.options import Options
from qiskit.providers.exceptions import BackendPropertyError
Expand Down Expand Up @@ -79,7 +79,6 @@ def _convert_to_target(
Target,
InstructionProperties,
)
from qiskit.circuit.controlflow import ForLoopOp, IfElseOp, SwitchCaseOp, WhileLoopOp
from qiskit.circuit.library.standard_gates import get_standard_gate_name_mapping
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.gate import Gate
Expand All @@ -91,12 +90,7 @@ def _convert_to_target(
if custom_name_mapping:
qiskit_inst_mapping.update(custom_name_mapping)

qiskit_control_flow_mapping = {
"if_else": IfElseOp,
"while_loop": WhileLoopOp,
"for_loop": ForLoopOp,
"switch_case": SwitchCaseOp,
}
qiskit_control_flow_mapping = get_control_flow_name_mapping()

in_data = {"num_qubits": configuration.num_qubits}

Expand Down

0 comments on commit 5434583

Please sign in to comment.