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

get num of qubits from api or use 36 and fix EM sampler #188

Merged
merged 11 commits into from
Sep 5, 2024

Conversation

splch
Copy link
Collaborator

@splch splch commented Sep 4, 2024

Summary

temporary solution before migrating to backendv2

Details and comments

update n_qubits to 36.
set EM from backend options

@splch splch changed the title get num of qubits from api or use 36 get num of qubits from api or use 36 and fix EM sampler Sep 5, 2024
).json()["qubits"]
except Exception: # pylint: disable=broad-except
if backend == "ionq_qpu.harmony":
return 11
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this? falling back to a hard-coded value when the API is down feels a little weird

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the user might not have an api_key set, and we require that to get characterization data (including the number of qubits)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I meant more, the part where we code in the current system sizes, would worry it could quickly become stale, like the new method with warning and a fixed cap, thanks for changing!

elif backend == "ionq_qpu.forte-1":
return 36
else:
return 36
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have a hard time understanding what this code was doing, since it falls back during an exception but doesn't' log it or what value it's deciding. Could you add logs here? (or alternatively, fall back to Infinity or something >> 36?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't do inifinity because the transpiler freezes (i guess it tries to create a graph of length #qubits lol

@splch splch merged commit 1e8f8f6 into main Sep 5, 2024
12 checks passed
@splch splch deleted the temp-fix-num_qubits branch September 5, 2024 17:39
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.

2 participants