Skip to content

Fixes the Ewald summation

Nicolas Tancogne-Dejean requested to merge fix_ewald_summation into main

Description

The cutoff for the G-vector summation was done in reduced coordinates which is only valid for cubic materials with orthogonal lattice vectors. This does not affect the energy much but strongly affect vanishing components of the stress tensor for non-cubic systems, for instance.

As an example, the code before produced for the following ion-ion stress tensor for bulk Si

Ion-ion stress tensor [H/b^3] =
   T_{ij}                   1                 2                 3
        1    -9.454361775E-03   5.123231542E-09   5.123231541E-09
        2     5.123231542E-09  -9.454361775E-03   5.123231541E-09
        3     5.123231541E-09   5.123231541E-09 -9.454361775E-03

and now it gives

Ion-ion stress tensor [H/b^3] =
   T_{ij}                   1                 2                 3
        1    -9.454361775E-03   1.887181689E-18   2.237575372E-18
        2     1.887181666E-18  -9.454361775E-03  -3.326203247E-20
        3     2.237572423E-18  -3.326203211E-20  -9.454361775E-03

Results are now identical to Abinit for the first 10 digits at least (all the one printed by Octopus).

News snippet

Fixes the Ewald summation for forces/stress.

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 Alex Buccheri

Merge request reports