DFTK.jl icon indicating copy to clipboard operation
DFTK.jl copied to clipboard

Use time-reversal symmetry for orbitals at the gamma point

Open antoine-levitt opened this issue 3 years ago • 3 comments

There are two parts to this.

  1. Using TRS only to speed up FFTs, keeping the data representation the same

  2. Using a minimal compressed representation

The issue with 1 is we have functions like G_to_r!(f_real, f_fourier) where f_real is complex 3D, and f_fourier is complex 1D. This function puts f_fourier into f_real, and then in-place transforms it. If we want to keep this structure (and not have an extra array) we need to use a rfft!, which is not implemented directly by FFTW.jl. There's https://discourse.julialang.org/t/in-place-rfft-with-padded-arrays/3340/4 which suggests a way out. The key part is calling FFTW.rFFTWPlan to access the lower-level interface directly. Together with some low-level reinterpret business this should be OK (we should put these ad-hoc things in r_to_G!_lowlevel functions that would only be used by DftHamiltonian)

Then, for 2, the minimal compressed representation should be done in a way that preserves the inner product. That means sqrt(2) and DC component shenanigans. It also means that not every randn() is valid as an orbital (because the DC component should be real), so things like the randn in LOBPCG have to be modifed. The gain/annoyance to ratio is pretty low for this one, so we should probably don't do it.

antoine-levitt avatar Mar 04 '22 15:03 antoine-levitt

Related to #36 and #224

mfherbst avatar Mar 04 '22 15:03 mfherbst

I agree. 1 sounds useful, 2 not so much.

mfherbst avatar Mar 04 '22 16:03 mfherbst

Good point, I forgot I wrote a nice writeup in https://github.com/JuliaMolSim/DFTK.jl/issues/36. So yeah, let's definitely not do 2.

antoine-levitt avatar Mar 04 '22 16:03 antoine-levitt