File: tm3pol.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (52 lines) | stat: -rw-r--r-- 1,484 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

! Copyright (C) 2008 F. Bultmark, F. Cricchio, L. Nordstrom and J. K. Dewhurst.
! This file is distributed under the terms of the GNU General Public License.
! See the file COPYING for license details.

subroutine tm3pol(l,k,p,r,w2,tm3p)
! !USES:
use modmain
! !INPUT/OUTPUT PARAMETERS:
!   l    : angular momentum (in,integer)
!   k    : k-index of tensor moment (in,integer)
!   p    : p-index of tensor moment (in,integer)
!   r    : r-index of tensor moment (in,integer)
!   w2   : modulus square of k-p-r tensor moment (in,real)
!   tm3p : polarisation (out,real)
! !DESCRIPTION:
!   Calculate the polarisation of each 3-index tensor component of the density
!   matrix, see {\it Phys. Rev. B} {\bf 80}, 035121 (2009).
!
! !REVISION HISTORY:
!   Created April 2008 (F. Cricchio and L. Nordstrom)
!EOP
!BOC
implicit none
! input variables
integer, intent(in) :: l,k,p,r
real(8), intent(in) :: w2
real(8), intent(out) :: tm3p
! local variables
integer g
real(8) nlk,t1
! external functions
real(8) wigner3j,factnm,factr
external wigner3j,factnm,factr
g=k+p+r
if (g.eq.0) then
  t1=sqrt(w2)
  tm3p=t1*(dble(2*(2*l+1))-t1)
else
  if (mod(g,2).eq.0) then
    t1=wigner3j(k,p,r,0,0,0)
  else
    t1=sqrt(factnm(g-2*p,1)*factnm(g-2*r,1)*factr(g-2*k,g+1))
    t1=t1*factnm(g,2)/(factnm(g-2*k,2)*factnm(g-2*p,2)*factnm(g-2*r,2))
  end if
  nlk=factnm(2*l,1)/sqrt(factnm(2*l-k,1)*factnm(2*l+k+1,1))
  tm3p=dble((2*k+1)*(2*r+1)*(2*l+1))*((t1*nlk)**2)*w2
end if
return
end subroutine
!EOC