# If the spin operator is a matrix, why aren't the momentum or position operators a matrix?

So my question is to do with the fact that some operators seem to be matrices while others are not. I suspect if the eigenvalues of an operator has continuous eigenvalues then the operator is not a matrix but if it is discrete it is? I hoped for an explanation of why this might be the case?

• All linear operators can be written in matrix form, which act linearly on vectors. Whether or not this matrix form is useful is another matter. Commented Oct 19, 2022 at 2:20
• @ZeroTheHero Only if the spectrum of the operator is countable and even that is a stretch. Let's just say that physicists usually simply don't care about the differences between matrices and more general linear operators and they can get away with it most of the time. One should not take that as a get out of jail card for being sloppy. Commented Oct 19, 2022 at 2:47
• Take a look in the ADDENDUM of my answer here : Hermiticity of Momentum Operator (matrix) Represented in Position Basis. The use of Dirac $\:\delta-$function for the "matrix representation" of the momentum and position operators may be help you. Commented Oct 19, 2022 at 4:24
• Your assumption is incorrect. Position and momentum can be represented as matrices. That’s why Heisenberg called quantum mechanics “matrix mechanics”. (!) See Wikipedia for the explicit matrices in the case of a quantum harmonic operator, and for a general explanation of matrix mechanics. Commented Oct 19, 2022 at 15:47

Any operator which acts on an $$n$$-dimensional Hilbert space can be represented as an $$n\times n$$ matrix. An operator which acts on an infinite-dimensional Hilbert space such as $$L^2(\mathbb R^n)$$ can at best be loosely thought of as an $$\infty\times\infty$$ matrix (at least insofar as we still call quantities like $$\langle \phi|\hat O|\psi\rangle$$ matrix elements) - which is sometimes a useful way to think about it, and sometimes not.
To more directly answer your question, the spin operators for e.g. a spin-1/2 particle act on the 2-dimensional Hilbert space $$\mathbb C^2$$, and so can be represented as $$2\times 2$$ matrices. On the other hand, the Hamiltonian operator for a free particle on a line acts on the infinite-dimensional Hilbert space $$L^2(\mathbb R)$$.
When we talk about spin operators acting on a wavefunction, what we're really talking about is the operators $$\mathbf 1 \otimes S_i$$ which act on vectors in the composite Hilbert space $$L^2(\mathbb R)\otimes \mathbb C^2$$. We usually ignore the identity operator $$\mathbf 1$$ and just talk about the $$S_i$$'s acting on wavefunctions, but this is strictly speaking an abuse of notation.
1. If the position operator $$\hat{x}$$ and the momentum operator $$\hat{p}$$ were represented by finite-dimensional square matrices, then $${\rm Tr}[\hat{x},\hat{p}]=0$$, which would violate the CCR, cf. e.g. this Phys.SE post.
2. In contrast, the $$so(3)$$ Lie algebra of spin operators has finite-dimensional representations.