Chengcheng-Xiao / VASP2WAN90_v2_fix

An updated version of the VASP2WANNIER90v2 interface
87 stars 37 forks source link

Add spin quantisation axis support #2

Closed Chengcheng-Xiao closed 4 years ago

Chengcheng-Xiao commented 5 years ago

The fix now reads in proj_s_qaxis. But all spinor projections are done without rotation of quantisation axis.

If Im not mistaken, the rotated spinor eigenvectors can be dotted directly onto the A_mn when the PAW pseudopotential is used (According to PW2WANNIER90.F90 for pwscf v6.4):

! general routine
! for quantisation axis (a,b,c) 
! 'up'    eigenvector is 1/sqrt(1+c) [c+1,a+ib]
! 'down'  eigenvector is 1/sqrt(1-c) [c-1,a+ib]
if(spin_eig(iw)==1) then
   fac(1)=(1.0_dp/sqrt(1+spin_qaxis(3,iw)))*(spin_qaxis(3,iw)+1)*cmplx(1.0d0,0.0d0,dp)
   fac(2)=(1.0_dp/sqrt(1+spin_qaxis(3,iw)))*cmplx(spin_qaxis(1,iw),spin_qaxis(2,iw),dp)
else
   fac(1)=(1.0_dp/sqrt(1-spin_qaxis(3,iw)))*(spin_qaxis(3,iw)-1)*cmplx(1.0d0,0.0d0,dp)
   fac(2)=(1.0_dp/sqrt(1-spin_qaxis(3,iw)))*cmplx(spin_qaxis(1,iw),spin_qaxis(2,iw),dp)
endif
ibnd1 = 0
DO ibnd = 1,nbnd
   IF (excluded_band(ibnd)) CYCLE
   amn=(0.0_dp,0.0_dp)
   DO ipol=1,npol
      istart = (ipol-1)*npwx + 1
      amn_tmp=(0.0_dp,0.0_dp)
      if (any_uspp) then
        amn_tmp = zdotc(npw,evc(istart,ibnd),1,sgf_spinor(istart,iw),1)
        CALL mp_sum(amn_tmp, intra_pool_comm)
        amn=amn+amn_tmp
      else
        amn_tmp = zdotc(npw,evc(istart,ibnd),1,sgf(1,iw),1)                        
        CALL mp_sum(amn_tmp, intra_pool_comm)
        amn=amn+fac(ipol)*amn_tmp
      endif
   enddo
   ibnd1=ibnd1+1
   IF (wan_mode=='standalone') THEN
      IF (ionode) WRITE(iun_amn,'(3i5,2f18.12)') ibnd1, iw, ik, amn
   ELSEIF (wan_mode=='library') THEN
         a_mat(ibnd1,iw+n_proj*(ipol-1),ik) = amn
      ELSE
         CALL errore('compute_amn',' value of wan_mode not recognised',1)
      ENDIF
   ENDDO
endif

The same could be done in VASP2WANNIER90 interface.

Chengcheng-Xiao commented 5 years ago

For this to work, we need to calculate both spin channels A_mn matrixes with respect to z axis (proj_s_qaxis = [0,0,1]), then dot the eigenvector (coefficient) to the corresponding matrix elements.

Major modifications are needed for this, might take some time.

Chengcheng-Xiao commented 5 years ago

A test version has been published on branch spin_quantization_axis

More tests are needed before merging tho.

Chengcheng-Xiao commented 4 years ago

I'm seeing some strange behaviours during testing. For a projection only calculation, VASP with reoriented quantization axis shows larger Rashba effect than QE. Not sure if this is pseudo potential related. However, after Maxloc procedure, all reverts back to normal.

Screenshot 2020-03-30 at 1 33 37 PM

Test input files: 2020-03-30-VASP_QE_compare.tar.gz

Chengcheng-Xiao commented 4 years ago

Well, looks like this is a pretty stupid one, I forgot Fortran doesn't sterilise its arrays... This means:

A_matrix = A_matrix + CPROJ

will throw some random number to the AMN mat. 🤪

AND no, it still doesn't work. the problem now is rotating quantisation axis doesn't do anything. The root of this is that we need to rotate the guiding functions and get S|gf> before dotting them to the Bloch functions.

In pw2wannier90, any_uspp actually includes PAW. I guess only NCPP can be directly used with this method.

Chengcheng-Xiao commented 4 years ago

Trying to find some tests, closed for now.