Comparing Hamiltonians - Quantum harmonic oscillator For standard 1D quantum harmonic oscillator we have $H\psi = E_n\psi$ with $E=(n+\frac{1}{2})\hbar\omega$ and $H = \frac{P^2}{2m} + \frac{1}{2}m\omega^2 X^2$ where $X$ is position operator and $P$ is momentum operator.
Now consider finding the energy of $H = \frac{1}{2m}((P_1+\frac{1}{2}eBX_2)^2 + (P_2-\frac{1}{2}eBX_1)^2)$ for some magnetic field B
Letting $A = P_1+\frac{1}{2}eBX_2$
and    $C = P_2-\frac{1}{2}eBX_1$
we could work this out and compare to our original H for 1D oscillator.
I was confused at this point since the original hamiltonian has momentum and position operators separate but in the compared hamiltonian we will get something like  $H = \frac{A^2}{2m} + \frac{1}{2}m\omega^2 C^2$ but A and C are combinations of position and momentum operators.
My question: How are we able to compare these 2 Hamiltonians to quote the standard result from 1d oscillator energy since the compared hamiltonian is made up of combinations of momentum and position operators
edit: im not looking for computations to solve this, since computationally I am fine, its the understanding of why we can compare that I am confused about
 A: Most good texts detail the phase-space symmetry underlying Landau quantization, and reducing phase space from 4D to 2D, as you noted. It's actually a classical structure (the i of commutators is not crucial in the canonical transformation). I am not sure you seek 4D visualization, so the corresponding canonical rotations will present algebraically, here.
Firstly, nondimensionalize, as all texts should do routinely,
setting $\hbar,\omega, m, eB$ equal to 1, and reinstatable through dimensional analysis uniquely in the end, if desired (a bad idea).
You then have
$$
2H= (P_1+X_2/2)^2 + (P_2-X_1/2  )^2
$$
The following obvious rotation is a canonical transformation, that is, it preserves the original commutators,
$$
X_3=A=P_1+X_2/2, ~~~ P_3=C= P_2-X_1/2,  ~~~~ [X_3,P_3]=i, \\
P_4=D= P_1-X_2/2, ~~~ X_4= F=P_2+ X_1/2, ~~~~ [X_4,P_4]=i, \\
[A,D]=[A,F]=[C,D]=[C,F]=0.
$$
But with a flip from your expression, the hamiltonian reduces to 2D,
$$
2H= P_3^2+X_3^2,
$$
that is, the coordinates $X_4,P_4$ drop out of it, and, of course, commute with it, so they are constants of the motion: conserved charges. The extra phase-space dimensions indexed by 4 drop out of the problem, and constitute a decoupled hamiltonian piece $P_4^2+X_4^2$, a constant in an independent ector/world; however, upon changing into the 1,2 original variables, they are involved in the evident rotational symmetry of these  variables into each other.
So, your hamiltonian has the  familiar 1D oscillator spectrum, $E=n+1/2$.
The group of these two generators is, naturally, the Heisenberg group. You may observe the trivial or else translation action of these symmetry transformations on your original variables, e.g.,
$$
e^{iaX_4} X_1 e^{-iaX_4} = e^{iaX_4} (X_4-P_3) e^{-iaX_4}=X_1 ,\\
e^{iaX_4} P_1 e^{-iaX_4} = e^{iaX_4} {P_4+X_3\over 2} e^{-iaX_4}= P_1 -a/2,\\
e^{iaX_4} X_2 e^{-iaX_4} =  e^{iaX_4}  (X_3-P_4)  e^{-iaX_4}= X_2+a,\\ 
e^{iaX_4} P_2 e^{-iaX_4} = e^{iaX_4} {X_4+P_3\over 2} e^{-iaX_4}=P_2, 
$$
etc, mutatis mutandis for $P_4$...

*

*Culture This is a superintegrable system, that is it has the maximal symmetry allowed without restricting motion. Classically, you see that each conserved quantity, so $H,X_4,P_4$ here, represents a hypersurface in phase space. The three here intersect on a line in 4D, the unique trajectory of the oscillator.

