Ambiguous parameter name in custatevecSwapIndexBits
#152
TysonRayJones
started this conversation in
General
Replies: 1 comment 1 reply
-
Hi @TysonRayJones, The input arguments
For the bit ordering scheme in the cuStateVec, we describe it in https://docs.nvidia.com/cuda/cuquantum/latest/custatevec/overview.html#bit-ordering. We uniformly call the bit positions of each element of a bit string array as |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi beautiful cuStateVec team!
Imagine performing an arbitrarily-controlled (i.e. some control qubits may be in state
0
) SWAP gate using the non-distributedcustatevecSwapIndexBits()
. Unlike other arbitrarily-controlled functions (e.g.custatevecapplymatrix()
) which accept explicit control bit values:the
custatevecSwapIndexBits
function instead acceptsThe doc does not make clear how to use these arguments; are they merely the reversed order of the above control parameters?
The relevant example code makes the unfortunate choice of controlling upon qubit index
1
with state1
, so does not disambiguate:What is really throwing me off is the vagueness of the parameter name
maskOrdering
, which the doc describes asYet the example code appears to set
maskOrdering
to a list of bit indices of the masked bits, corresponding to the order ofmaskBitString
. This is a stronger specification than just an "ordering".If I have understood the doc and example correctly, I would propose a change like:
maskOrdering
andmaskBitIndices
, to make it consistent with the order ofcontrols
andcontrolBitValues
in the rest of the APImaskOrdering
tomaskBitIndices
Beta Was this translation helpful? Give feedback.
All reactions