James MC said:
So firstly, how can a matrix measure incompatibility?
In general, the commutator of two objects is of the same type as those objects, because it is a sum of two of them.
Have you seen 3D rotation matrices? Because I think they make a good example. If A and B are rotation matrices, then [A, B] tells you something about the "difference" in the final result if you apply them in a different order. For example, if A and B are both rotations around the same axis (say, x-axis) then [A, B] = 0. This means that for any vector
v, AB
b = BA
v. The zero says: the operations commute. In general, for rotations, this is not the case. For example, rotating first around the x-axis and then around the z-axis gives a different result than first performing the rotation around the z-axis and then around the x-axis. In this case, AB
b will give a different vector from BA
v. Are the results related? Well, obviously yes: there is a vector C
v such that AB
b = BA
v + C
v, and C = AB - BA.
The reason that this concept is important, is that in quantum mechanics operations often don't commute. Still, we sometimes want to have a specific operation at a specific position. Since your question is obviously inspired by QM, let me give an example. If the notation is not familiar to you, let me know and I will try to reformulate. For example, if |E> is some eigenstate of the Hamiltonian (##\hat H |E\rangle = E |E\rangle##), and you have an operator ##\hat A## that acts on your state, you can calculate the energy of the new state from ##\hat H \hat A |E\rangle##. However, you would prefer to have the Hamiltonian act first as you already know what it does to the state, so you would like to swap them. In general, this is not just allowed, but if you know the commutator of H and A you can write
$$\hat H \hat A |E\rangle = \hat A \underbrace{\hat E |E\rangle}_{= E |E\rangle} + \underbrace{[\hat H, \hat A]}_{\text{known}} |E\rangle$$
where ##\hat A E |E\rangle = E \cdot \hat A |E\rangle## because E is just a number which commutes with A.
James MC said:
Secondly, how can this equation be valid if the commutator of position and momentum is a number i times h-bar?
Position and momentum are not really matrices, but they are operators in a more general sense. For example, in the position basis where ##\hat x |x\rangle = x |x\rangle##, ##\hat p = c \frac{\partial}{\partial x}## where c is some complex constant. The way to calculate [x, p] is by letting it act on a "test" or dummy state like ##|x\rangle## above. However, whatever the commutator is, it must be of the same type as ##\hat x## and ##\hat p##.
James MC said:
Thirdly, how is a weird number like i times h-bar a measure of anything?
The most important thing is that this weird number is non-zero: whenever you use momentum operators and position operators together you must be very careful not to accidentally swap them without the proper bookkeeping. That a ##\hbar## pops up is irrelevant - you can choose your units such that ##\hbar = 1##. Actually you can consider it lucky (it's not, technically, but that would go too far) that the commutator is just the operator that multiplies by a constant. In principle, we could have had
$$ [\hat x, \hat p] f = \frac{\partial^2 f}{\partial x^2} - x^2 f $$
and QM would have been (even) much more unpleasant.