When does an operator in Quantum Mechanics have a discrete spectrum? Say one has a classical Hamiltonian system with generalised coordinates $q$ and conjugate momenta $p$. After canonical quantization, promoting them to operators $\hat{q}, \hat{p}$, how can one determine if their eigenvalues are discrete or not ?
For example the eigenvalues for the position operator $\hat{x}$ are almost always taken to be continuous. But for $\hat{p}_x$ it depends on the phase space, if $x\in [a,b]$ then the eigenvalues are discrete, if $x\in \mathbb{R}$ they are not. So is there a general procedure (which also works for more abstract coordinates than e.g. position) by which one can get the appropriate Hilbert space and determine if the eigenvalues are continuous or not ?
I assume one needs some basic understanding of mathematical quantum mechanics/ functional analysis.
 A: Intuitively, you can see that the spectrum is continuous using the right conjugations. From $[x,p]=i$, you can formally deduce from solving Heisenberg's equations:
$$
e^{iup}xe^{-iup} = x+u\\
e^{-itx}pe^{ivx} = p+v
$$
with $u,v$ real parameters. This means that if you start with an "eigenvector" of $x$ (resp. $p$), applying the unitary transformation $e^{-iup}$ (resp. $e^{ivp}$) gives you a new "eigenvector" of shifted value $u$ (resp. $v$) which can be taken continuously, hence the continuous spectrum.
More generally, this shows that the relevant quantities are the exponentiated observables. This is made rigorous by the Stone-von Neumann theorem. While it is simpler for physicist to see quantisation as the anti commutation rule $[x,p]=i$, it is mathematically more precise to think in terms its exponentiated version in terms of the exponentiated operators. This different angles solves the tricky domain issues that are hastily swept under the rug in physics.
This explains the apparent contradiction that you pointed out when $x$ or $p$ is compactly supported/discrete. This is because in these cases, you don't have the full one parameter groups for each operator, and is how you rigorously define these representations. However, the trick out conjugation still applies and is how you can find the spectrum of both operators.
Hope this helps.
