qml.pauli.diagonalize_pauli_word¶
- diagonalize_pauli_word(pauli_word)[source]¶
Transforms the Pauli word to diagonal form in the computational basis.
- Parameters
pauli_word (Operator) – the Pauli word to diagonalize in computational basis
- Returns
the Pauli word diagonalized in the computational basis
- Return type
- Raises
TypeError – if the input is not a Pauli word, i.e., a Pauli operator,
Identity
, orTensor
instances thereof
Example
>>> diagonalize_pauli_word(qml.X('a') @ qml.Y('b') @ qml.Z('c')) Z('a') @ Z('b') @ Z('c')