Closed garrison closed 6 months ago
I think we can remove the warning since that example already has a comment explaining that local mode doesn't support sessions and it's also mentioned in the execution modes faq https://docs.quantum.ibm.com/run/execution-modes-faq
What is the expected feature or enhancement?
Currently if one uses a session with a fake backend in local mode, qiskit-ibm-runtime triggers a warning:
https://github.com/Qiskit/qiskit-ibm-runtime/blob/4c00d409fcfdab00fa0128f44d9c66b38a381aa1/qiskit_ibm_runtime/session.py#L157-L159
I've wondered: is this warning really necessary? Or, what constructive action would we expect a user to take upon seeing this warning?
For instance, the following code taken directly from https://docs.quantum.ibm.com/api/migration-guides/local-simulators will trigger it:
In the circuit-knitting-toolbox, I am rephrasing our tutorials to use Qiskit Runtime with fake backends in local mode and will ideally demonstrate the use of
Batch
so that one can simply swap the backend for a hardware backend and have everything work optimally. However, then there will always be this warning in the notebook when it is run without change.For this reason I ask: Is it truly necessary?
I'll note in passing that because this warning doesn't have the
stacklevel
set, it is displayed as aUserWarning
from the above line of qiskit-ibm-runtime rather than from the user's code. One could perhaps setstacklevel=2
, but this still wouldn't point to the correct line when the user creates aBatch
rather than aSession
; in that casestacklevel=3
would be needed to get to user code (Batch.__init__
is an extra function on the stack).Acceptance criteria
I suggest clarifying why the warning is believed to be beneficial and possibly changing it to a message at
INFO
log level.