The Elk Code
 
Loading...
Searching...
No Matches
tm3todm.f90
Go to the documentation of this file.
1
2! Copyright (C) 2007 F. Bultmark, F. Cricchio, L. Nordstrom and J. K. Dewhurst.
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: tm3todm
8! !INTERFACE:
9subroutine tm3todm(l,k,p,r,ld,wkpr,dm)
10! !INPUT/OUTPUT PARAMETERS:
11! l : angular momentum quantum number (in,integer)
12! k : k-index of tensor moment (in,integer)
13! p : p-index of tensor moment (in,integer)
14! r : r-index of tensor moment (in,integer)
15! ld : leading dimension (in,integer)
16! wkpr : 3-index tensor moment components (in,real(-ld:ld))
17! dm : complex Hermitian density matrix (out,complex(ld,2,ld,2))
18! !DESCRIPTION:
19! The 3-index coupled tensor moment matrices are given by
20! $$ \Gamma_t^{kpr}=
21! \sqrt{2r+1}\sum_{x=-k}^k\sum_{y=-p}^p
22! \begin{pmatrix} k & r & p \\ -x & t & -y \end{pmatrix}
23! \Gamma_{xy}^{kp}, $$
24! where the irreducible representations are labeled by $k\in\{0,\ldots,2l\}$,
25! $p\in\{0,1\}$, $r\in\{|k-p|,\ldots,k+p\}$ and $\Gamma_{xy}^{kp}$ are the
26! uncoupled tensor moments (note that the phase $(-1)^{x+y}$ in the original
27! formula has been removed because of the Wigner $3j$ condition $x+y=t$). The
28! coupled tensor moment matrices are real and orthonormal in the sense
29! $$ \tr\big(\Gamma_t^{kpr}\Gamma_{t'}^{k'p'r'}\big)=
30! \delta_{kk'}\delta_{pp'}\delta_{rr'}\delta_{tt'}. $$
31! It can also be shown that the matrices are complete, thus any general
32! complex matrix $D$ of dimension $2(2l+1)$ can be expanded as
33! $$ D=\sum_{k=0}^{2l}\sum_{p=0}^1\sum_{r=|k-p|}^{k+p}\sum_{t=-r}^r
34! z_t^{kpr}\Gamma_t^{kpr} $$
35! where $z_t^{kpr}$ are complex numbers. Likewise, any real matrix can be
36! expanded in real tensor moments $w_t^{kpr}$. Using the the symmetry
37! properties of the Wigner $3j$-symbols, one can show that the transpose
38! $$ \big(\Gamma_t^{kpr}\big)^t=(-1)^{k+p+r+t}\,\Gamma_{-t}^{kpr} $$
39! and thus both the symmetric and antisymmetric parts of $\Gamma_t^{kpr}$
40! transform under rotation within the same irreducible representation.
41! Consequently, any complex Hermitian matrix $D$ can be written as
42! $$ D=\sum_{k,p,r,t} w_t^{kpr}\big[(\Gamma_t^{kpr})_{\rm S}
43! +i(\Gamma_t^{kpr})_{\rm A}\big], $$
44! where the subscripts S and A refer to the symmetric and antisymmetric parts
45! of the matrix, respectively. This routine generates the Hermitian density
46! matrix $D$ as described above from the real tensor moments $w_t^{kpr}$. For
47! a detailed derivation see {\it Phys. Rev. B} {\bf 80}, 035121 (2009) and
48! {\it J. Phys.: Condens. Matter} {\bf 7}, 9947 (1995). See also the routines
49! {\tt tm2todm} and {\tt tm3rtoz}.
50!
51! !REVISION HISTORY:
52! Created 2007 (Francesco Cricchio and Lars Nordstrom)
53! Changed normalisation, made the moments real and the matrix Hermitian,
54! January 2022 (JKD)
55!EOP
56!BOC
57implicit none
58! arguments
59integer, intent(in) :: l,k,p,r,ld
60real(8), intent(in) :: wkpr(-ld:ld)
61complex(8), intent(out) :: dm(ld,2,ld,2)
62! local variables
63integer x,y,t
64real(8) t0,t1
65! automatic arrays
66real(8) wkp(-ld:ld,-1:1),dmr(ld,2,ld,2)
67! external functions
68real(8), external :: wigner3j
69if (l < 0) then
70 write(*,*)
71 write(*,'("Error(tm3todm): l < 0 : ",I8)') l
72 write(*,*)
73 stop
74end if
75if (k < 0) then
76 write(*,*)
77 write(*,'("Error(tm3todm): k < 0 : ",I8)') k
78 write(*,*)
79 stop
80end if
81if (k > 2*l) then
82 write(*,*)
83 write(*,'("Error(tm3todm): k > 2*l : ",2I8)') k,2*l
84 write(*,*)
85 stop
86end if
87if ((p < 0).or.(p > 1)) then
88 write(*,*)
89 write(*,'("Error(tm3todm): p should be 0 or 1 : ",I8)') p
90 write(*,*)
91 stop
92end if
93if (r < abs(k-p)) then
94 write(*,*)
95 write(*,'("Error(tm3todm): r < |k-p| : ",2I8)') r,abs(k-p)
96 write(*,*)
97 stop
98end if
99if (r > (k+p)) then
100 write(*,*)
101 write(*,'("Error(tm3todm): r > k+p : ",2I8)') r,k+p
102 write(*,*)
103 stop
104end if
105! compute 2-index tensor moment from 3-index tensor moment
106wkp(:,:)=0.d0
107t0=sqrt(dble(2*r+1))
108do t=-r,r
109 t1=wkpr(t)
110 if (abs(t1) < 1.d-8) cycle
111 t1=t0*t1
112 do x=-k,k
113 do y=-p,p
114 wkp(x,y)=wkp(x,y)+t1*wigner3j(k,r,p,-x,t,-y)
115 end do
116 end do
117end do
118! compute the real matrix from the 2-index tensor moment
119call tm2todm(l,k,p,ld,wkp,dmr)
120! convert to complex Hermitian matrix
121call dmrtoz(ld*2,dmr,dm)
122return
123
124contains
125
126pure subroutine dmrtoz(n,dmr,dm)
127implicit none
128! arguments
129integer, intent(in) :: n
130real(8), intent(in) :: dmr(n,n)
131complex(8), intent(out) :: dm(n,n)
132! local variables
133integer i,j
134real(8) a,b
135do j=1,n
136 do i=1,j-1
137! symmetric part
138 a=0.5d0*(dmr(i,j)+dmr(j,i))
139! antisymmetric part
140 b=0.5d0*(dmr(i,j)-dmr(j,i))
141 dm(i,j)=cmplx(a,b,8)
142 dm(j,i)=cmplx(a,-b,8)
143 end do
144 dm(j,j)=dmr(j,j)
145end do
146end subroutine
147
148end subroutine
149!EOC
150
subroutine tm2todm(l, k, p, ld, wkp, dm)
Definition tm2todm.f90:10
subroutine tm3todm(l, k, p, r, ld, wkpr, dm)
Definition tm3todm.f90:10
pure subroutine dmrtoz(n, dmr, dm)
Definition tm3todm.f90:127
real(8) function wigner3j(j1, j2, j3, m1, m2, m3)
Definition wigner3j.f90:10