check_commutativity
check_commutativity(op_1, op_2, anti=False)
Check the (anti-)commutativity between two operators.
Parameters
- op_1 (WeightedPauliOperator) – operator
- op_2 (WeightedPauliOperator) – operator
- anti (bool) – if True, check anti-commutativity, otherwise check commutativity.
Returns
whether or not two operators are commuted or anti-commuted.
Return type
bool
Was this page helpful?
Report a bug or request content on GitHub.