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

fix default qubit warning for simulator #202

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

splch
Copy link
Collaborator

@splch splch commented Oct 21, 2024

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

@splch splch changed the title fix default warning for simulator fix default qubit warning for simulator Oct 21, 2024

Returns:
int: The number of qubits for the backend.
"""
# Handle known case for the simulator directly
if backend == "simulator":
Copy link
Collaborator

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?

Copy link
Collaborator Author

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()
Copy link
Collaborator

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.

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 this pull request may close these issues.

4 participants