Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

add switch_case to json decoder.py #637

Merged
merged 4 commits into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions qiskit_ibm_provider/utils/json_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
# that they have been altered from the originals.

"""Custom JSON decoder."""
from typing import Dict, Tuple, Union, List, Any, Optional
import json
import logging
from typing import Any, Dict, List, Optional, Tuple, Union

import dateutil.parser
from qiskit.circuit.controlflow import ForLoopOp, IfElseOp, SwitchCaseOp, WhileLoopOp
from qiskit.circuit.gate import Gate, Instruction
from qiskit.circuit.library.standard_gates import get_standard_gate_name_mapping
from qiskit.circuit.parameter import Parameter
from qiskit.providers.models import (
QasmBackendConfiguration,
PulseBackendConfiguration,
PulseDefaults,
BackendProperties,
Command,
PulseBackendConfiguration,
PulseDefaults,
QasmBackendConfiguration,
)
from qiskit.providers.models.backendproperties import Gate as GateSchema
from qiskit.circuit.controlflow import IfElseOp, WhileLoopOp, ForLoopOp
from qiskit.circuit.gate import Gate, Instruction
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.library.standard_gates import get_standard_gate_name_mapping
from qiskit.pulse.calibration_entries import PulseQobjDef
from qiskit.transpiler.target import Target, InstructionProperties
from qiskit.qobj.pulse_qobj import PulseLibraryItem
from qiskit.qobj.converters.pulse_instruction import QobjToInstructionConverter
from qiskit.qobj.pulse_qobj import PulseLibraryItem
from qiskit.transpiler.target import InstructionProperties, Target
from qiskit.utils import apply_prefix

from .converters import utc_to_local, utc_to_local_all
from ..ibm_qubit_properties import IBMQubitProperties
from .converters import utc_to_local, utc_to_local_all

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -111,6 +111,7 @@ def target_from_server_data(
"if_else": IfElseOp,
"while_loop": WhileLoopOp,
"for_loop": ForLoopOp,
"switch_case": SwitchCaseOp,
}

in_data = {"num_qubits": configuration.n_qubits}
Expand Down