Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning from SamplerV2(backend=backend) #632

Closed
garrison opened this issue Jul 8, 2024 · 2 comments · Fixed by #633
Closed

DeprecationWarning from SamplerV2(backend=backend) #632

garrison opened this issue Jul 8, 2024 · 2 comments · Fixed by #633
Assignees
Milestone

Comments

@garrison
Copy link
Member

garrison commented Jul 8, 2024

There is a DeprecationWarning in this cell of the second tutorial:

from qiskit_ibm_runtime import SamplerV2

# Transpile the subeperiments to the backend's instruction set architecture (ISA)
isa_subexperiments = pass_manager.run(subexperiments)

# Set up the Qiskit Runtime Sampler primitive.  For a fake backend, this will use a local simulator.
sampler = SamplerV2(backend=backend)

# Submit the subexperiments
job = sampler.run(isa_subexperiments)

that says the following

/tmp/ipykernel_4069/2912014037.py:7: DeprecationWarning: The 'backend' keyword arguments are deprecated as of qiskit-ibm-runtime 0.24.0 and will be removed no sooner than 3 months after the release date. Please use the 'mode' parameter instead.
  sampler = SamplerV2(backend=backend)

We should fix this before releasing CKT 0.7.3. I'm not sure what the recommended way is, now, to submit a single job to a backend.

We should also check for this pattern in the tests.

@garrison garrison added this to the 0.7.3 milestone Jul 8, 2024
@garrison
Copy link
Member Author

garrison commented Jul 8, 2024

https://cloud.ibm.com/docs/quantum-computing?topic=quantum-computing-get-started#test-setup currently uses SamplerV2(backend=backend). I wonder if the deprecation warning is intentional or not.

@garrison
Copy link
Member Author

garrison commented Jul 8, 2024

It looks like (from the docstring) we are supposed to now say mode=backend instead, or to just pass backend as a single positional argument.

@garrison garrison self-assigned this Jul 8, 2024
garrison added a commit that referenced this issue Jul 8, 2024
mergify bot pushed a commit that referenced this issue Jul 8, 2024
* Pass `backend` as positional argument to `SamplerV2` for job mode

This fixes a deprecation warning.

Fixes #632.

* black

(cherry picked from commit 1ca5b0c)
garrison added a commit that referenced this issue Jul 8, 2024
…) (#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant