Skip to content

Optimization: use phase correction

Nicolas Tancogne-Dejean requested to merge use_phse_correction into main

Description

Use the phase correction combined with boundary conditions instead of the full phase application.

The idea is the same as already used for the exponential of the Hamiltonian. Instead of applying the phase e^{i(\mathbf{k}+1/c\mathbf{A}(t))\cdot\mathbf{r}} on np_part points after setting the periodic boundary conditions, we are here applying the phase only to the inner points (np first points). Then, at the same time we are copying the values for the values for applying periodic boundary conditions (for np+1 to np_part points), we also apply the "phase correction", i.e., e^{i(\mathbf{k}+1/c\mathbf{A}(t))\cdot\mathbf{T}}, the part of the phase due to the translation to the next unit cell. This makes that instead of touching first the points in [np+1:np_part] and then [1:np_part], we touch points [1:np] and then [np+1:np_part]. This way, all the points of the batches are only touched once.

News snippet

Code optimization.

Checklist

  • I have checked that my code follows the Octopus coding standards
  • I have added tests for all the new features added in this request.
Edited by Nicolas Tancogne-Dejean

Merge request reports