eminamitani / espresso-PHrev

for revision of PH part in espresso
2 stars 0 forks source link

Writing electron-phonon matrix with suitable format #1

Closed eminamitani closed 5 years ago

eminamitani commented 5 years ago

Find some option or add function to write bare electron-phonon from quantum-espresso

eminamitani commented 5 years ago

! EPA (electron-phonon-averaged) approximation ! Writes electron-phonon matrix elements to a file ! Written by Georgy Samsonidze on 2015-01-28 ! ! Adv. Energy Mater. 2018, 1800246 ! doi:10.1002/aenm.201800246 ! https://doi.org/10.1002/aenm.201800246

というのを使うのが早いかも?

eminamitani commented 5 years ago

! consider only initial state k=0 ik = 1 WRITE(6,'(a,3f10.6)') 'xk ', (xk(n,ik),n=1,3) write(6,*) ' ibnd jbnd imode eig_i (eV) eig_j (eV) omega_nu (meV) |g| (meV)'

今のS.Ponceのバージョンではk=0だけが選ばれるようになっている 一番手始めの改変としてはikを選べるようにするのがよい たとえば k=all k=select k=1,2,3,4 みたいに、全部書かせるパターンと、指定した点について書かせるパターンが合って良いと思う

eminamitani commented 5 years ago

とりあえず、k点の情報にアクセスする箇所を書いた。

elphon.f90 elphsum2サブルーチン

write(6,*) 'number of total irreducible total k-points:', nkstot

do i=1, nkstot WRITE(6,'(a,3f10.6)') 'xk ', (xk(n,i),n=1,3) end do !

eminamitani commented 5 years ago

k点が各プロセッサに分割されてるのをどうやて戻すか?

eminamitani commented 5 years ago

MODULE klist  PW/src/pwcom.f90にある

   nks,               &! number of k points in this pool
   nkstot,            &! total number of k points
eminamitani commented 5 years ago

計算時のnpool オプションがややこしいのでは?

eminamitani commented 5 years ago

!/bin/csh

$ -cwd

$ -V -S /bin/bash

$ -N graphene-ph-0

$ -o stdout

$ -e stdout

$ -q all.q

$ -pe x24 24

mpirun /home/emi/espresso/install-test/gitLab-changePH/q-e/bin/pw.x -npool 1 < gr.scf.in > scf.out mpirun /home/emi/espresso/install-test/gitLab-changePH/q-e/bin/ph.x -npool 1 < graphene.phonon.in > phonon.out

にしたら number of total irreducible k-points: 61 xk 0.000000 0.000000 0.000000 xk 0.000000 0.048113 0.000000 xk 0.000000 0.096225 0.000000 xk 0.000000 0.144338 0.000000 xk 0.000000 0.192450 0.000000 xk 0.000000 0.240563 0.000000 xk 0.000000 0.288675 0.000000 xk 0.000000 0.336788 0.000000 xk 0.000000 0.384900 0.000000 xk 0.000000 0.433013 0.000000 xk 0.000000 0.481125 0.000000 xk 0.000000 0.529238 0.000000 xk 0.000000 -0.577350 0.000000 xk 0.041667 0.072169 0.000000 xk 0.041667 0.120281 0.000000 xk 0.041667 0.168394 0.000000 xk 0.041667 0.216506 0.000000 xk 0.041667 0.264619 0.000000 xk 0.041667 0.312731 0.000000 xk 0.041667 0.360844 0.000000 xk 0.041667 0.408956 0.000000 xk 0.041667 0.457069 0.000000 xk 0.041667 0.505181 0.000000 xk 0.041667 0.553294 0.000000 xk 0.083333 0.144338 0.000000 xk 0.083333 0.192450 0.000000 xk 0.083333 0.240563 0.000000 xk 0.083333 0.288675 0.000000 xk 0.083333 0.336788 0.000000 xk 0.083333 0.384900 0.000000 xk 0.083333 0.433013 0.000000 xk 0.083333 0.481125 0.000000 xk 0.083333 0.529238 0.000000 xk 0.083333 0.577350 0.000000 xk 0.125000 0.216506 0.000000 xk 0.125000 0.264619 0.000000 xk 0.125000 0.312731 0.000000 xk 0.125000 0.360844 0.000000 xk 0.125000 0.408956 0.000000 xk 0.125000 0.457069 0.000000 xk 0.125000 0.505181 0.000000 xk 0.125000 0.553294 0.000000 xk 0.166667 0.288675 0.000000 xk 0.166667 0.336788 0.000000 xk 0.166667 0.384900 0.000000 xk 0.166667 0.433013 0.000000 xk 0.166667 0.481125 0.000000 xk 0.166667 0.529238 0.000000 xk 0.166667 0.577350 0.000000 xk 0.208333 0.360844 0.000000 xk 0.208333 0.408956 0.000000 xk 0.208333 0.457069 0.000000 xk 0.208333 0.505181 0.000000 xk 0.208333 0.553294 0.000000 xk 0.250000 0.433013 0.000000 xk 0.250000 0.481125 0.000000 xk 0.250000 0.529238 0.000000 xk 0.250000 0.577350 0.000000 xk 0.291667 0.505181 0.000000 xk 0.291667 0.553294 0.000000 xk 0.333333 0.577350 0.000000

で本来の61点が書き出された。 -npool=1で運用してもらう方針が良いと思う

eminamitani commented 5 years ago

61点全部を書き出す仕様にループで書き換えてみるが、el_ph_matがすべてのk点の情報を持っているかが謎。アクセスエラー出るかも

eminamitani commented 5 years ago

とりあえず書き出しまでは行った。並列なしのときと比較する&今計算しているq点がどの点かと言うのを取得する必要あり。以前に似たようなことを試したときには

write(num_q,'(f9.6,A1,f9.6,A1,f9.6)') xq(1),".",xq(2),".",xq(3) open (160, file="gs-q="//TRIM(ADJUSTL(num_q))//".dat")

を使ってた。今回もひとまずはこれで良いかも

eminamitani commented 5 years ago

ph.x input description: in phq_readin.f90 control_ph module determine all the input parameter to control phonon calculation.

eminamitani commented 5 years ago

MODULE el_phon USE kinds, ONLY : DP ! SAVE ! LOGICAL :: elph, elph_mat, elph_simple, elph_epa INTEGER :: elph_nbnd_min, elph_nbnd_max INTEGER :: el_ph_ngauss, el_ph_nsigma INTEGER :: iunwfcwann, lrwfcr INTEGER :: npwq_refolded, ikqg INTEGER, allocatable :: wan_index_dyn(:) INTEGER, allocatable :: kpq(:), g_kpq(:,:),igqg(:) REAL(DP) :: el_ph_sigma REAL(DP), allocatable :: xk_gamma(:,:) COMPLEX(DP), ALLOCATABLE, TARGET :: & el_ph_mat(:,:,:,:) ! nbnd, nbnd, nks, 3*nat COMPLEX(DP), ALLOCATABLE, TARGET :: & el_ph_mat_rec(:,:,:,:) ! nbnd, nbnd, nksq, npe COMPLEX(DP), POINTER :: & el_ph_mat_rec_col(:,:,:,:) ! nbnd, nbnd, nksqtot, npe CHARACTER (LEN=256) :: auxdvscf LOGICAL, ALLOCATABLE :: comp_elph(:), done_elph(:) REAL(DP), ALLOCATABLE :: gamma_disp(:,:,:) ! END MODULE el_phon

eminamitani commented 5 years ago

avobe module written in elph.f90

eminamitani commented 5 years ago

elphsum2 import all element in el_phon. Thus, determin the parameters to control writing sequence in el_phon module is OK

eminamitani commented 5 years ago

writing all matrix element: elphout_all true: all k-point matrix element output in the file false: INTEGER :: elphout_k read the index of the necessary k-point index and only the required k-point matrix elements are outputted

eminamitani commented 5 years ago

Some usuful function is already impremented in QE

! elph_nbnd_min, ! elph_nbnd_max: if (elph_mat=.true.) it dumps the eph matrix element from elph_nbnd_min ! to elph_nbnd_max ! el_ph_ngauss, ! el_ph_nsigma, ! el_ph_sigma : if (elph_mat=.true.) it defines the kind and the val-ue of the ! smearing to be used in the eph coupling calculation.

eminamitani commented 5 years ago

the above area is related to

     !  electron-phonon interaction
     !
     IF ( elph ) THEN
        !
        IF ( .NOT. trans ) THEN
           !
           CALL dvanqq()
           IF ( elph_mat ) THEN
              CALL ep_matrix_element_wannier()
           ELSE
              CALL elphon()
           END IF
           !
        END IF

in do_phonon.f90 Thus, it is not direct output of ph.x electron-phonon matrix element.

eminamitani commented 5 years ago

Thus, 1) I add two parameters in MODULE el_phon in elph.f90 2) add definitions of parameters in phq_readin.f90 3) broadcast in bcast_ph_input.f90

eminamitani commented 5 years ago

Test run

all version

graphene phonon EPC
&inputph 
prefix= 'graphene' 
outdir='./tmp' 
tr2_ph=1.0d-16 
fildyn='graphene.dyn' 
fildvscf='dvscf'
alpha_mix(1)=0.2 
trans=.true. 
ldisp=.true. 
electron_phonon ='simple'
elphout_all =.true.
nq1=12,nq2=12,nq3=1
start_q=1 
last_q=1
/

select version

graphene phonon EPC
&inputph 
prefix= 'graphene' 
outdir='./tmp' 
tr2_ph=1.0d-16 
fildyn='graphene.dyn' 
fildvscf='dvscf'
alpha_mix(1)=0.2 
trans=.true. 
ldisp=.true. 
electron_phonon ='simple'
elphout_all =.false.
elphout_k = 4
nq1=12,nq2=12,nq3=1
start_q=1 
last_q=1
/

They works!

eminamitani commented 5 years ago

To avoid wavefunction pool problem -npool 1 option is required, for example

mpirun /home/emi/espresso/install-test/gitLab-changePH/q-e/bin/pw.x -npool 1 < gr.scf.in > scf.out 
mpirun /home/emi/espresso/install-test/gitLab-changePH/q-e/bin/ph.x -npool 1 < graphene.phonon.in > phonon.out 
eminamitani commented 5 years ago

Instead of stdout, create files and write the information to that file. File unit number is defined in --phcom.f90 --module units_ph

the value is determined in --openfilq.f90 -- subroutine openfilq

eminamitani commented 5 years ago

test calculation seems ok. merge to develop