Fix an issue with tensornet observe when the canonicalized spin_op doesn't span the entire qubit space#3038
Merged
1tnguyen merged 4 commits intoNVIDIA:mainfrom Jun 12, 2025
Conversation
…oesn't span the entire qubit space Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
khalatepradnya
approved these changes
Jun 11, 2025
Collaborator
khalatepradnya
left a comment
There was a problem hiding this comment.
LGTM. Thanks, Thien!
(One Q about scope)
mitchdz
approved these changes
Jun 11, 2025
Collaborator
mitchdz
left a comment
There was a problem hiding this comment.
Similar question to Pradnya, otherwise LGTM!
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
annagrin
pushed a commit
to annagrin/cuda-quantum
that referenced
this pull request
Jun 17, 2025
…oesn't span the entire qubit space (NVIDIA#3038) Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> Co-authored-by: Mitchell <mitch_dz@hotmail.com> Signed-off-by: Anna Gringauze <agringauze@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Symptom: CUTENSORNET_INVALID_VALUE error when using
observewith aspin_opthat doesn't span the entire qubit space, e.g.,spin_opwith a single termYIXXIZYZYYYIIY.This is because we're using the number of elements in the
degreeslist to create the cutensornet's network operator, while adding Pauli operators at the values of those elements. Hence, this caused out-of-range (invalid value) exceptions.The fix is that we need to find the actual max index to determine the size of the network operator to be created.
This is a regression since #2710, whereby the canonicalized
spin_opno longer tracks degrees of identity Pauli.Also,
Add an example, which will be validated by the Publishing pipeline.
Add unit tests, which will be validated by QA.