QkBitTerm
enum QkBitTermAn enum that to represent each of the single-qubit alphabet terms enumerated below.
Values
-
QkBitTerm_XThe Pauli operator.
Value: 2 (
0b0010) -
QkBitTerm_YThe Pauli operator.
Value: 3 (
0b0011) -
QkBitTerm_ZThe Pauli operator.
Value: 1 (
0b0001) -
QkBitTerm_PlusThe projector to the positive eigenstate.
Value: 10 (
0b1010) -
QkBitTerm_MinusThe projector to the negative eigenstate.
Value: 6 (
0b0110) -
QkBitTerm_RightThe projector to the positive eigenstate.
Value: 11 (
0b1011) -
QkBitTerm_LeftThe projector to the negative eigenstate.
Value: 7 (
0b0111) -
QkBitTerm_ZeroThe projector to the positive eigenstate.
Value: 9 (
0b1001) -
QkBitTerm_OneThe projector to the negative eigenstate.
Value: 5 (
0b0101)
Representation
The enum is stored as single byte, its elements are represented as unsigned 8-bit integer.
typedef uint8_t QkBitTermNot all uint8_t values are valid bit terms. Passing invalid values is undefined behavior.
The numeric structure of these is that they are all four-bit values of which the low two bits are the (phase-less) symplectic representation of the Pauli operator related to the object, where the low bit denotes a contribution by and the second lowest a contribution by , while the upper two bits are 00 for a Pauli operator, 01 for the negative-eigenstate projector, and 10 for the positive-eigenstate projector.
Functions
qk_bitterm_label
uint8_t qk_bitterm_label(QkBitTerm bit_term)
Get the label for a bit term.
Example
QkBitTerm bit_term = QkBitTerm_Y;
// cast the uint8_t to char
char label = qk_bitterm_label(bit_term);Safety
The behavior is undefined if bit_term is not a valid uint8_t value of a QkBitTerm.
Parameters
bit_term – The bit term.
Returns
The label as uint8_t, which can be cast to char to obtain the character.