Skip to content

Commit

Permalink
Pass backend as positional argument to SamplerV2 for job mode (#633
Browse files Browse the repository at this point in the history
…) (#634)

* Pass `backend` as positional argument to `SamplerV2` for job mode

This fixes a deprecation warning.

Fixes #632.

* black

(cherry picked from commit 1ca5b0c)

Co-authored-by: Jim Garrison <garrison@ibm.com>
  • Loading branch information
mergify[bot] and garrison authored Jul 8, 2024
1 parent ee6cf5b commit e8935fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
"isa_subexperiments = pass_manager.run(subexperiments)\n",
"\n",
"# Set up the Qiskit Runtime Sampler primitive. For a fake backend, this will use a local simulator.\n",
"sampler = SamplerV2(backend=backend)\n",
"sampler = SamplerV2(backend)\n",
"\n",
"# Submit the subexperiments\n",
"job = sampler.run(isa_subexperiments)"
Expand Down
4 changes: 1 addition & 3 deletions test/cutting/test_cutting_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ def test_reconstruction_with_samplerv2():
)

# Use SamplerV2 in local mode with AerSimulator
samplers = {
label: SamplerV2(backend=AerSimulator()) for label in subexperiments.keys()
}
samplers = {label: SamplerV2(AerSimulator()) for label in subexperiments.keys()}
results = {
label: sampler.run(subexperiments[label], shots=128).result()
for label, sampler in samplers.items()
Expand Down

0 comments on commit e8935fa

Please sign in to comment.