We have implemented the projection technique of Sanchez-Portal et. al. . The eigenstates resulting from the PW calculations are projected onto a localised basis set . In our case, the natural choice of basis set is that of atomic pseudo-orbitals generated from the pseudopotentials used in the calculation. However, care must be taken when performing the projection because this basis set is neither orthonormal nor complete.
The overlap matrix of the localised basis set, , is defined :
We compute these overlaps in reciprocal space as the imposition of periodic boundary conditions implies that the orbitals need only be evaluated on a discrete reciprocal space grid. The overlaps between orbitals on different atomic sites may be calculated on the same grid with the application of a phase factor. The representations of the atomic pseudo-orbitals on the discrete reciprocal space grid may be calculated by Fourier transformation of the real space wavefunctions generated during construction of the pseudopotentials, or can be generated using the CASTEP code.
The overlap between the plane wave states and the basis functions,
were also calculated in reciprocal space as this is the natural representation of the plane wave states.
The quality of the projection may be assessed by the calculation of a spilling parameter,
where is the number of PW eigenstates, the weights associated with the calculated points in the Brillouin zone and is the projection operator of Bloch functions with wave vector generated by the atomic basis.
where are the duals of the atomic basis states such that
The spilling parameter varies between one in the case that the atomic basis set is orthogonal to the PW eigenstates and zero when the projected wavefunctions perfectly represent the PW states. Unlike the procedure of Sanchez-Portal et al.  we have not scaled the basis functions in order to optimise . This gives spilling parameters in the region of which were found to be adequate for our purposes.
The density operator may be defined,
where are the occupancies of the PW states (=1,2), are the projected eigenstates and are the duals of these states. From this, the density matrix for the atomic basis set may be calculated as follows:
We find that may be calculated in a time proportional to the cube of the system size, the same order of scaling as the original PW calculations.
The density matrix and the overlap matrix are sufficient to perform population analysis of the electronic distribution. In Mulliken analysis  the charge associated with a given atom A is given by
and the overlap population between two atoms A and B is
Similarly in Löwdin analysis  these quantities are given by
In equations (10) and (11) the matrix is calculated as a Taylor expansion of where .