Skip to content

Fixes the FFT such that they use closed G-shells

Nicolas Tancogne-Dejean requested to merge fix_ffts into main

Description

The code now computes the cutoff energy given by the sphere enclosed inside the FFT box. This is used to truncate the Coulomb kernel (only in 3D at the moment) and use only cloed shells of G vectors. The nonlocal part of the forces is also rewritten in a simpler and much more efficient way.

Overall, this drastically improves the quality of the forces for bulk silicon, see below

  Direct gap at ik=    1 of  0.0937 H                                              |  Direct gap at ik=    1 of  0.0937 H
  Indirect gap between ik=    1 and ik=    8 of  0.0213 H                          |  Indirect gap between ik=    1 and ik=    8 of  0.0213 H
                                                                                   |  
  Energy [H]:                                                                      |  Energy [H]:
        Total       =        -7.92790149                                           |        Total       =        -7.92787463                                                                 
        Free        =        -7.92790149                                           |        Free        =        -7.92787463                                                                 
        -----------                                                                |        -----------
        Ion-ion     =        -7.85780080                                           |        Ion-ion     =        -7.85780080
        Eigenvalues =        -0.25310542                                           |        Eigenvalues =        -0.25309118                                                                 
        Hartree     =         0.54951020                                           |        Hartree     =         0.54949671                                                                 
        Int[n*v_xc] =        -3.14231074                                           |        Int[n*v_xc] =        -3.14230711                                                                 
        Exchange    =        -2.03474705                                           |        Exchange    =        -2.03474445                                                                 
        Correlation =        -0.37504877                                           |        Correlation =        -0.37504860                                                                 
        vanderWaals =         0.00000000                                           |        vanderWaals =         0.00000000
        Delta XC    =         0.00000000                                           |        Delta XC    =         0.00000000
        Entropy     =         0.00000000                                           |        Entropy     =         0.00000000
        -TS         =        -0.00000000                                           |        -TS         =        -0.00000000
        Photon ex.  =         0.00000000                                           |        Photon ex.  =         0.00000000
        Kinetic     =         3.08068593                                           |        Kinetic     =         3.08066297                                                                 
        External    =        -1.29050102                                           |        External    =        -1.29044045                                                                 
        Non-local   =        -0.24152939                                           |        Non-local   =        -0.24155273                                                                 
        Int[n*v_E]  =         0.00000000                                           |        Int[n*v_E]  =         0.00000000
                                                                                   |  
  Convergence:                                                                     |  Convergence:
        abs_energy =  3.55271368E-15 ( 0.00000000E+00) [H]                         |        abs_energy =  7.99360578E-15 ( 0.00000000E+00) [H]                                               
        rel_energy =  4.48127879E-16 ( 0.00000000E+00)                             |        rel_energy =  1.00829114E-15 ( 0.00000000E+00)                                                   
        abs_dens =  1.58478917E-09 ( 0.00000000E+00)                               |        abs_dens =  1.00664090E-09 ( 0.00000000E+00)                                                     
        rel_dens =  1.98098646E-10 ( 1.00000000E-09)                               |        rel_dens =  1.25830113E-10 ( 1.00000000E-09)                                                     
        abs_evsum =  3.25343419E-10 ( 0.00000000E+00) [H]                          |        abs_evsum =  3.21785376E-10 ( 0.00000000E+00) [H]                                                
        rel_evsum =  1.28540676E-09 ( 0.00000000E+00)                              |        rel_evsum =  1.27142073E-09 ( 0.00000000E+00)                                                    
                                                                                   |  
  Forces on the ions [H/b]                                                         |  Forces on the ions [H/b]
   Ion                        x              y              z                      |   Ion                        x              y              z
     1        Si   8.54942496E-09  -1.83731309E-09   4.11668885E-09                |     1        Si  -1.18389604E-11  -1.18390106E-11  -1.18387738E-11                                      
     2        Si  -6.26670357E-09   3.82994361E-09  -4.26367918E-09                |     2        Si   1.18407539E-11   1.18408071E-11   1.18405616E-11                                      
   ----------------------------------------------------------                      |   ----------------------------------------------------------
   Max abs force   8.54942496E-09   3.82994361E-09   4.26367918E-09                |   Max abs force   1.18407539E-11   1.18408071E-11   1.18405616E-11                                      
     Total force   2.28272139E-09   1.99263052E-09  -1.46990330E-10                |     Total force   1.79344627E-15   1.79649172E-15   1.78782301E-15                                      
    Total torque  -2.06387381E-08  -5.10771219E-09   2.57464503E-08                |    Total torque  -6.26024399E-16   4.90228643E-16   1.35795756E-16                                      
           

Finally, this merge request fixes a bug in the calculation of the gradient on GPUs for non-orthogonal cells.

News snippet

Improve the quality of forces and fixes a bug for the calculation of the gradient on GPUs for non-orthogonal cells.

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