-
Notifications
You must be signed in to change notification settings - Fork 294
Fix a bug in Python run, run_async, sample_async, and observe_async: callable args are dropped
#3545
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
cudaq.run: callable args are droppedrun, run_async, sample_async, and observe_async: callable args are dropped
Signed-off-by: Thien Nguyen <[email protected]>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
| prep_1_state, | ||
| num_qubits, | ||
| shots_count=10).get() | ||
| print("Results for prep_1_state with", num_qubits, "qubits:", results) |
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.
Do we need this print statement?
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.
LGTM. Thanks @1tnguyen.
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
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.
Please do not merge this yet.
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.
The total rewrite isn't going to be ready. I'll just have to revert these changes, it looks like.
Description
Python's
run,run_async,sample_async, andobserve_asyncare handled entirely in PyBinding, which is different fromsampleandobserve(Python implementation insample.pyandobserve.py.(Thanks @khalatepradnya, for pointing out all the places where we may have this oversight)
The main difference is that we're missing some logic in handling callable arguments, which is part of Python's
__call__before invokingpyAltLaunchKernel. Hence, callableargsare not packed.This PR fixes that and adds tests for this scenario.