Skip to main content
IBM Quantum Platform

QkBitTerm

enum QkBitTerm

An enum that to represent each of the single-qubit alphabet terms enumerated below.


Values

  • QkBitTerm_X

    The Pauli XX operator.

    Value: 2 (0b0010)

  • QkBitTerm_Y

    The Pauli YY operator.

    Value: 3 (0b0011)

  • QkBitTerm_Z

    The Pauli ZZ operator.

    Value: 1 (0b0001)

  • QkBitTerm_Plus

    The projector ++\lvert +\rangle\langle +\rvert to the positive XX eigenstate.

    Value: 10 (0b1010)

  • QkBitTerm_Minus

    The projector \lvert -\rangle\langle -\rvert to the negative XX eigenstate.

    Value: 6 (0b0110)

  • QkBitTerm_Right

    The projector rr\lvert r\rangle\langle r\rvert to the positive YY eigenstate.

    Value: 11 (0b1011)

  • QkBitTerm_Left

    The projector ll\lvert l\rangle\langle l\rvert to the negative YY eigenstate.

    Value: 7 (0b0111)

  • QkBitTerm_Zero

    The projector 00\lvert 0\rangle\langle 0\rvert to the positive ZZ eigenstate.

    Value: 9 (0b1001)

  • QkBitTerm_One

    The projector 11\lvert 1\rangle\langle 1\rvert to the negative ZZ eigenstate.

    Value: 5 (0b0101)


Representation

The enum is stored as single byte, its elements are represented as unsigned 8-bit integer.

typedef uint8_t QkBitTerm
Warning

Not 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 ZZ and the second lowest a contribution by XX, 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.

Was this page helpful?
Report a bug or request content on GitHub.