|
1 | 1 | # This code is part of Qiskit.
|
2 | 2 | #
|
3 |
| -# (C) Copyright IBM 2022. |
| 3 | +# (C) Copyright IBM 2022, 2023. |
4 | 4 | #
|
5 | 5 | # This code is licensed under the Apache License, Version 2.0. You may
|
6 | 6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
|
|
23 | 23 | from qiskit.circuit import Parameter, QuantumCircuit
|
24 | 24 | from qiskit.circuit.library import RealAmplitudes
|
25 | 25 | from qiskit.exceptions import QiskitError
|
26 |
| -from qiskit.opflow import PauliSumOp |
27 | 26 | from qiskit.primitives import EstimatorResult
|
28 | 27 | from qiskit.quantum_info import Operator, SparsePauliOp
|
29 | 28 |
|
@@ -53,19 +52,6 @@ def setUp(self):
|
53 | 52 | def test_estimator(self, abelian_grouping):
|
54 | 53 | """test for a simple use case"""
|
55 | 54 | lst = [("XX", 1), ("YY", 2), ("ZZ", 3)]
|
56 |
| - with self.assertWarns(DeprecationWarning): |
57 |
| - with self.subTest("PauliSumOp"): |
58 |
| - observable = PauliSumOp.from_list(lst) |
59 |
| - ansatz = RealAmplitudes(num_qubits=2, reps=2) |
60 |
| - est = Estimator( |
61 |
| - backend_options={"method": "statevector"}, abelian_grouping=abelian_grouping |
62 |
| - ) |
63 |
| - result = est.run( |
64 |
| - ansatz, observable, parameter_values=[[0, 1, 1, 2, 3, 5]], seed=15 |
65 |
| - ).result() |
66 |
| - self.assertIsInstance(result, EstimatorResult) |
67 |
| - np.testing.assert_allclose(result.values, [1.728515625]) |
68 |
| - |
69 | 55 | with self.subTest("SparsePauliOp"):
|
70 | 56 | observable = SparsePauliOp.from_list(lst)
|
71 | 57 | ansatz = RealAmplitudes(num_qubits=2, reps=2)
|
|
0 commit comments