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

[custatevec] getStateData to return data consistent with qpp and cudaq::from_state #582

Merged

Conversation

1tnguyen
Copy link
Collaborator

Description

Since we now have cudaq::from_state, which assumes MSB bit-ordering for its input, this PR makes CuStateVecCircuitSimulator::getStateData to return the state data in that bit ordering.

This will make it consistent with qpp as well as the cudaq::from_state convention.

Tested by: running test_runtime_custatevec-fp32: KernelsTester.checkFromState test passed.

…q::from_state

Since we now have `cudaq::from_state`, which assumes MSB bit-ordering for its input, make `CuStateVecCircuitSimulator::getStateData` to return the state data in that bit ordering as well.

This will make it consistent with qpp as well as the `cudaq::from_state` convention.

Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
@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 Aug 29, 2023
…tate`

Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
@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 Aug 29, 2023
`mEntry` returns `std::pow(-1, sum_of_ones)`, i.e., expected {0, +1, -1}  but the return type is `std::size_t`.

In x86, all seems to work just fine when mEntry returned value is casted to an int. However, in ARM, that -1 size_t is converted to a 0!

Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
@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 Aug 29, 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

@amccaskey amccaskey merged commit 5a2a08c into NVIDIA:main Aug 29, 2023
101 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2023
@1tnguyen 1tnguyen added bug fix To be listed under Bug Fixes in the release notes release notes Changes need to be captured in the release notes labels Sep 25, 2023
@1tnguyen 1tnguyen added this to the release 0.4.1 milestone Sep 25, 2023
@bettinaheim bettinaheim removed the release notes Changes need to be captured in the release notes label Sep 27, 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.

4 participants