Skip to content

Rework of charge-output options (Mulliken, Hirshfeld, Voronoi)

Nick R. Papior requested to merge npapior/siesta:partial-charges-options into dev

upgraded charge-output options

The cluttering of many seemingly different options was trouble-some, and confusing.

The old flags where:

WriteMullikenPop <integer>
MullikenInSCF <bool>

WriteHirshfeldPop <bool>
WriteVoronoiPop <bool>
PartialChargesAtEveryGeometry <bool>
PartialChargesAtEverySCFStep <bool>

SpinINSCF <bool>

All of these are now gathered under a common terminology:

Charge.<method> <string>
Charge.<method>.Format <method dependent variable>

The Charge.<method> is given a string saying when it should write out. The format is what specifies how it should write things, so for Charge.Mulliken.Format it is equivalent to WriteMullikenPop.

For Charge.<method> <string> one can now contain certain flags:

  • init: for writing out the charge method at the initialization step
  • scf: for every scf step (for Mulliken before mixing, using DM_out)
  • scf-after-mix: for every scf step, after mixing (using DM_mix) (for Voronoi and Hirshfeld these two are equivalent)
  • geometry: just after SCF completes for a geometry
  • end: at the siesta_analysis call
  • none (default): for not calculating it.

Combinations is also possible, e.g.:

   Charge.Voronoi scf+end+init
   Charge.Hirshfeld end

This change changes quite a bit of things, but it gives a great deal of flexibility, which one could argue is too much. However, if we will add other charge-methods, a more stringent way of handling the options will be beneficial, since the logic is all there.

For instance, currently when requesting Mulliken atomic populations, it will print-out a table similar to the Voronoi and Hirshfeld (I have to double check the values here). This may be very beneficial.

I have also moved siesta_analysis to f90 format, and ran it through fprettify (mainly for testing purposes).

The output of the atomic populations is changed to something like this:

Mulliken Atomic Populations:
Atom #    delta [q] valence [e]           S          Sx          Sy          Sz  Species
     1     0.093470    7.906530    3.089994    0.162048    0.000000    3.085742  fe_nc
     2    -0.186941    8.186941    1.355661    1.355661    0.000000    0.000000  fe_nc
     3     0.093471    7.906529    3.089994    0.162048   -0.000000   -3.085742  fe_nc
-------------------------------------------------------------------------------
 Total                             1.679757    1.679757    0.000000   -0.000000

the same for Hirshfeld and Voronoi, please note the table header names. I think it was a bit misleading previously, this should be clearer on what it means. Let me know your thoughts!

Details

Please detail what this MR introduces

  • Describe in details what this MR does? (link to the issue by writing # here)
  • Does this MR change the behaviour of any fdf-flags? If so, ensure this is documented in the manual
  • If new fdf-flags are added, please add thorough descriptions to the manual
  • add a summary sentence in the ReleaseNotes.md file
  • if this breaks compatibility, add mentions to the Docs/compatibility.tex

Why is it needed

Authors

Edited by Nick R. Papior

Merge request reports

Loading