Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
t-imamichi committed Jan 9, 2024
1 parent a079fd4 commit 2d6d2b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions qiskit/primitives/backend_sampler_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from __future__ import annotations

import math
from dataclasses import dataclass
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union

Expand All @@ -24,11 +23,11 @@

from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.providers.backend import BackendV1, BackendV2
from qiskit.result import QuasiDistribution, Result
from qiskit.result import Result
from qiskit.transpiler.passmanager import PassManager

from .backend_estimator import _prepare_counts, _run_circuits
from .base import BaseSamplerV2, SamplerResult
from .backend_estimator import _run_circuits
from .base import BaseSamplerV2
from .containers import (
BasePrimitiveOptions,
BasePrimitiveOptionsLike,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/primitives/statevector_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from __future__ import annotations

from dataclasses import dataclass
from typing import Dict, Iterable, List, Optional, Tuple, Union

import numpy as np
Expand All @@ -39,7 +38,7 @@
make_data_bin,
)
from .containers.bit_array import _min_num_bytes
from .containers.dataclasses import mutable_dataclass
from .containers.dataclasses import dataclass, mutable_dataclass
from .primitive_job import PrimitiveJob
from .utils import bound_circuit_to_instruction

Expand Down
7 changes: 3 additions & 4 deletions test/python/primitives/test_sampler_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,8 @@ def test_run_errors(self):
qc2.measure_all()
qc3 = QuantumCircuit(1)
qc4 = QuantumCircuit(1, 1)
qc5 = QuantumCircuit(1, 1)
with qc5.for_loop(range(5)):
qc5.h(0)
with qc4.for_loop(range(5)):
qc4.h(0)

sampler = Sampler(options=self._options)
with self.subTest("set parameter values to a non-parameterized circuit"):
Expand All @@ -308,7 +307,7 @@ def test_run_errors(self):
_ = sampler.run([qc3]).result()
with self.subTest("with control flow"):
with self.assertRaises(QiskitError):
_ = sampler.run([qc5]).result()
_ = sampler.run([qc4]).result()

def test_run_empty_parameter(self):
"""Test for empty parameter"""
Expand Down

0 comments on commit 2d6d2b5

Please sign in to comment.