spin density

Deals with issues related to computation of optical spectra, solving the Bethe-Salpeter equation.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano

Post Reply
martinspenke
Posts: 149
Joined: Tue Apr 08, 2014 6:05 am

spin density

Post by martinspenke » Sun Aug 24, 2014 8:56 pm

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
Martin Spenke, PhD Student
Theoretisch-Physikalisches Institut
Universität Hamburg, Germany

User avatar
Davide Sangalli
Posts: 610
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: spin density

Post by Davide Sangalli » Mon Aug 25, 2014 8:10 am

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
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

martinspenke
Posts: 149
Joined: Tue Apr 08, 2014 6:05 am

Re: spin density

Post by martinspenke » Mon Aug 25, 2014 11:06 am

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
Last edited by martinspenke on Mon Aug 25, 2014 11:08 am, edited 1 time in total.
Martin Spenke, PhD Student
Theoretisch-Physikalisches Institut
Universität Hamburg, Germany

User avatar
Davide Sangalli
Posts: 610
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: spin density

Post by Davide Sangalli » Mon Aug 25, 2014 11:08 am

Yes. D.
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

martinspenke
Posts: 149
Joined: Tue Apr 08, 2014 6:05 am

Re: spin density

Post by martinspenke » Mon Aug 25, 2014 1:29 pm

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
Martin Spenke, PhD Student
Theoretisch-Physikalisches Institut
Universität Hamburg, Germany

User avatar
Davide Sangalli
Posts: 610
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: spin density

Post by Davide Sangalli » Wed Aug 27, 2014 11:58 am

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 ...
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

Post Reply