Skip to content

Commit

Permalink
Merge branch 'main' into fix-target
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Apr 15, 2024
2 parents e8b9f6b + e460157 commit e1d308d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions qiskit_ibm_runtime/base_primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ def __init__(
self._service: QiskitRuntimeService | QiskitRuntimeLocalService = None
self._backend: Optional[BackendV1 | BackendV2] = None

issue_deprecation_msg(
"The Sampler and Estimator V1 primitives have been deprecated",
"0.23.0",
"Please use the V2 Primitives. See the `V2 migration guide "
"<https://docs.quantum.ibm.com/api/migration-guides/v2-primitives>`_. for more details",
3,
)

if options is None:
self._options = asdict(Options())
elif isinstance(options, Options):
Expand Down
1 change: 1 addition & 0 deletions qiskit_ibm_runtime/ibm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ def target(self) -> Target:

def target_history(self, datetime: Optional[python_datetime] = None) -> Target:
"""A :class:`qiskit.transpiler.Target` object for the backend.
Returns:
Target with properties found on `datetime`
"""
Expand Down
6 changes: 3 additions & 3 deletions test/unit/qiskit/test_backend_estimator_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def setUp(self):
self._precision = 5e-3
self._rtol = 3e-1
self._seed = 12
self._rng = np.random.default_rng(self._seed)
self._options = {"default_precision": self._precision, "seed_simulator": self._seed}
self.ansatz = RealAmplitudes(num_qubits=2, reps=2)
self.observable = SparsePauliOp.from_list(
Expand Down Expand Up @@ -330,7 +331,7 @@ def test_run_numpy_params(self, backend, abelian_grouping):
op = SparsePauliOp.from_list([("IZ", 1), ("XI", 2), ("ZY", -1)])
op = op.apply_layout(qc.layout)
k = 5
params_array = np.random.rand(k, qc.num_parameters)
params_array = self._rng.random((k, qc.num_parameters))
params_list = params_array.tolist()
params_list_array = list(params_array)
statevector_estimator = StatevectorEstimator(seed=123)
Expand Down Expand Up @@ -384,8 +385,7 @@ def test_aer(self, abelian_grouping):
qc = pm.run(qc)
op = [SparsePauliOp("IX"), SparsePauliOp("YI")]
shape = (3, 2)
rng = np.random.default_rng(seed)
params_array = rng.random(shape + (qc.num_parameters,))
params_array = self._rng.random(shape + (qc.num_parameters,))
params_list = params_array.tolist()
params_list_array = list(params_array)
statevector_estimator = StatevectorEstimator(seed=seed)
Expand Down

0 comments on commit e1d308d

Please sign in to comment.