Skip to content

Commit

Permalink
Update to avoid warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Ripper committed May 28, 2024
1 parent 2c4ac44 commit b6b75f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/QAOA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ function retrieve(
end
end

session = qiskit_ibm_runtime.Session(service=service, backend=backend)
estimator = qiskit_ibm_runtime.EstimatorV2(session=session)
estimator = if is_local || ibm_backend == "ibmq_qasm_simulator"
qiskit_ibm_runtime.EstimatorV2(backend = backend)
else
session = qiskit_ibm_runtime.Session(service=service, backend=backend)
qiskit_ibm_runtime.EstimatorV2(session=session)
end
if !is_local
estimator.options.default_shots = num_reads
end
Expand Down
8 changes: 6 additions & 2 deletions src/VQE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ function retrieve(
end
end

session = qiskit_ibm_runtime.Session(service=service, backend=backend)
estimator = qiskit_ibm_runtime.EstimatorV2(session=session)
estimator = if is_local || ibm_backend == "ibmq_qasm_simulator"
qiskit_ibm_runtime.EstimatorV2(backend = backend)
else
session = qiskit_ibm_runtime.Session(service=service, backend=backend)
qiskit_ibm_runtime.EstimatorV2(session=session)
end
if !is_local
estimator.options.default_shots = num_reads
end
Expand Down

0 comments on commit b6b75f0

Please sign in to comment.