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

Different single-point GFN-FF energy with and without argument --verbose #835

Closed
dargen3 opened this issue Jul 21, 2023 · 9 comments · Fixed by #836
Closed

Different single-point GFN-FF energy with and without argument --verbose #835

dargen3 opened this issue Jul 21, 2023 · 9 comments · Fixed by #836
Labels
bug Something isn't working method: GFN-FF Related to the GFN-FF method

Comments

@dargen3
Copy link

dargen3 commented Jul 21, 2023

Hello,
I'd like to report a potential bug. TOTAL ENERGY for the same structure differs with and without the --verbose flag. The version of xtb is 6.6.0.

To Reproduce

P85371.zip

xtb P85371.pdb --gfnff --alpb water
results in TOTAL ENERGY = -35.183991089038 Eh

xtb P85371.pdb --gfnff --alpb water --verbose
results in TOTAL ENERGY = -35.353063192998 Eh

In both cases, I also get the warning but without an idea, of how to handle it and whether is it related to the error described above.
[WARNING] Runtime exception occurred
-1- gfnff_setup: Could not read topology file.

If the error is on my part, please guide me.
Thank you,
Ondřej

@dargen3 dargen3 added the unconfirmed This report has not yet been confirmed by the developers label Jul 21, 2023
@Albkat Albkat added bug Something isn't working and removed unconfirmed This report has not yet been confirmed by the developers labels Jul 21, 2023
@Albkat
Copy link
Contributor

Albkat commented Jul 21, 2023

Hi, thank you for reporting this.
It seems to be a bug.

@dargen3
Copy link
Author

dargen3 commented Jul 21, 2023

Thank you for your prompt reply. Do you have any idea which energy is correct, please?

@Albkat
Copy link
Contributor

Albkat commented Jul 21, 2023

So the energy that comes from the SCC routine: TOTAL ENERGY = -35.183991089038 Eh, which is most likely the right energy.
But I recommend waiting until this issue is debugged.

@dargen3
Copy link
Author

dargen3 commented Jul 21, 2023

Hello, i have bad news. The bug is also in the 6.5.1 version. And it affects also structure optimization.

xtb P85371.pdb --gfnff --alpb water --opt
xtb P85371.pdb --gfnff --alpb water --opt --verbose
optimized_structures.zip

I know that it is pretty difficult to say, but is there any estimation, of when this issue can be debugged, please? Week, month, half of the year? I'm sorry to be in such a hurry, but this is quite critical for me and I have to decide what to do next. I'd try to look into it myself, but I'm completely out of Fortran.

@MtoLStoN
Copy link
Member

MtoLStoN commented Jul 21, 2023

Thank you for reporting this Issue. The difference in the output stems from here:

xtb/src/gfnff/gfnff_ini.f90

Lines 918 to 931 in 27203a8

if(pr)then
write(env%unit,'(''Hueckel system :'',i3,'' charge : '',i3,'' ndim/Nel :'',2i5, &
& 3x, ''eps(HOMO/LUMO)'',2f12.6)')pis,ipis(pis),npi,nelpi,pisip(pis),pisea(pis)
if(pisip(pis).gt.0.40) then
write(env%unit,*)'WARNING: probably wrong pi occupation. Second attempt with Nel=Nel-1!'
do i=1,mol%n
if(piadr4(i).ne.0) write(env%unit,*) 'at,nb,topo%hyb,Npiel:', i,mol%sym(i),topo%nb(20,i),topo%hyb(i),piel(i)
enddo
nelpi=nelpi-1
Api = Apisave
call gfnffqmsolve(.false.,Api,S,.false.,300.0d0,npi,0,nelpi,dum,occ,eps) !diagonalize
call PREIG(6,occ,1.0d0,eps,1,npi)
endif
endif

These routines are only activated when pr is set to true, which is essentially the same as setting the verbosity level with set%verbose. If these lines are commented out, the energy output will be the same whether or not the --verbose option is used, as it should be.

At the moment, I am not entirely confident with the force field code and cannot immediately identify the error (and it's late right now). I am also moderately confused that there seems to be a diagonalization that is only invoked with a verbosity option. @Thomas3R, do you have any idea?

@MtoLStoN MtoLStoN added the method: GFN-FF Related to the GFN-FF method label Jul 21, 2023
@MtoLStoN
Copy link
Member

MtoLStoN commented Jul 26, 2023

So, I just checked with @sespic, and this actually seems to be a bug, that thankfully only hits a few specific pi systems. I will prepare a PR, that fixes this.

@dargen3 To answer your question, the energies and geometries, that are obtained with the --verbose should be the ones you would obtain without this bug. There seems to be some confusion here, sorry for that - we are still investigating.

@dargen3
Copy link
Author

dargen3 commented Jul 26, 2023

Thank you for the message and for working on the bug!

@dargen3
Copy link
Author

dargen3 commented Aug 1, 2023

Hello, thank you for resolving the error. I want to ask, how do I calculate for the correct energy? With or without the --verbose argument? Or are both options affected and I have to wait for the next version?

@MtoLStoN
Copy link
Member

MtoLStoN commented Aug 1, 2023

Hi @dargen3,
Both versions were affected. The error was fixed in #836. You can use xTB 6.6.1, which was released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working method: GFN-FF Related to the GFN-FF method
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants