pub type bitEncoding = c_uint;
Expand description
Flags for specifying how the bits in sub-register computational basis states are mapped to indices in functions like applyPhaseFunc().
- \p UNSIGNED means the bits encode an unsigned integer, hence \f[ \begin{aligned} |00\rangle & \rightarrow , 0 \ |01\rangle & \rightarrow , 1 \ |10\rangle & \rightarrow , 2 \ |11\rangle & \rightarrow , 3 \end{aligned} \f]
- \p TWOS_COMPLEMENT means the bits encode a signed integer through two’s complement, such that \f[ \begin{aligned} |000\rangle & \rightarrow , 0 \ |001\rangle & \rightarrow , 1 \ |010\rangle & \rightarrow , 2 \ |011\rangle & \rightarrow , 3 \ |100\rangle & \rightarrow ,-4 \ |101\rangle & \rightarrow ,-3 \ |110\rangle & \rightarrow ,-2 \ |111\rangle & \rightarrow ,-1 \end{aligned} \f]
Remember that the qubits specified within a sub-register, and their ordering (least to most significant) determine the bits of a computational basis state, before intrepretation as an encoding of an integer.
@ingroup type @author Tyson Jones