is_identity

pyquil.paulis.is_identity(term)[source]

Tests to see if a PauliTerm or PauliSum is a scalar multiple of identity

Parameters

term (Union[PauliTerm, PauliSum]) – Either a PauliTerm or PauliSum

Return type

bool

Returns

True if the PauliTerm or PauliSum is a scalar multiple of identity, False otherwise