KEMBAR78
Support 2-d broadcast for observe by 1tnguyen · Pull Request #829 · NVIDIA/cuda-quantum · GitHub
Skip to content

Conversation

@1tnguyen
Copy link
Collaborator

Description

We infer the type of broadcasting in args vs. array of args and spin_op vs. array of spin_op when handling Python observe.
However, we didn't handle a combination of them.

This PR:

  • Allow Python observe to return a nested vector. Peel off the spin_op sum result to construct the nested result.

  • Add a unit test case.

Resolved #776

@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Oct 27, 2023
Copy link
Collaborator

@amccaskey amccaskey left a comment

Choose a reason for hiding this comment

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

Thanks for the fix

Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Oct 27, 2023
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.

👍

@github-actions
Copy link

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

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

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

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

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

github-actions bot pushed a commit that referenced this pull request Oct 30, 2023
@1tnguyen 1tnguyen merged commit c252520 into NVIDIA:main Oct 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2023
@bettinaheim bettinaheim added the bug fix To be listed under Bug Fixes in the release notes label Nov 15, 2023
@bettinaheim bettinaheim added this to the release 0.5.0 milestone Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug fix To be listed under Bug Fixes in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broadcasting on observe yields incorrect results

5 participants