-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add option to retrieve stored ibm credentials #799 #1136
base: main
Are you sure you want to change the base?
Conversation
general-superstaq/requirements.txt
Outdated
@@ -1,4 +1,5 @@ | |||
numpy>=1.21.0 | |||
pydantic>=1.10.7 | |||
qiskit-ibm-provider==0.11.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two thoughts:
- unfortunately this package has been deprecated, we should be using
qiskit-ibm-runtime
instead - we don't want qiskit to be a base requirement of general-superstaq. instead maybe we can put this in
dev-requirements.txt
, and lazy-load it underif use_stored_ibmq_credentials:
insuperstaq_client
(and if it isn't installed raise an error saying that the package is required to load configs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was wondering why the repository was archived. Makes sense :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ... lazy-load it under
if use_stored_ibmq_credentials:
insuperstaq_client
(and if it isn't installed raise an error saying that the package is required to load configs)
Would this be a valid application of gss.SuperstaqException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think in this case i'd just go with ModuleNotFoundError
if ibmq_channel: | ||
kwargs["ibmq_channel"] = ibmq_channel | ||
|
||
if use_stored_ibmq_credentials: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qiskit runtime allows multiple accounts to be saved to be saved under different names, so we might want to add an argument to allow users to specify an ibmq_name
too?
kwargs["ibmq_channel"] = ibmq_channel | ||
|
||
if use_stored_ibmq_credentials: | ||
ibmq_provider = IBMProvider() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for runtime i think this will be something like
ibmq_provider = IBMProvider() | |
ibmq_account = qiskit_ibm_runtime.accounts.AccountManager.get( | |
channel=ibmq_channel, name=ibmq_name | |
) |
qiskit runtime allows multiple accounts to be saved to be saved under different names, so we might want to add an argument to allow users to specify an ibmq_name
too?
The user requested pydantic==1.10.7
checks-superstaq 0.5.33 depends on pydantic>=1.10.7
qiskit-ibm-runtime 0.34.0 depends on pydantic<2.10 and >=2.5.0
should I change the |
not 100% sure it will work but try |
Adds the option to retrieve stored ibm credentials (#799) by either:
use_stored_ibm_credentials
parameter toTrue
orIBMProvider()
object instance to theibmq_provider
parameter.First the
use_stored_ibm_credentials
flag is checked then whether anibmq_provider
is provided. Finally, if neither are set, checks ifibmq_token
,ibmq_instance
, andibmq_channel
have been set manually.