Quantum Espresso PBE0 KS states for BerkeleyGW

600 views
Skip to first unread message

729st...@gmail.com

unread,
Jun 12, 2020, 1:13:07 PM6/12/20
to BerkeleyGW Help

To whom it my concern,

I would like to know definitively whether one can run berkeleyGW with PBE0 Kohn-Sham states from Quantum Espresso. 

Through my time on the forum and manual it seems heavily implied that one can. Although I have successfully run a calculation to completion with no error message the result looks suspicious to me and suggests either that there is an error on my part of how I'm conducting the calculation, or there is a subtle issue in some step of the workflow that doesn't result in an error message. 

I've have the results of the complete calculation available via this link https://drive.google.com/file/d/1bpq4BHl6u0P_OJDV4Z9kuV-UrsXewBGF/view?usp=drive_web

It is certainly not a converged calculation (k grid = 2x2x2 and bands = 28) but this was just to test that the calculation can be run to completion. I will use language used in the tutorial page  https://berkeleygw.org/tutorial/ when referring to details of the calculation to make things easier to communicate. 

why I am suspicious of the attached PBE0 result
Running PBE+G0W0, the gap goes from 1.15 eV to 3.78 eV
Running PBE0+G0W0, the gap goes from 4.048 eV to 12.83 eV
The correction of PBE0+GW seems very large. But it is this fact along with the differences of how the PBE+G0W0 vs PBE0+G0W0 were run that make me suspicious that something is wrong. 

short version of list of difference between calculation workflows :

1) I am not building epsmat.h5, eps0mat.h5 when performing PBE0+G0W0 
2) I do not run a non-scf calculation to save the wave function PBE0+G0W0, and instead save at the end of the scf calculation

detailed version of list of difference between calculation workflows : 
1) For PBE + G0W0 I use the normal objects (WFN, WFNq, WFN_inner, vxc.dat, RHO, epsmat.h5, eps0mat.h5)  to calculate sigma and see a shift of the gap from 1.15 eV to 3.78 eV which is reasonable. 

Now for how PBE0 was calculated ...
Ver. 2.1 of the manual states ...
For Hartree-Fock/hybrid functional, no epsmat/eps0mat files are needed. Instead provide a list of q-points and the grid size. The list of q-points should not be reduced with time reversal symmetry - because BerkeleyGW never uses time reversal symmetry to unfold the q/k-points. Instead, inversion symmetry does the job in the real version of the code. You can generate this list with kgrid.x: just set the shifts to zero and use same grid numbers as for WFN_inner.
http://manual.berkeleygw.org/2.1/sigma-keywords/#options-for-hartree-fock-hybrid-calculations

From reading this I assume if I can calculate VXC object (the local portion of the exchange-corrlelation potential matrix) and then use the  bare_exchange_fraction keyword (to recover he nonlocal portion of the exchange-corrlelation potential matrix). I should only need the following objects ( WFN_inner, VXC, RHO ) as input for the sigma calculation. 

2) For the creation of ( WFN_inner, VXC, RHO ) typically a non-scf calculation is done to save the wave function. I have learned through forums for Quanum espresso / BerkeleyGW that running a non-scf calculation in quantum espresso for hybrid functionals is not an available feature. I found a work around by simply including all bands I ultimately want in the scf-calculation and saving the needed objects at the end of this step. 

With the provided information would an expert conclude something is wrong?  I'm afraid of sinking a large amount of computing time trying to run calculations that ultimately might have issues

Thank you for your help
sergio

Zhenglu Li

unread,
Jun 12, 2020, 1:49:46 PM6/12/20
to 729st...@gmail.com, BerkeleyGW Help
Dear Sergio,

All you described are accurate and look nice.  Except for citing the "For Hartree-Fock/hybrid functional, no epsmat/eps0mat files are needed." which I don't understand the manual (we need internal discussion).  This description appears as if you want to use BerkeleyGW to give you some HF or Hybrid results, instead of using them as the starting point for GW, because for GW you must use epsmat and eps0mat in order to get W.

Could you try the following:
1) Perform a standard calculation (with PBE0 starting point, VXC, WFN, RHO) and DO use epsmat and eps0mat in Sigma.  You can use the epsmat and eps0mat from your PBE calculation as a test, and if it works you can re-generate them using PBE0 wavefunctions.
2) Specify bare_exchange_fraction in sigma.inp.

This in principle should work.  BerkeleyGW is considering to release the next major version within this year (not settled yet), in which all types of functionals (in principle) can be supported.

P.S. the way you generate WFNs using SCF from hybrid is correct under the current development.

Best,
Zhenglu



--
You received this message because you are subscribed to the Google Groups "BerkeleyGW Help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help+uns...@berkeleygw.org.
To view this discussion on the web visit https://groups.google.com/a/berkeleygw.org/d/msgid/help/21286504-033d-45e3-982e-1713e2c1bb76o%40berkeleygw.org.

729st...@gmail.com

unread,
Jun 12, 2020, 4:36:52 PM6/12/20
to BerkeleyGW Help, 729st...@gmail.com

Zhenglu,

From what you have written I would conclude it is not possible to use PBE0 states from Quantum Espresso as a starting point for G0W0. Please read my response and confirm this if you can. If one must use epsmat and eps0mat in Sigma it is not possible to produce these from Quantum Espresso due to two problems that I encountered. 

1) using the pw2bgw.x wrapper to produce vxc.dat using the saved wave function from an scf calculation  will produce an error. 

The error is a simply seg fault 
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f52046aa2ed in ???
#1  0x7f52046a9503 in ???
#2  0x7f52038b0f1f in ???
#3  0x555c58b1d1bb in __exx_MOD_vexx_k
at /home/sergio/Downloads/qe-6.4.1_release_pack/qe-6.4.1/PW/src/exx.f90:1242
#4  0x555c58b24683 in __exx_MOD_vexx
at /home/sergio/Downloads/qe-6.4.1_release_pack/qe-6.4.1/PW/src/exx.f90:797
#5  0x555c58af966b in write_vxc_g
at /home/sergio/Downloads/qe-6.4.1_release_pack/qe-6.4.1/PP/src/pw2bgw.f90:2107
#6  0x555c58b08d9a in pw2bgw
at /home/sergio/Downloads/qe-6.4.1_release_pack/qe-6.4.1/PP/src/pw2bgw.f90:341
#7  0x555c58af64fe in main
at /home/sergio/Downloads/qe-6.4.1_release_pack/qe-6.4.1/PP/src/pw2bgw.f90:99
Segmentation fault (core dumped)

I did not have this issue when doing the conversion for PBE states and  I can see in the traceback to exx.f90 that the error is somehow related to the exact exchange. 

2) If I cannot run a non-scf calculation in quantum espresso I cannot properly produce WFNq. As a reminder, one typically runs a non-scf calculation to save the wavefunction and produce vxc.dat but this is not possible in Quantum espresso currently.  The work around I mentioned above is to save wave function data at the end of SCF calculation but if I do that then the WFNq will be produced from not the same fixed self consistent potential as WFN was. How dramatic a problem this is I am unsure of.


Let me know your thoughts

Thank you
Sergio
To unsubscribe from this group and stop receiving emails from it, send an email to he...@berkeleygw.org.

Zhenglu Li

unread,
Jun 12, 2020, 4:51:17 PM6/12/20
to 729st...@gmail.com, BerkeleyGW Help, Mauro Del Ben, Felipe Jornada
Dear Sergio,

I'm not sure what I say will be exactly correct since I didn't do this type of calculation on a regular basis, but Mauro and Felipe (cc'ed) can correct me if I'm wrong.

Regarding your questions:
1) Will you be able to use VXC instead of vxc.dat?  This error is probably a simple bug that we should be able to fix, or you may try and earlier QE 5+ version to see if it was there as well.
2) There is a workaround: For example you use a 10x10x10 regular grid for epsmat.  Usually we ask 0.001 as the small q shift, but for the hybrid special case, you can relax the smallness, e.g. you can use (0.01, 0, 0).  Then, in your DFT hybrid calculation, run a calculation with 100x10x10 k-grid without many empty states as WFNq, and note that this WFNq contains all kpoints for the 10x10x10 regular grid + (0.01, 0, 0) shift point2.  This way your QE hybrid can run properly.

Please let us know if these don't solve your problem.

Best,
Zhenglu


To unsubscribe from this group and stop receiving emails from it, send an email to help+uns...@berkeleygw.org.
To view this discussion on the web visit https://groups.google.com/a/berkeleygw.org/d/msgid/help/df6c6bfd-bbfb-45a1-9a5b-9b51428ca4bco%40berkeleygw.org.

Zhenglu Li

unread,
Jun 12, 2020, 4:57:59 PM6/12/20
to 729st...@gmail.com, BerkeleyGW Help, Mauro Del Ben, Felipe Jornada
Dear Sergio,

The reply 2) I just wrote back is to deal with that QE Hybrid must include Gamma point and the shifted grid is not allowed in SCF.  For your concern of SCF charge density, the effect is very small as long as each individual SCF calculation is converged.

Best,
Zhenglu

Felipe Jornada

unread,
Jun 12, 2020, 5:01:17 PM6/12/20
to Jonah Haber, BerkeleyGW Help, Mauro Del Ben, 729st...@gmail.com, Zhenglu Li

Hi Jonah,

 

Could you please take a look at this thread on running BerkeleyGW with a hybrid starting point in QE?

 

Thanks,

 

Felipe

 

Felipe H. da Jornada

Assistant Professor

Department of Materials Science and Engineering

 

129 Durand Building

Stanford, CA 94305

Stanford University

https://jornada.stanford.edu/

729st...@gmail.com

unread,
Jun 12, 2020, 6:45:13 PM6/12/20
to BerkeleyGW Help, jonah...@berkeley.edu, mde...@lbl.gov, 729st...@gmail.com, lzl...@berkeley.edu, jor...@stanford.edu
Zhenglu, with respect to your suggestion "2)" I don't understand how to use the work around in practice. I understand that 100x10x10 k-grid will have the normal k-mesh + the shift, but when one runs the epsilon portion two inputs are needed (WFN and WFNq). Are you saying I simply need to have WFN and WFNq reference the same file?

Zhenglu Li

unread,
Jun 12, 2020, 7:21:58 PM6/12/20
to 729st...@gmail.com, BerkeleyGW Help, Jonah B Haber, Mauro Del Ben, Felipe Jornada
You can link the WFN to the one of 10x10x10 kgrid with many empty states, and link WFNq to the one of 100x10x10 kgrid with no empty states (or only few empty states).  In principle, you can use a single file of 100x10x10 kgrid with many empty states file for both WFN and WFNq but the DFT calculations would be too expensive and unnecessary.

Jonah Haber

unread,
Jun 13, 2020, 2:30:07 PM6/13/20
to 729st...@gmail.com, BerkeleyGW Help, Mauro Del Ben, Felipe Jornada, Zhenglu Li
Hi Sergio,

Not sure if this is still an open issue. If you have already figured this all out, please disregard this email.

I took a quick look at your calculation, and your workflow seems reasonable. Off the bat, I am not sure what is going on but agree that the 12.38 eV band gap seems like a red flag. To be clear, it looks like the calculation you attached is Hartree-Fock@PBE0 instead of G0W0@PBE0, because you use frequency_dependence -1. When you say that G0W0@PBE gives a 3.78 eV gap is this really a G0W0 calculation or is it closer to Hartree-Fock@PBE? If you are comparing G0W0@PBE to G0W0@PBE0 and find a large difference I agree this is cause for concern but if you are comparing Hartree-Fock@PBE0 to G0W0@PBE a large difference may be expected.

In any case, I am attaching an example on GaAs. There are two calculations GW@PBE and GW@PBE0. For the former I find a GW band ~1.4eV and for the later I find ~1.8eV. Can you please try running these calculations yourself and confirm that you can reproduce these results? I have included output in the ref directories. You should be able to run everything on 1 cori knl node. You will need to modify run.sh, wfn.run.sh, and pw2bw.sh scripts slightly as I ran on stampede2 instead of cori. Should mostly involve replacing ibrun -n 64 with srun -n 64 -c 4 --cpu_bind=cores.

Hopefully with this minimal example you can begin to troubleshoot MnO. The MnO is complicated as in addition to doing a hybrid calculation it looks like you are also taking into account the magnetic structure. Have you already spoken with others about this? I know BGW does not work with TRS broken systems. Maybe TRS is still intact in your case, I haven't looked too closely at the details and I am not an expert when it comes to these calculations. Is it meaningful to start from an MnO without accounting for the antiferromagnetic ordering? If so, I would recommend setting up a calculation without magnetization flags in a manner analogous to the GaAs example and see what you get.

Let me know if any of the suggestions are confusing or if I have misunderstood your question. 

Best,
Jonah
for-sergio.zip

729st...@gmail.com

unread,
Jun 15, 2020, 3:07:16 PM6/15/20
to BerkeleyGW Help, 729st...@gmail.com, mde...@lbl.gov, jor...@stanford.edu, lzl...@berkeley.edu, jonah...@berkeley.edu
Hey Jonah,

This example you have given me certainly clears up all my questions on how to do hybrid+GW from quantum espresso. I have been successful in running the calculation I need. 

Thank you all very much for your time and help. :)

Best
sergio

Fujie Tang

unread,
Feb 9, 2022, 12:01:00 AM2/9/22
to BerkeleyGW Help, Jonah Haber, BerkeleyGW Help, Mauro Del Ben, Felipe Jornada, lzl...@berkeley.edu, 729st...@gmail.com
Hi Jonah,
Sorry for disturbing you, I am trying to calculate GW starting from pbe0 for a while. It is great that you kindly gave an example for GaAs. 
I have a question about the setting for WFNq. What is needed for the Gamma only for WFNq? 
------

&control

   prefix = '32H2O'

   calculation = 'scf'

   restart_mode = 'from_scratch'

   wf_collect = .true.

   tstress = .false.

   tprnfor = .false.

   outdir = './'

   wfcdir = './'

   pseudo_dir = './'

/

&system

  ibrav     =  1,

  celldm(1) =  18.4300750126,

  nat       =  96,

  ntyp      =  2,

  ecutwfc   =  85.0D0,

  tot_charge =  0,

  nbnd = 128,

  input_dft = 'pbe0',

/

&electrons

   electron_maxstep = 1000

   conv_thr = 1.0d-10

   mixing_mode = 'plain'

   mixing_beta = 0.7

   mixing_ndim = 8

   diagonalization = 'cg'

   diago_david_ndim = 8

   diago_full_acc = .true.

/

ATOMIC_SPECIES

O  15.9994  O_HSCV_PBE-1.0.UPF

H  1.008  H_HSCV_PBE-1.0.UPF

ATOMIC_POSITIONS {angstrom}

*****

K_POINTS crystal

1

 0.0010000000  0.0010000000  0.000000000   1.0

The error message is that:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     Error in routine exx_grid_init (1):

     wrong EXX q grid

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


     stopping ...

--------------------------------------------------------------------------

MPI_ABORT was invoked on rank 126 in communicator MPI_COMM_WORLD

with errorcode 1.


NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.

You may or may not see output from other processes, depending on

exactly when Open MPI kills them.

Could you please give me some suggestions to do the WFNq based on gamma only?

Thanks!

Fujie

Reply all
Reply to author
Forward
0 new messages