check_commutation

pyquil.paulis.check_commutation(pauli_list, pauli_two)[source]

Check if commuting a PauliTerm commutes with a list of other terms by natural calculation. Uses the result in Section 3 of arXiv:1405.5749v2, modified slightly here to check for the number of anti-coincidences (which must always be even for commuting PauliTerms) instead of the no. of coincidences, as in the paper.

Parameters:
  • pauli_list (list) – A list of PauliTerm objects
  • pauli_two_term (PauliTerm) – A PauliTerm object
Returns:

True if pauli_two object commutes with pauli_list, False otherwise

Return type:

bool