Page 1 of 1
spin density
Posted: Sun Aug 24, 2014 8:56 pm
by martinspenke
Dear all,
is there any way to be able to visualize spin density distribution of excitonic wave function using yambo
as shown in this paper : Phys. Rev. B 77, 184408 (2008) ???
Bests
Martin
Re: spin density
Posted: Mon Aug 25, 2014 8:10 am
by Davide Sangalli
Dear Martin,
it is not coded in yambo but (if I understood what the did) I think you can acheive this result easely.
Just open the file ypp/exciton_driver.F
And around the line 432 you can insert: if(i_spin==2) cycle
after the line : i_spin= spin(BS_eh_table(neh,:))
Then recompile ypp and run ypp -e w
In this case you would plot the "spin up" contribution to the excitonic wf.
If you need the "spin down" part just use: if(i_spin==1) cycle
It should work both for collinear and non-collinear spin. Hope it helps.
Best,
Davide
Re: spin density
Posted: Mon Aug 25, 2014 11:06 am
by martinspenke
Dear Davide,
many thanks.
Just to be sure :
i_spin= spin(BS_eh_table(neh,:)) is for me at line : 392
So is this modification now correct : ?
Code: Select all
do neh = 1,BS_H_dim
!
ikbz = BS_eh_table(neh,1)
iv = BS_eh_table(neh,2)
ic = BS_eh_table(neh,3)
i_spin= spin(BS_eh_table(neh,:))
if(i_spin==2) cycle
!
ikibz = Xk%sstar(ikbz,1)
is = Xk%sstar(ikbz,2)
!
k_dot_r = dot_product(r_eh,Xk%ptbz(ikbz,:)/alat(:))*2.*pi
!
WF1_ir=WF_symm(rindex(ir),(/iv,ikibz,is,i_spin/))
WF2_ir=WF_symm(rindex(ir),(/ic,ikibz,is,i_spin/))
!
wf_vc(neh) = conjg(WF1_ir(1))*WF2_ir(1)
if(n_spinor==2) wf_vc(neh) = wf_vc(neh) + conjg(WF1_ir(2))*WF2_ir(2)
!
wf_vc(neh) = wf_vc(neh)*exp(cI*k_dot_r)
!
enddo !Matrix elements
Bests
Martin
Re: spin density
Posted: Mon Aug 25, 2014 11:08 am
by Davide Sangalli
Yes. D.
Re: spin density
Posted: Mon Aug 25, 2014 1:29 pm
by martinspenke
Dear Davide,
If i want to plot the spin density
difference (rho_up - rho_down) , would be this modification correct : ?
Code: Select all
do neh = 1,BS_H_dim
!
ikbz = BS_eh_table(neh,1)
iv = BS_eh_table(neh,2)
ic = BS_eh_table(neh,3)
i_spin= spin(BS_eh_table(neh,:))
if(i_spin==2) cycle ! UP
!
ikibz = Xk%sstar(ikbz,1)
is = Xk%sstar(ikbz,2)
!
k_dot_r = dot_product(r_eh,Xk%ptbz(ikbz,:)/alat(:))*2.*pi
!
WF1_ir=WF_symm(rindex(ir),(/iv,ikibz,is,i_spin/))
WF2_ir=WF_symm(rindex(ir),(/ic,ikibz,is,i_spin/))
!
wf_vc(neh)_up = conjg(WF1_ir(1))*WF2_ir(1)
if(i_spin==1) cycle ! DOWN ----------------------------------------------------------------------------------------------
!
ikibz = Xk%sstar(ikbz,1)
is = Xk%sstar(ikbz,2)
!
k_dot_r = dot_product(r_eh,Xk%ptbz(ikbz,:)/alat(:))*2.*pi
!
WF3_ir=WF_symm(rindex(ir),(/iv,ikibz,is,i_spin/))
WF4_ir=WF_symm(rindex(ir),(/ic,ikibz,is,i_spin/))
!
wf_vc(neh)_down = conjg(WF3_ir(1))*WF4_ir(1)
if(n_spinor==2) wf_vc(neh) = (wf_vc(neh)_up - wf_vc(neh)_down) + conjg(WF1_ir(2))*(WF2_ir(2)) - conjg(WF3_ir(2))*(WF4_ir(2))
!
wf_vc(neh) = wf_vc(neh)*exp(cI*k_dot_r)
!
enddo !Matrix elements
Bests
Martin
Re: spin density
Posted: Wed Aug 27, 2014 11:58 am
by Davide Sangalli
Dear Martin,
I'm not sure I understood what you mean.
Here we are making a plot of the square modulus of the excitonic wave--function.
If you want to plot the differnce I guess you should define a wf_vc_up(neh) and a wf_vc_dw(neh). Something like that
Code: Select all
if(i_spin==1) wf_vc_up(neh) = wf_vc(neh)*exp(cI*k_dot_r)
if(i_spin==2) wf_vc_dw(neh) = wf_vc(neh)*exp(cI*k_dot_r)
and then
Code: Select all
wf_up = V_dot_V(BS_H_dim,BS_mat(1,i_l),wf_vc_up)
wf_dw = V_dot_V(BS_H_dim,BS_mat(1,i_l),wf_vc_dw)
!
v2plot(ir) = v2plot(ir)+abs(wf_up)**2.- abs(wf_dw)**2.
Davide
P.S.: keep in mind that all this works for the collinear case. If you are considering the non-collinear case it would be different ...