Skip to content

Conversation

@1tnguyen
Copy link
Collaborator

@1tnguyen 1tnguyen commented Oct 24, 2025

Description

Python's run, run_async, sample_async, and observe_async are handled entirely in PyBinding, which is different from sample and observe (Python implementation in sample.py and observe.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 invoking pyAltLaunchKernel. Hence, callable args are not packed.

This PR fixes that and adds tests for this scenario.

@1tnguyen 1tnguyen changed the title Fix a bug in Python cudaq.run: callable args are dropped Fix a bug in Python run, run_async, sample_async, and observe_async: callable args are dropped Oct 24, 2025
Signed-off-by: Thien Nguyen <[email protected]>
github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
@github-actions
Copy link

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

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?

Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @1tnguyen.

github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
@github-actions
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@schweitzpgi schweitzpgi left a 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.

Copy link
Collaborator

@schweitzpgi schweitzpgi left a 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.

@schweitzpgi schweitzpgi dismissed their stale review October 24, 2025 16:31

Other work is not ready.

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.

3 participants