In-plane magnetic field and Dirac operator Consider a 2D Dirac operator
$$H= p_x \sigma_x + p_y \sigma_y.$$
Now if I wanted to introduce a magnetic field in the $2D$ plane, I could do so by using a vector potential
$$ A= (0,0,B_xy-B_yx).$$
So in principle, we would have that $\operatorname{curl}(A)=(B_x,B_y,0)^t$ which is an in-plane field.
Now the question is: What is the right way to add this to the Dirac operator?
My first guess would have been
$$H_B = p_x\sigma_x+p_y \sigma_y +A_3 \sigma_3$$
where $A_3$ is the third component of the vector potential.
If this is not correct, then what would this Hamiltonian $H_B$ actually represent?
 A: For a particle on confined to a 2D plane, a magnetic field in that plane does not make sense. Such a field would try to force the particle off the plane. The only part of the magnetic field that can meaningfully interact with the particle is the vector component perpendicular to the plane. That way, the Lorentz force remains in the plane. In 2 dimensions, the magnetic field therefore does not appear as a vector quantity but as a scalar one. The magnetic field is naturally a type of thing called a bivector, in all dimensionalities. It is a quirk of 3D that it seems like a vector and a quirk of 2D that it seems like a scalar. But it isn't "really" either of those, which is why trying to restrict it to a plane like a normal 3D vector doesn't work.
In contrast, the vector potential $A$ is a true vector and when you restrict to 2D it should just lose a component. In doing so you (correctly!) lose the ability to make in-plane magnetic fields with it, since its curl is now just a scalar. You add it to the mechanical momentum to form the canonical momentum just as you normally would. $$H=(p_x+A_x)\sigma_x+(p_y+A_y)\sigma_y,$$ where the charge of the particle $q=1.$
