I found in this article a straightforward way to calculate the eigenvalues of the hamiltonian of an electron under the influence of an homogenous magnetic field (p. 5): http://www.phys.spbu.ru/content/File/Library/studentlectures/schlippe/qm07-06.pdf
$$\vec{B}=B\hat{z}$$
For this, they express the magnetic potential as $$\vec{A}=\frac{1}{2}B(-y,x,0)$$, which gives rise to the magnetic field using the well-known relation $\vec{\nabla}\times \vec{A}$. Using the Pauli hamiltonian, this leads to the eigenvalue equation:
$$H_0\Psi(r)+\frac{\mu_B B}{\hbar}(L_z+\sigma_z)\Psi(r)=E\Psi(r)$$
which allows a straightforward calculation of the energies.
However, I noticed that one can also calculate the same magnetic field using the potential $$\vec{A}=B(-y,0,0)$$, which is no surprise since the magnetic potential is not unique.
Nevertheless, when trying to perform the same calculations I do not find the same energies as before. In particular, I arrived at the following eigenvalue equation:
$$H_0\Psi(r)+\frac{\mu_B B}{\hbar}(L_z+\sigma_z+i\hbar x\partial_y)\Psi(r)=E\Psi(r)$$
That is, it only differs by an additive term $i\hbar^2x\partial_y$, which is weird since my intuition says I should find the same energies (since the magnetic field is exactly the same in both cases). Why does this happen? Or could I somehow reduce this equation to the previous one?
Additional information: to be more clear on how I arrived at the result, I started by calculating, for $\vec{A}=B(-y,0,0)$ and $e=-e$:
$$\vec{A}\cdot\vec{p}=A_xp_x=B(i\hbar y\partial_x)=B(L_z+i\hbar x\partial_y)$$
$$\vec{\nabla}\cdot\vec{A}=0$$
The hamiltonian is, in it's expanded form:
$$\hat{H}=H_0+\frac{1}{2m}(-e\vec{A}\cdot\vec{p}+i\hbar\vec{\nabla}\cdot\vec{A}+e^2\vec{A}^2)+e\phi+\mu_b \vec{\sigma}\cdot\vec{B}$$
Substituting, with $\phi=0$, and neglecting second order terms in $\vec{A}$:
$$\hat{H}=H_0+\frac{1}{2m}(eB(L_z+i\hbar x\partial_y))+e\phi+\mu_b \vec{\sigma}\cdot\vec{B}$$
$$\hat{H}=H_0+\frac{\mu_B B}{\hbar}(L_z+\sigma_z+i\hbar x\partial_y)$$
For stationary states, we can use the time-independent Schrodinger-equation:
$$\hat{H}\Psi(r)=E\Psi(r)$$
$$H_0\Psi(r)+\frac{\mu_B B}{\hbar}(L_z+\sigma_z+i\hbar x\partial_y)\Psi(r)=E\Psi(r)$$