From 2825e1f76dc26a303b56dec333daa014f3daeb1c Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Mon, 12 Aug 2024 23:03:07 -0400 Subject: [PATCH] Derive from `BaseSamplerV1` rather than `BaseSampler` (#2199) This change is in accordance with the following warning that is triggered by the Qiskit 1.2 rc: > qiskit_aer/primitives/sampler.py:69: DeprecationWarning: The class ``qiskit.primitives.base.base_sampler.BaseSampler`` is deprecated as of qiskit 1.2. It will be removed no earlier than 3 months after the release date. The `BaseSampler` class is a type alias for the `BaseSamplerV1` interface that has been deprecated in favor of explicitly versioned interface classes. It is recommended to migrate all implementations to use `BaseSamplerV2`. However, for implementations incompatible with `BaseSamplerV2`, `BaseSampler` can be replaced with the explicitly versioned `BaseSamplerV1` class. Co-authored-by: Jun Doi --- qiskit_aer/primitives/sampler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_aer/primitives/sampler.py b/qiskit_aer/primitives/sampler.py index 17350f0707..7a97a9c4c8 100644 --- a/qiskit_aer/primitives/sampler.py +++ b/qiskit_aer/primitives/sampler.py @@ -22,14 +22,14 @@ from qiskit.circuit import ParameterExpression, QuantumCircuit from qiskit.compiler import transpile from qiskit.exceptions import QiskitError -from qiskit.primitives import BaseSampler, SamplerResult +from qiskit.primitives import BaseSamplerV1, SamplerResult from qiskit.primitives.utils import final_measurement_mapping, init_circuit from qiskit.result import QuasiDistribution from .. import AerSimulator -class Sampler(BaseSampler): +class Sampler(BaseSamplerV1): """ Aer implementation of Sampler class.