From 7fc00c5b23ba0dbbc33e7a612a0fbddc56f214a5 Mon Sep 17 00:00:00 2001 From: mhucka <1450019+mhucka@users.noreply.github.com> Date: Fri, 27 Mar 2026 04:49:45 +0000 Subject: [PATCH] Remove redundant `to_normal_order` after `SetState` in `VectorSpaceCuStateVecEx::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`. --- lib/vectorspace_custatevecex.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/vectorspace_custatevecex.h b/lib/vectorspace_custatevecex.h index 2d80f28de..69f23affc 100644 --- a/lib/vectorspace_custatevecex.h +++ b/lib/vectorspace_custatevecex.h @@ -546,9 +546,6 @@ class VectorSpaceCuStateVecEx { ErrorCheck(custatevecExStateVectorSynchronize(dest.get())); - // TODO: do we need that? - dest.to_normal_order(); - return true; } @@ -576,9 +573,6 @@ class VectorSpaceCuStateVecEx { ErrorCheck(custatevecExStateVectorSynchronize(dest.get())); - // TODO: do we need that? - dest.to_normal_order(); - return true; }