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
code/api/pennylane.pauli.pauli_sentence
Download Python script
Download Notebook
View on GitHub