Skip to content

Commit 8f7aaa2

Browse files
committed
Update requirements.txt, as well as examples to match qiskit 2 API.
1 parent b3177bc commit 8f7aaa2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/run_aqt_estimator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from qiskit.circuit.library import n_local
2020

2121
from qiskit_scaleway import ScalewayProvider
22-
from qiskit_scaleway.primitives import EstimatorV1
22+
from qiskit_scaleway.primitives import Estimator
2323

2424
provider = ScalewayProvider(
2525
project_id="<your-scaleway-project-id>",
@@ -33,7 +33,7 @@
3333
session_id = backend.start_session(name="test-session", deduplication_id="my-workshop")
3434

3535
# Create an estimator (v1) with the backend and the session
36-
estimator = EstimatorV1(backend=backend, session_id=session_id)
36+
estimator = Estimator(backend=backend, session_id=session_id)
3737

3838
# Specify the problem Hamiltonian
3939
hamiltonian = SparsePauliOp.from_list(
@@ -56,15 +56,15 @@ def cost_function(
5656
params,
5757
ansatz: QuantumCircuit,
5858
hamiltonian: BaseOperator,
59-
estimator: EstimatorV1,
59+
estimator: Estimator,
6060
) -> float:
6161
"""Cost function for the VQE.
6262
6363
Return the estimated expectation value of the Hamiltonian
6464
on the state prepared by the Ansatz circuit.
6565
"""
6666
return float(
67-
estimator.run(ansatz, hamiltonian, parameter_values=params).result().values[0]
67+
estimator.run([(ansatz, hamiltonian, params)]).result().values[0]
6868
)
6969

7070

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
qiskit~=2.1
2-
qiskit-aer==0.17
2+
qiskit-aer~=0.17
33
randomname>=0.2.1
44
dataclasses-json>=0.6.4
55
dataclasses>=0.6
6-
scaleway-qaas-client>=0.1.16
6+
scaleway-qaas-client>=0.1.23

0 commit comments

Comments
 (0)