GPU implementation: The GPU implementation makes heavy use of C++ templates. The template parameters are the precision (float or double) as well as the integer parameters k, mx, my, mz and the cutoff power q defining the type of the polarization operator. Being a real number, the cutoff exponent α cannot be used as a template parameter and has to be passed as a function argument. Optimized instances of the templated functions are compiled for each combination of the template parameters.