Hi there,
I start to use kwant not long ago. I am still following the instruction to learn the basic usage of the code. I have a simple code in hand to handle the square lattices with some given potential of certain form. I am thinking to add the constant magnetic field along z direction. In my text, it is said that such field could be described by vector potential such that the potential could be modified as alpha*(x**2 + y**2) in which alpha is proportional to the magnitude of the field. I add this to each lattice site but then it diverges in solution. I saw other material online and it said the magnetic field could be added by modifying the hopping phase. I don't quite follow that. Any suggestion is welcomed. Thanks.