-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix default qubit warning for simulator #202
base: main
Are you sure you want to change the base?
Conversation
qiskit_ionq/helpers.py
Outdated
|
||
Returns: | ||
int: The number of qubits for the backend. | ||
""" | ||
# Handle known case for the simulator directly | ||
if backend == "simulator": |
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.
this feels a little weird in get_n_qubits, is this because this is externally usable?
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 just updated it to use our publicly accessible backends endpoint which provides qubit counts :D
@@ -515,17 +517,19 @@ def resolve_credentials(token: str | None = None, url: str | None = None): | |||
Returns: | |||
dict[str]: A dict with "token" and "url" keys, for use by a client. | |||
""" | |||
# Cache dotenv and environment variable lookups | |||
env_values = dotenv_values() |
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.
This will mean that if one calls resolve_credentials
and doesn't have the env vars set, then sets it, then calls resolve_credentials
again, which will return the incorrect thing.
No need to cache such a cheap operation IMHO.
Summary
the simulator doesn't have accessible qubit defaults, so we need to manually add this
Details and comments
prevents a warning from the backend initialization