  We present a plane wave implementation of the magnetic force theorem, which
provides a first principles framework for extracting exchange constants
parameterizing a classical Heisenberg model description of magnetic materials.
It is shown that the full microscopic exchange tensor may be expressed in terms
of the static Kohn-Sham susceptibility tensor and the exchange-correlation
magnetic field. This formulation allows one to define arbitrary magnetic sites
localized to predefined spatial regions, hence rendering the problem of finding
Heisenberg parameters independent of any orbital decomposition of the problem.
The susceptibility is calculated in a plane wave basis, which allows for
systematic convergence with respect to unoccupied bands and spatial
representation. We then apply the method to the well-studied problem of
calculating adiabatic spin wave spectra for bulk Fe, Co and Ni, finding good
agreement with previous calculations. In particular, we utilize the freedom of
defining magnetic sites to show that the calculated Heisenberg parameters are
robust towards changes in the definition of magnetic sites. This demonstrates
that the magnetic sites can be regarded as well-defined and thus asserts the
relevance of the Heisenberg model description despite the itinerant nature of
the magnetic state.
