I'm self-studying QM and have a basic question on quantum harmonic oscillator. The Hamilton is certainly quantized under this model, that is $E_n=(n+1/2)\hbar \omega$, for $n=0,1,2,...$. But is linear momentum quantized under this model? The textbook by Griffith told me momentum operator has continuous spectra, so it shouldn't be quantized.
But $L^2(\mathbb{R})$ (square-integrable functions) is separable, and the weighted Hermite polynomials (which are the eigenstates of the quantum harmonic oscillator) constitute a countable basis for it. The momentum operator can be represented as a "countably infinite" dimensional matrix (I know I'm making up words here). So how can this matrix with a "countably infinite" dimension has continuous spectra?
Update: thank you all for the wonderful answers! I just would like to follow up with a question to make sure I'm on the right track. I'm quoting a lecture note . It is easy to check that the ladder operators can be represented by the following matrices under the stationary states of Hamiltonian: \begin{equation*} a=\begin{pmatrix} 0 & \sqrt{1} & 0 & \cdots \\ 0 & 0 & \sqrt{2} &\cdots \\ 0 & 0 & 0 &\cdots \\ \vdots & \vdots & \vdots &\vdots \end{pmatrix} \end{equation*} \begin{equation*} a^{\dagger}=\begin{pmatrix} 0 & 0 & 0 & \cdots \\ \sqrt{1} & 0 & 0 &\cdots \\ 0 & \sqrt{2} & 0 &\cdots \\ \vdots & \vdots & \vdots &\vdots \end{pmatrix} \end{equation*} Certainly, $aa^{\dagger}$ and $a^{\dagger}a$ are diagonal.
So, my question is do $a$ and $a^{\dagger}$ have continuous spectra despite their simple form? (I guess so because $\hat{x}$ and $\hat{p}$ are linear combination of $a$ and $a^{\dagger}$. So if $\hat{x}$ and $\hat{p}$ have continuous spectral, so do $a$ and $a^\dagger$.)