# What are the precise forms for the SU(2) and rotation matrices in VASP?

Some time ago, I conducted a discussion with Dr. Gui-Bin Liu on topological materials here. One relevant thing he said was:

"The format of trace.txt file is only a necessary condition to be used by getBandRep.
Another issue is that the rotation matrices used, especially the SU(2) spin rotation matrix, have to be the same with vasp and vasp2trace."

On the other hand, as for SU(2) representation, there are two popular gauges: Pauli and Cartan, as commented here. So, I want to know/confirm the precise forms of these matrices used by VASP. Any tips would be greatly appreciated.

I also asked on the VASP forum here.

Postscript:

@nike-dattani, Thank you for your inspection. I also did a similar check in the vasp.6.3.0 source code and found these definitions that are exactly the same as your conclusion and a related variable called PAULI_VECTOR, which I have listed below:

$rg -A8 -i 'pauli-mat' |head -9 src/spinsym.F: ! Define Pauli-matrices src/spinsym.F- sig=zero src/spinsym.F- sig(1,2,1)=cmplx( 1.0_q, 0.0_q,kind=q) src/spinsym.F- sig(2,1,1)=cmplx( 1.0_q, 0.0_q,kind=q) src/spinsym.F- sig(1,2,2)=cmplx( 0.0_q,-1.0_q,kind=q) src/spinsym.F- sig(2,1,2)=cmplx( 0.0_q, 1.0_q,kind=q) src/spinsym.F- sig(1,1,3)=cmplx( 1.0_q, 0.0_q,kind=q) src/spinsym.F- sig(2,2,3)=cmplx(-1.0_q, 0.0_q,kind=q) src/spinsym.F- !---$ rg -A45 -B3 -i 'The PAULI_VECTOR is ' | head -46
src/locproj.F-#if 0
src/locproj.F-      ! Diagonalize the Pauli vector times quantization axis vector dot(SPIN_QAXIS,PAULI_VECTOR)
src/locproj.F-      ! to obtain the eigenvectors and eigenvalues.
src/locproj.F:      ! The PAULI_VECTOR is (Sx,Sy,Sx) where Sx,Sy,Sz are the Pauli matrices
src/locproj.F-      SPIN_QAXIS = SPIN_QAXIS/SQRT(SUM(SPIN_QAXIS**2))
src/locproj.F-      CALL ZGEEV( 'N', 'V', 2, PV_MATRIX, 2, ZW, ZVL, 1, &
src/locproj.F-           ZVR, 2, ZWORK, 4, RWORK, INFO)
src/locproj.F-      ! debug: Verify that these are eigenvectors
src/locproj.F-      !WRITE(*,*) DOT_PRODUCT(ZVR(:,1),MATMUL(PV_MATRIX,ZVR(:,1)))
src/locproj.F-      !WRITE(*,*) DOT_PRODUCT(ZVR(:,2),MATMUL(PV_MATRIX,ZVR(:,2)))
src/locproj.F-#else
src/locproj.F-      ! Use spin rotation matrix to rotate quantization axis.
src/locproj.F-      ! The rotation matrix is obtained from two spin rotations.
src/locproj.F-      ! A spin rotation is defined by an angle and an axis
src/locproj.F-      ! R_s(theta,axis) = exp(-I*theta/2*dot(axis,pauli_vector))
src/locproj.F-      !
src/locproj.F-      ! The two rotations are the same as the EULER routine:
src/locproj.F-      ! 1. rotation around y-axis of beta
src/locproj.F-      ! R_s(beta,y) = [ cos(beta/2)   -sin(beta/2) ]
src/locproj.F-      !               [ sin(beta/2     cos(beta/2) ]
src/locproj.F-      !
src/locproj.F-      ! 2. rotation around z-axis of alpha
src/locproj.F-      ! R_s(alpha,z) = [ exp(-I*alpha/2)              0 ]
src/locproj.F-      !                [               0 exp(I*alpha/2) ]
src/locproj.F-      !
src/locproj.F-      ! The spin rotation is given by
src/locproj.F-      ! R = R_s(alpha,z)*R_s(beta,y)
src/locproj.F-      !
src/locproj.F-      ! Rotating the spin up and down states of Sz yields:
src/locproj.F-      ! ZVR(:,1) = R [1,0]
src/locproj.F-      ! ZVR(:,2) = R [0,1]
src/locproj.F-      !
src/locproj.F-      ! This is equivalent to the case above because:
src/locproj.F-      ! R Sz Dagger(R) = dot(SPIN_QAXIS,PAULI_VECTOR)
src/locproj.F-      ! i.e. rotating the Sz operator we obtain the same operator that we diagonalize above
src/locproj.F-      ! This is equivalent to rotating the eigenvectors of the Sz operator (stored in ZVR)
src/locproj.F-      CALL EULER(SPIN_QAXIS,ALPHA,BETA)
src/locproj.F-      ZVR(:,1) = [ COS(BETA/2)*EXP(-CMPLX(0.0_q,ALPHA/2,q)),SIN(BETA/2)*EXP(CMPLX(0.0_q,ALPHA/2,q))]
src/locproj.F-      ZVR(:,2) = [-SIN(BETA/2)*EXP(-CMPLX(0.0_q,ALPHA/2,q)),COS(BETA/2)*EXP(CMPLX(0.0_q,ALPHA/2,q))]
src/locproj.F-      ! debug: Verify that these are eigenvectors
src/locproj.F-      !WRITE(*,*) DOT_PRODUCT(ZVR(:,1),MATMUL(PV_MATRIX,ZVR(:,1)))
src/locproj.F-      !WRITE(*,*) DOT_PRODUCT(ZVR(:,2),MATMUL(PV_MATRIX,ZVR(:,2)))
src/locproj.F-#endif

\$ rg -A11 -i 'two rotations' |head -11
src/locproj.F:      ! The two rotations are the same as the EULER routine:
src/locproj.F-      ! 1. rotation around y-axis of beta
src/locproj.F-      ! R_s(beta,y) = [ cos(beta/2)   -sin(beta/2) ]
src/locproj.F-      !               [ sin(beta/2     cos(beta/2) ]
src/locproj.F-      !
src/locproj.F-      ! 2. rotation around z-axis of alpha
src/locproj.F-      ! R_s(alpha,z) = [ exp(-I*alpha/2)              0 ]
src/locproj.F-      !                [               0 exp(I*alpha/2) ]
src/locproj.F-      !
src/locproj.F-      ! The spin rotation is given by
src/locproj.F-      ! R = R_s(alpha,z)*R_s(beta,y)


Regards, Hongyi Zhao

• +10. Great first question, and welcome to our new community! Thank you for you contribution here and we hope to see much more of you in the future! Now when you said "Cartan, as commented here", was there supposed to be a hyperlink of the word "here", like you did for the other two instances of that word? I couldn't find the "Cartan" in either of the other two links, so which comment discusses it? Mar 21, 2022 at 3:28
• @NikeDattani Thank you for reminding me of the missing hyperlink. I've added it. Mar 21, 2022 at 3:35
• No problem at all! As for your question, I would be extremely surprised if VASP implemented the SU(2) operators in any way different from the matrices shown in the introduction of this article and I'd be very surprised if Cartan matrices were used anywhere in VASP. Mar 21, 2022 at 3:37
• As you can see, no specific and precise explanation was given by vasp developers on its official forum. So, I think it is necessary to raise this issue again here in order to attract people's attention and to engage the thinking and communication of those who are interested. Mar 21, 2022 at 4:14

The answer you got on the VASP forum here (thank you for giving us that in your question!) said to look in spinsym.F but was not clear at all, especially due to the typo in the formatting of that file name.

I just looked in the file vasp.5.4.4_2D/src/spinsym.F and did a case-insensitive search for "Pauli" and found this:

! Define Pauli-matrices
sig=zero
sig(1,2,1)=cmplx( 1.0_q, 0.0_q,kind=q)
sig(2,1,1)=cmplx( 1.0_q, 0.0_q,kind=q)
sig(1,2,2)=cmplx( 0.0_q,-1.0_q,kind=q)
sig(2,1,2)=cmplx( 0.0_q, 1.0_q,kind=q)
sig(1,1,3)=cmplx( 1.0_q, 0.0_q,kind=q)
sig(2,2,3)=cmplx(-1.0_q, 0.0_q,kind=q)


I did the same for "Cartan" and found nothing (which did not surprise me at all.

Therefore I can conclude the following: All Pauli matrices are given exactly as in the introduction of this article, and they are labeled as follows:

sig(:,:,1) is $$\sigma_x$$
sig(:,:,2) is $$\sigma_y$$
sig(:,:,3) is $$\sigma_z$$

I have never run a VASP calculation in my life, nor ever looked at any of its code, but I'm not at all surprised that they chose to define the SU(2) operators in this way!

Likwise for the rotation matrices, we have:

!The two rotations are the same as the EULER routine:
! 1. rotation around y-axis of beta
! R_s(beta,y) = [ cos(beta/2)   -sin(beta/2) ]
!               [ sin(beta/2     cos(beta/2) ]
!
! 2. rotation around z-axis of alpha
! R_s(alpha,z) = [ exp(-I*alpha/2)              0 ]
!                [               0 exp(I*alpha/2) ]
!
! The spin rotation is given by
! R = R_s(alpha,z)*R_s(beta,y)

• The rotation matrix text can be found from the commandline using rg -A11 -i 'two rotations' |head -11 Mar 22, 2022 at 1:13
• @HongyiZhao I edited your comment to explain what I think you meant based on your prior posts.
– Tyberius
Mar 22, 2022 at 2:18
• @Tyberius I have added all my comments to my initial question and marked them with postscript. Thank you for your suggestion and good practice. Mar 22, 2022 at 6:18