There is some gauge freedom in the choice of vector potential for a given magnetic field. The Hamiltonian is gauge invariant, which means that adding the gradient of a scalar field to A changes the overall phase of the wave function by an amount corresponding to the scalar field. But physical properties are not influenced by the specific choice of gauge.