CASINO/PWSCF interface error

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
Post Reply
Eric_Fadel
Posts: 2
Joined: Thu Mar 10, 2016 11:00 am

CASINO/PWSCF interface error

Post by Eric_Fadel »

Dear all,

I am a new CASINO user. I have a question related to the CASINO/PWSCF interface. I have seen this issue raised in a previous post in 2014 but it seemed the problem was not solved, so I thought I could post it again. I have been trying to use PWSCF with DFT+U to obtain my trial wavefunction. I have found that the scf (I use QE 5.2.1 with pw.x -pw2casino) run behaves properly until the routine pw2casino kicks in and gives the error : "Error in routine pw2casino (1): Mismatch in computed energy" (along with the line "Etot: -52.37908106 Ry from PWscf vs -52.54507845 Ry from pw2casino!"). To make sure it was not a problem specific to my simulated geometry, I ran it for a single Co atom in a 10Ax10Ax10A unit cell which gave the same error. In the code of the routine, it seems that the first thing it does is calculate the energy. My question would be : is the easiest solution to this problem simply to comment this part of the code? Or is the DFT-computed energy necessary for the conversion into bwfn or pwfn format? I have tried to turn off the blip conversion, but the error still occured.

Thank you very much for your help.

P.S. I would also like to mention that I really appreciated the ease of installation of CASINO, the developers have done a wonderful job on it.

Eric Fadel
PhD student
Department of Materials Science and Engineering
MIT
Attachments
Archive.zip
Input and output of the pw.x run
(4.32 KiB) Downloaded 672 times
Dario_Alfe
Posts: 10
Joined: Wed Jan 15, 2014 12:17 am
Location: University College, London
Contact:

Re: CASINO/PWSCF interface error

Post by Dario_Alfe »

Dear Eric,
The DFT energy is not necessary for the generation of the pwfn/bwfn files, however it may point to some inconsistency in the way the routine is constructing the wave functions which are then written in these files.
You may try to turn off the error message, but best would be to understand why this error is occurring, and/or perhaps reporting it to the pwscf developers (it may well be that bits
to re-compute the DFT+U energy are not known to the pw2casino routine).
Regards,
Dario Alfe`
Katharina Doblhoff
Posts: 84
Joined: Tue Jun 17, 2014 6:50 am

Re: CASINO/PWSCF interface error

Post by Katharina Doblhoff »

Dear Eric,
I had a quick look at the source. First of all, this errorcatch was only added some time after 5.1 (but beware: There was a different issue in the 5.1 version, which is gone in 5.3 (I checked), so do not revert to 5.1!). In any case, the error is to be expected the way it is coded right now, since the +U is not properly taken into account. So one way around would be to comment the error catch (which is of course ugly - someone was nice enough to put it in...), or you can simply add the +U contribution. It is actually there already, it is just not added to the Etot_ quantity. So try the following (I did not check if this actually works. Please let me know if it does afterwards!)

Change line 23 from

Code: Select all

USE ldaU, ONLY : eth
to

Code: Select all

USE ldaU, ONLY : eth, lda_plus_u
Add after line 459 (the one where Etot_ is computed)

Code: Select all

 IF( lda_plus_u ) Etot_ = Etot_ + eth
I guess that should do the trick. Have a try and let me know!
Katharina
Eric_Fadel
Posts: 2
Joined: Thu Mar 10, 2016 11:00 am

Re: CASINO/PWSCF interface error

Post by Eric_Fadel »

Dear Dario, Katharina,

Thank you very much for your answers. The fix you suggested works! Thanks a lot.

Eric
Post Reply