Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scf total energy when U+V are non-zero is different between QE and QE+SIRIUS #774

Open
gsavva opened this issue Oct 19, 2022 · 8 comments
Open

Comments

@gsavva
Copy link
Collaborator

gsavva commented Oct 19, 2022

The total energies calculated using QE and QE-SIRIUS when the Hubbard U & V values are non-zero are different:

QE        !    total energy              =    -373.24928416 Ry
QE-SIRIUS !    total energy              =    -370.86624286 Ry

I'm using the input file of example10 (LiCoO2, non-magnetic insulator) as found in q-e/HP/examples https://gitlab.com/QEF/q-e/-/tree/develop/HP/examples.

The Hubbard U & V parameters are both changed from 0.0001 to 3.0

HUBBARD {ortho-atomic}
U Co-3d 3.0
V Co-3d O-2p 1 2 3.0

The input file, pseudopotentials, execution script and output files are available here: non_zero_U_V.zip

The version of QE used is 7.1
QE-SIRIUS was installed via spack so the branch used is q-e-sirius@develop-ristretto and sirius@develop.
The output files contain the exact commit hashes of the executables used.

For comparison, if the U & V values are not changed and thus example10 runs as provided (U, V = 0.0001), then QE and QE-SIRIUS calculate total energies as below:

QE        !    total energy              =    -373.36904960 Ry
QE-SIRIUS !    total energy              =    -373.36894085 Ry
@toxa81
Copy link
Collaborator

toxa81 commented Oct 20, 2022

This small difference is ok. The GGA XC implementation is slighlty different between QE and LibXC. Whas is important is that forces and stress are similar.

@gsavva
Copy link
Collaborator Author

gsavva commented Oct 21, 2022

I initially started this comparison testing of forces & stresses (QE vs QE_SIRIUS) using a non-zero Hubbard U for the Hubbard atoms to evaluate (a) the total forces and (b) the Hubbard contribution to forces.
However, for some systems I had convergence issues (already communicated to @simonpintarelli ) and the total energies were different (as in the example reported above).
I'm now working on forces & stresses comparison without changing the U value (set to 0.0001 in the examples)

@gsavva
Copy link
Collaborator Author

gsavva commented Nov 22, 2022

Updating the issue with more results for different values of Hubbard U and V.
Using example10 as above, found in q-e/HP/examples.

U = 1e-4
V = 1e-4
QE     !    total energy              =    -373.36904960 Ry
SIRIUS !    total energy              =    -373.36894085 Ry

U = 3.0
V = 3.0
QE     !    total energy              =    -373.24928416 Ry
SIRIUS !    total energy              =    -370.86624283 Ry

U = 6.0
V = 0.0001
QE     !    total energy              =    -373.13921250 Ry
SIRIUS !    total energy              =    -368.92175896 Ry

U = 6.5
V = 0.0001
QE     !    total energy              =    -373.12143594 Ry
SIRIUS !    total energy              =    -368.61994388 Ry

U = 6.5
V = 0.7
QE     !    total energy              =    -373.12144331 Ry
SIRIUS !    total energy              =    -368.61994274 Ry
 

@mtaillefumier
Copy link
Collaborator

A factor 2 was missing in the calculation of the kinetic energy (the one-electron contribution). q-e-sirius now works fine for U \neq 0 V = 0.
U+V is still giving a different total energy though.

@mtaillefumier
Copy link
Collaborator

Should be fixed by PR #788. The mistake was a factor 2.0 during the calculation of the hubbard U contribution to the hubbard potential. The generalized version of Hubbard (reduce to dudarev version) is on by default.

@gsavva
Copy link
Collaborator Author

gsavva commented Nov 28, 2022

Testing results (@mtaillefumier):

HP/examples/example10 (LiCoO2, non-magnetic insulator): OK

U = 6.5
V = 0.7
QE     !    total energy              =    -373.12144331 Ry
SIRIUS !    total energy              =    -373.12142824 Ry

HP/examples/example01 (same as example10, without V): OK

U = 7.8
QE     !    total energy              =    -373.07581518 Ry
SIRIUS !    total energy              =    -373.07580009 Ry

HP/examples/example06 (Ni2MnGa, ferromagnetic metal): OK

U Mn-3d 5.0
U Ni-3d 8.3
QE     !    total energy              =    -585.95912167 Ry
SIRIUS !    total energy              =    -585.95908712 Ry
QE          total magnetization       =     5.18 Bohr mag/cell
SIRIUS      total magnetization       =    17.50 Bohr mag/cell

**Note that the energies were correct even before the fix (#788). The difference in magnetization is discussed in #786
HP/examples/example08 (NiO2, 2D system, nonmagnetic insulator): OK

U Ni-3d 8.65
QE     !    total energy              =    -167.47501933 Ry
SIRIUS !    total energy              =    -167.47572923 Ry

@toxa81
Copy link
Collaborator

toxa81 commented Jun 17, 2024

New round of tests should be done with electronic-structure/q-e-sirius#60

@gsavva
Copy link
Collaborator Author

gsavva commented Jun 17, 2024

@toxa81 I'm checking this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants