Printing/plotting g coefficients (and: restarting a calc)

Dear all,
We have started to use the new version of EPW. In particular, in our case, we are working on a 2D semiconductor, and we are interested (eventually) to estimate the mobility for electrons and holes.

At this stage, however, we are mainly interested in figuring out the relative importance (i.e., scattering time) of ZA phonons w.r.t. LA,TA and optical phonons to see if one contribution is dominant, as well as to understand how anisotropic the scattering is for our material. So, probably, it would be enough for the time being to produce some plots similar to e.g. Fig. 8 of this paper http://dx.doi.org/10.1063/1.4887538 (or, more generally, how to output on a file – or read from a file already written by EPW – the matrix elements g for a given band/k vector and phonon branch, as a function of q) - in your tutorial http://epw.org.uk/Documentation/GaN you say that it is easy to print these quantities by modifying the code, but if you could give us some ‘pointers’ to which arrays to look, and which indices indentify the different physical indices (k,q,n,…) it would be extremely helpful for us. (or maybe there is already a flag to output what we need?)

Also, when running your example http://epw.org.uk/Documentation/GaN, a big file gan.epmatwp1 is generated, that (we think) contains the quantities we need. It would therefore be useful to just ‘restart’ the code and have it print the quantities we want, instead of re-running epw.

We tried changing the flags kmaps, epbread, epwread from False to True, and epbwrite, epwwrite, and wannierize from True to False. Is this enough? When running after these changes, the code "stops" after printing "Reading Hamiltonian, Dynamical matrix and EP vertex in Wann rep from file" (meaning that it runs for a long time > 1h, but it fills all the machine memory so the machine basically hangs - note we are running with 8 pools). Is this the correct way to restart EPW? Is there a way to reduce memory consumption?

Thanks in advance,
Giovanni Pizzi and Marco Gibertini
(EPFL, Switzerland)

Hello Giovanni and Marco,

I will try to reply to your two questions:

  1. It seems that plotting the g^2 seems to be a demanded feature. I will implement something with an input variable in the near future.
    In the meantime, if you want to print the electron-phonon matrix elements, you will need to hack the code.
    What you need to print is the [i:2ptoequk]epmatf[/i:2ptoequk] variable from the [i:2ptoequk]ephwann_shuffle.f90[/i:2ptoequk] file.
    Note that you need to print g times its complex conjugate as the electron-phonon matrix elements has a phase.
    Moreover, there is an arbitrary gauge in case of degenerate states. Only the average of g^2 is physically meaningful. You therefore need to average on bands that have degenerate eigenenergies as well as degenerate phonon modes.
    Finally I must mention that the [i:2ptoequk]epmatf[/i:2ptoequk] variables does not contain the phonon frequency. You will therefore need to do something like
    [code:2ptoequk]
    abs(epmatf (jbnd, ibnd, imode))**two / (two * wq)[/code:2ptoequk]
    in order to have the quantity you want.

  2. If you have memory issues, I recommend to use
    [code:2ptoequk]etf_mem = .false.[/code:2ptoequk]
    To restart a calculation after the [i:2ptoequk]si.epmatwp1[/i:2ptoequk] file has been correctly written to file, you need to do

[code:2ptoequk] wannierize = .false.
epbwrite = .false.
epbread = .false.
epwwrite = .false.
epwread = .true.[/code:2ptoequk]

I hope this answers your questions?

Best,

Samuel

Thanks a lot!

An additional question: in that module, is it possible to get also the energies of the electronic bands at k and at k+q? Are they already in a stored array, or can I get them in some way?

Moreover, is there already a routine in EPW to calculate the electron relaxation times tau_{n,k} due to el-ph scattering?

Thanks,
Giovanni

Hi Giovanni,

The electron energies at k and k+q are in the arrays etf(:,:slight_smile: where the first index is the wannier band. To access the energies at k you need etf(:,ikk) and for the energies at k+q etf(:,ikq).

Currently you can find ImS for each k, band in the output and in the file ‘linewidth.elself’; you then need to calculate tau_nk yourself by extracting ImS_nk.

Cheers
Carla

Hi Giovanni,

Thank you again for reporting the outdir bug.

I have commit the debug to the trunk of QE.

One just need to add
[code:1bzwm5l0] USE io_files, ONLY : prefix, tmp_dir[/code:1bzwm5l0]
as well as
[code:1bzwm5l0] filint = trim(tmp_dir)//trim(prefix)//‘.epmatwp1’[/code:1bzwm5l0]
in ephwan2blochp.f90

Best,

Samuel

Dear EPW Users,

Following the above post on extracting etf(:;ikk) and etf(:;ikq), I have added the following lines (marked ADDED TO THE CODE) to the selfen_elec.f90 at line 290 shortly after where poolgather2 collects all the etf values from the pools:

[code:3d5iykrv]
#ifdef __PARA
!
! note that poolgather2 works with the doubled grid (k and k+q)
!
CALL poolgather2 ( 3, nkqtotf, nkqf, xkf, xkf_all )
CALL poolgather2 ( nbndsub, nkqtotf, nkqf, etf, etf_all )
CALL mp_sum( sigmar_all, inter_pool_comm )
CALL mp_sum( sigmai_all, inter_pool_comm )
IF (iverbosity == 3) CALL mp_sum( sigmai_mode, inter_pool_comm )
CALL mp_sum( zi_all, inter_pool_comm )
CALL mp_sum(fermicount, inter_pool_comm)
CALL mp_barrier(inter_pool_comm)
!
#else
!
xkf_all = xkf
etf_all = etf
!
#endif
!
! Output electron SE here after looping over all q-points (with their contributions
! summed in sigmar_all, etc.)

!************************************** ADDED TO THE CODE*************************
OPEN(unit=996,file=‘etf_ikk.dat’)
OPEN(unit=998,file=‘etf_ikq.dat’)
DO ik = 1, nkf

    IF (lgamma) THEN
       ikk = ik
       ikq = ik
    ELSE
       ikk = 2 * ik - 1
       ikq = ikk + 1
    ENDIF

    write(996,*) etf_all(:,ikk)
    write(998,*) etf_all(:,ikq)

 ENDDO
 CLOSE(996)
 CLOSE(998)

!**********************************************************************************
[/code:3d5iykrv]

I ran the B-doped diamond example with 10x10x10 fine q-grid (to speed up the calculations) and no fsthick. When I ran the code serially, I get 201 lines (the line segment has 201 k-points) in the elf_ikk.dat and etf_ikq.dat with each line having 4 energies corresponding to the 4 wannier bands. I believe this is correct. But when I ran the same input on 8 cpus and 8 pools, the two data files only had 26 lines. I was expecting the poolgather2 to put all the etf values in the etf_total but I only get the etf from one of the pools.

Does anyone have any suggestions as to how to get the etf(;ikk) and etf(:;ikq) from all the pools in case of a parallel run?

Thank you,

Vahid

Vahid Askarpour
Department of Physics and Atmospheric Science
Dalhousie University,
Halifax, NS, Canada

Dear Vahid,

The loop over ik should be "DO ik = 1, nksqtotf" same as when Sigma is written to file.

Best,
Roxana

Dear Roxana,

Thank you. That change resulted in correct etf values.

Best wishes,

Vahid

Dear All,

I have a question on the index ordering of epmatf (jbnd, ibnd, imode) that are, if I understood correctly, the matrix elements given in Eq. 2 in Noffsinger et al. Comp. Phys. Comm. 181 (2010) 2140 (http://dx.doi.org/10.1016/j.cpc.2010.08.027) : Which of the electronic band indices is carrying the k and which the k+q?

Is is: < jbnd,k | dV_q,imode | ibnd,k+q > or < ibnd,k | dV_q,imode | jbnd,k+q > ?

Thank you very much for your help.

Cheers,
Hannes

Dear Hannes

It is < jbnd,k+q | dV_q,imode | ibnd,k >

Cheers
Carla

Dear All,

I have follow up questions about g coefficients. I am new to el-ph interaction in general, sorry if questions are naive.

Regarding "abs(epmatf (jbnd, ibnd, imode))**two / (two * wq)", I think ‘wq’ variable here is frequency of imode, but I failed to locate the actual ‘wq’ in ephwann_shuffle.f90. Can you help me by pointing out the actual variable name?

One more related question, I am trying to get g coefficient that can be used in model Hamiltonian studies, so I need absolute value with correct unit. Square root of [abs(epmatf (jbnd, ibnd, imode))**two / (two * wq)] should have physical dimensionality of energy. So, I guess the printed number should have unit of Ryderg^2, is that correct?

Apprecite your help!

Dear jiachen,

Yes everything is calculated internally using Rydberg atomic units.
You can find the phonon energies are stored in wf(mode,q).

Best,
Carla