Nonlocal pseudopotentials and magnetic fields.

We show how to describe the coupling of electrons to nonuniform magnetic fields in the framework of the widely used norm-conserving pseudopotential approximation for electronic structure calculations. Our derivation applies to magnetic fields that are smooth on the scale of the core region. The method is validated by application to the calculation of the magnetic susceptibility of molecules within density functional theory (DFT) in the local density approximation. Our results are compared with high-quality all-electron DFT results obtained using Gaussian basis sets and another recently proposed pseudopotential formalism.