qiskit.quantum_info.commutator¶ commutator(a, b)[source]¶ Compute commutator of a and b. \[ab - ba.\] Parameters a (OperatorTypeT) – Operator a. b (OperatorTypeT) – Operator b. Returns The commutator Return type OperatorTypeT