Implement FDES
The FDES method of Van den Broek, Jiang, & Koch is a method for accelerating the computation of a scattering potential from a list of atom positions. For each atomic species present in a material the following steps are performed:
- For each atom position, the nearest four points on the grid are given values corresponding to their linear interpolation weights. This approximates a sum of delta functions at the atom positions.
- Perform an FFT.
- Multiply by the electron scattering factors (the FFT of the single-atom potential).
- Divide by a sinc function which is the FFT of the voxel-sized rectangle function. This has the effect of approximately undoing the blurring operation in step one.
- Perform an IFFT resulting in the potential.
This method is efficient compared to summing the full-resolution potentials of shifted atoms by Fourier shifting. Note that it's also not quite perfect due to the blurring/deblurring.
We need to implement this method as a way to compute high-resolution potentials for slabs. In this case we'll need to take in vector fields whose value at each position indicates an atom position relative to the center of the voxel, in units of voxels on the coarse grid. The output will be the potential on a higher-resolution grid with atoms positioned accordingly.
Our implementation needs the following properties:
- Operates in batches, where prepended dimensions are flattened then reshaped.
- Must work on CUDA and CPU.
- Differentiable.
- For integer shifts
Before merging we need tests for these.