The Elk Code
dmatsu2.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2025 J. K. Dewhurst and S. Sharma.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: dmatsu2
8 ! !INTERFACE:
9 subroutine dmatsu2(lmmax,su2,dmat)
10 ! !USES:
11 use modmain
12 ! !INPUT/OUTPUT PARAMETERS:
13 ! lmmax : number of (l,m) components: (lmax+1)^2 (in,integer)
14 ! su2 : SU(2) rotation matrix (in,complex(2,2))
15 ! dmat : density matrices for all second-variational states
16 ! (inout,complex(lmmax,nspinor,lmmax,nspinor,nstsv))
17 ! !DESCRIPTION:
18 ! Applies a $SU(2)$ rotation matrix $U$ to the spin degrees of freedom of a
19 ! state-resolved muffin-tin density matrix. In other words given a density
20 ! matrix $\gamma$, this subroutine performs the operation
21 ! $$ \gamma(l,m,\sigma,l,m,\sigma')\rightarrow \sum_{\sigma_1,\sigma_2}
22 ! U(\sigma,\sigma_1)\gamma(l,m,\sigma_1,l,m,\sigma_2)
23 ! U^{\dag}(\sigma_2,\sigma'). $$
24 ! Note that the operation is performed only on the $(l,m)$ diagonal part of
25 ! the matrix. See the routines {\tt bandstr} and {\tt dos}.
26 !
27 ! !REVISION HISTORY:
28 ! Created November 2025 (JKD)
29 !EOP
30 !BOC
31 implicit none
32 ! arguments
33 integer, intent(in) :: lmmax
34 complex(8), intent(in) :: su2(2,2)
35 complex(8), intent(inout) :: dmat(lmmax,nspinor,lmmax,nspinor,nstsv)
36 ! local variables
37 integer ist,lm
38 complex(8) b(2,2),c(2,2)
39 do ist=1,nstsv
40  do lm=1,lmmax
41 ! apply the SU(2) matrix as U γ U†
42  b(1:2,1:2)=dmat(lm,1:2,lm,1:2,ist)
43  call z2mm(su2,b,c)
44  call z2mmct(c,su2,b)
45  dmat(lm,1:2,lm,1:2,ist)=b(1:2,1:2)
46  end do
47 end do
48 end subroutine
49 !EOC
50 
pure subroutine z2mm(a, b, c)
Definition: z2mm.f90:10
pure subroutine z2mmct(a, b, c)
Definition: z2mmct.f90:10
subroutine dmatsu2(lmmax, su2, dmat)
Definition: dmatsu2.f90:10