  We study the effects of a truncated band structure on the linear and
nonlinear optical response of crystals using four methods. These are
constructed by (i) choosing either length or velocity gauge for the
perturbation and (ii) computing the current density either directly or via the
time-derivative of the polarization density. In the infinite band limit, the
results of all four methods are identical, but basis truncation breaks their
equivalence. In particular, certain response functions vanish identically and
unphysical low-frequency divergences are observed for few-band models in the
velocity gauge. Using hexagonal boron nitride (hBN) monolayer as a case study,
we analyze the problems associated with all methods and identify the optimal
one. Our results show that the length gauge calculations provide the fastest
convergence rates as well as the most accurate spectra for any basis size and,
moreover, that low-frequency divergences are eliminated.
