Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
doichanj committed Aug 8, 2024
1 parent 7211d09 commit 1e1ae96
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
3 changes: 1 addition & 2 deletions qiskit_aer/backends/aer_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from qiskit.providers import convert_to_target
from qiskit.providers.options import Options
from qiskit.providers.backend import BackendV2, BackendV1
from qiskit.transpiler.target import target_to_backend_properties

from ..version import __version__
from .aerbackend import AerBackend, AerError
Expand Down Expand Up @@ -854,7 +853,7 @@ def from_backend(cls, backend, **options):
target = backend.target
elif isinstance(backend, BackendV1):
# BackendV1 will be removed in Qiskit 2.0, so we will remove this soon
warnings.warn(
warn(
" from_backend using V1 based backend is deprecated as of Aer 0.15"
" and will be removed no sooner than 3 months from that release"
" date. Please use backends based on V2.",
Expand Down
15 changes: 1 addition & 14 deletions qiskit_aer/backends/aerbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from qiskit.qobj import QasmQobj, PulseQobj
from qiskit.result import Result
from qiskit.transpiler import CouplingMap
from qiskit.circuit.controlflow import CONTROL_FLOW_OP_NAMES
from qiskit.circuit.library.standard_gates import get_standard_gate_name_mapping
from ..aererror import AerError
from ..jobs import AerJob, AerJobSet, split_qobj
from ..noise.noise_model import NoiseModel, QuantumErrorLocation
Expand Down Expand Up @@ -329,21 +329,8 @@ def target(self):
return self._target

# make target for AerBackend

# importing packages where they are needed, to avoid cyclic-import.
# pylint: disable=cyclic-import
from qiskit.transpiler.target import (
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

required = ["measure", "delay"]

# Load Qiskit object representation
qiskit_inst_mapping = get_standard_gate_name_mapping()
qiskit_inst_mapping.update(NAME_MAPPING)

Expand Down
9 changes: 5 additions & 4 deletions qiskit_aer/backends/qasm_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import copy
import logging
from warnings import warn
from qiskit.providers import convert_to_target
from qiskit.providers.options import Options
from qiskit.providers.models import QasmBackendConfiguration
from qiskit.providers.backend import BackendV2
from qiskit.providers.backend import BackendV2, BackendV1

from ..version import __version__
from ..aererror import AerError
Expand All @@ -35,6 +35,7 @@

# pylint: disable=import-error, no-name-in-module, abstract-method
from .controller_wrappers import aer_controller_execute
from .name_mapping import NAME_MAPPING

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -431,7 +432,7 @@ class QasmSimulator(AerBackend):

_AVAILABLE_DEVICES = None

def __init__(self, configuration=None, properties=None, provider=None, **backend_options):
def __init__(self, configuration=None, provider=None, **backend_options):
warn(
"The `QasmSimulator` backend will be deprecated in the"
" future. It has been superseded by the `AerSimulator`"
Expand Down Expand Up @@ -550,7 +551,7 @@ def from_backend(cls, backend, **options):
target = backend.target
elif isinstance(backend, BackendV1):
# BackendV1 will be removed in Qiskit 2.0, so we will remove this soon
warnings.warn(
warn(
" from_backend using V1 based backend is deprecated as of Aer 0.15"
" and will be removed no sooner than 3 months from that release"
" date. Please use backends based on V2.",
Expand Down

0 comments on commit 1e1ae96

Please sign in to comment.