qml.pauli.are_identical_pauli_words¶
- are_identical_pauli_words(pauli_1, pauli_2)[source]¶
Performs a check if two Pauli words have the same
wiresandnameattributes.This is a convenience function that checks if two given
Prodinstances specify the same Pauli word.- Parameters:
- Returns:
whether
pauli_1andpauli_2have the same wires and name attributes- Return type:
bool
- Raises:
TypeError – if
pauli_1orpauli_2are notIdentity,PauliX,PauliY,PauliZ,SProd, orProdinstances
Example
>>> are_identical_pauli_words(qml.Z(0) @ qml.Z(1), qml.Z(1) @ qml.Z(0)) True >>> are_identical_pauli_words(qml.I(0) @ qml.X(1), qml.X(1)) True >>> are_identical_pauli_words(qml.Z(0) @ qml.Z(1), qml.Z(0) @ qml.X(3)) False
code/api/pennylane.pauli.are_identical_pauli_words
Download Python script
Download Notebook
View on GitHub