# Commutators in bra-ket notation

2-d Hilbert space, with 2 (orthogonal) kets $$|a\rangle$$ and $$|b\rangle$$

Operator $$A=|a\rangle\langle b| + |b\rangle\langle a|$$

Operator $$B=-i|a\rangle\langle b| +i|b\rangle\langle a|$$

Commutator $$[A,B]=AB-BA$$

When I try to compute the commutator I end up getting expressions like $$|a\rangle\langle a|$$ , i.e a ket multiplied by a bra. How am I meant to calculate this?

• If the operators are already a multiplication of a bra with a ket, why does it trouble you that the resulting commutator (which has the same nature as its constituent elements) is of the same kind? Commented Jan 24, 2014 at 14:44
• $A$ and $B$ are just two of the Pauli matrices, and you (should) know their commutation relations. From that, you can find directly the result, and write it in the $a,b$ basis (to verify your direct calculation).
Everything is alright, there is no way to further simplify expressions (operators) like $|a\rangle\langle a|,|b\rangle\langle a|,|b\rangle\langle b|,|a\rangle\langle b|$. You could write linear combinations of them as matrix in the basis of the states $a$ and $b$, but that is no simplification, but a matter for notation. Your final result should be:
$$\left[A,B \right]=2 i\,|a\rangle\langle a|+2 i\,|b\rangle\langle b|$$