openfermion.transforms.check_commuting_stabilizers

Auxiliary function checking that stabilizers commute.

If two stabilizers anti-commute their product will have an imaginary coefficient. This function checks the list of stabilizers (QubitOperator) and raises and error if a complex number is found in any of the coefficients.

stabilizer_list (list): List of stabilizers as QubitOperators. msg (str): Message for the error.
thres Tolerance value, set to OpenFermion tolerance by default.