qml.pauli.pauli_sentence

pauli_sentence(op)[source]

Return the PauliSentence representation of an arithmetic operator or Hamiltonian.

Parameters

op (Operator) – The operator or Hamiltonian that needs to be converted.

Raises

ValueError – Op must be a linear combination of Pauli operators

Returns

the PauliSentence representation of an arithmetic operator or Hamiltonian

Return type

PauliSentence