View source on GitHub |
Auxiliary function checking that stabilizers commute.
openfermion.transforms.check_commuting_stabilizers(
stabilizer_list, msg, thres=EQ_TOLERANCE
)
If two stabilizers anti-commute their product will have an imaginary coefficient. This function checks the list of stabilizers (QubitOperator) and raises an error if a complex number is found in any of the coefficients.
Args | |
---|---|
stabilizer_list
|
list
List of stabilizers as QubitOperators. |
msg
|
str
Message for the error. |
thres
|
Tolerance value, set to OpenFermion tolerance by default. |