Qiskit-Extensions / circuit-knitting-toolbox

Tools for knitting quantum circuits with Qiskit
https://qiskit-extensions.github.io/circuit-knitting-toolbox/
Apache License 2.0
72 stars 24 forks source link

DeprecationWarning from `SamplerV2(backend=backend)` #632

Closed garrison closed 3 weeks ago

garrison commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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.