Skip to content

Remove redundant to_normal_order after SetState in custatevecExStateVectorSetState#1029

Merged
mhucka merged 3 commits intoquantumlib:mainfrom
mhucka:fix-redundant-to-normal-order-in-copy-custatevecex-17350625667726609425
Apr 6, 2026
Merged

Remove redundant to_normal_order after SetState in custatevecExStateVectorSetState#1029
mhucka merged 3 commits intoquantumlib:mainfrom
mhucka:fix-redundant-to-normal-order-in-copy-custatevecex-17350625667726609425

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented Mar 27, 2026

Based on the cuStateVecEx documentation, custatevecExStateVectorSetState respects the current wire ordering of the state vector. Therefore, calling to_normal_order() to physically rearrange the state is not logically required after initialization from a host buffer, and it might even be undesirable if the caller intends to keep a specific permutation for performance.

Removed the to_normal_order() calls and associated TODO comments from both Copy overloads in lib/vectorspace_custatevecex.h.

…StateVecEx::Copy`.

Based on cuStateVecEx documentation, `custatevecExStateVectorSetState`
respects the current wire ordering of the state vector. Therefore, calling
`to_normal_order()` to physically rearrange the state is not logically
required after initialization from a host buffer, and it might even be
undesirable if the caller intends to keep a specific permutation for performance.

Removed the `to_normal_order()` calls and associated TODO comments from both
`Copy` overloads in `lib/vectorspace_custatevecex.h`.
@github-actions github-actions Bot added the size: XS <10 lines changed label Mar 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes redundant calls to to_normal_order() and associated TODO comments in lib/vectorspace_custatevecex.h following state vector synchronization. I have no feedback to provide.

@mhucka mhucka requested a review from sergeisakov April 5, 2026 04:20
Copy link
Copy Markdown
Collaborator

@sergeisakov sergeisakov left a comment

Choose a reason for hiding this comment

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

LGTM

@mhucka mhucka added this pull request to the merge queue Apr 6, 2026
Merged via the queue into quantumlib:main with commit f0eec9e Apr 6, 2026
28 checks passed
@mhucka mhucka deleted the fix-redundant-to-normal-order-in-copy-custatevecex-17350625667726609425 branch April 6, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants