Suppose we have an electron, mass $m$, charge $-e$, moving in a plane perpendicular to a uniform magnetic field $\vec{B}=(0,0,B)$. Let $\vec{x}=(x_1,x_2,0)$ be its position and $P_i,X_i$ be the position and momentum operators.
The electron has Hamiltonian
$H=\frac{1}{2m}((P_1-\frac{1}{2}eB X_2)^2+(P_2+\frac{1}{2}eBX_1)^2)$
How can I show that this is analogous to the one dimensional harmonic oscillator and then use this fact to describe its energy levels?
I have attempted to expand out the Hamiltonian and found:
$(\frac{P^2_1}{2m}+ \frac{1}{2} m (\frac{eB}{2m}))^2X^2_1+(\frac{P^2_2}{2m}+\frac{1}{2}m(\frac{eB}{2m})^2X^2_2+\frac{eB}{2m}(X_1P_2-P_1X_2)$
This looks very similar to the 2D harmonic oscillator, if anyone can help/point out where I am wrong I'd much appreciate it!
Denoting $P_1-\frac12eBX_2$ by $O_1$ and $P_2+\frac12eBX_1$ by $O_2$, we have
$$ [O_1,O_2]=\left[P_1-\frac12eBX_2,P_2+\frac12eBX_1\right]=\left[P_1,\frac12eBX_1\right]+\left[P_2,\frac12eBX_2\right]=\mathrm i\hbar eB\;. $$
Thus $O_1$ and $O_2$ have the canonical commutation relation, up to a constant factor $eB$, so you can treat the Hamiltonian $H=(O_1^2+O_2^2)/(2m)$ in analogy to the Hamiltonian $H=(X^2+P^2)/2$.