32real(8) wkpr(-lmmaxdm:lmmaxdm)
33complex(8) zkpr(-lmmaxdm:lmmaxdm)
34complex(8) gamma(lmmaxdm,2,lmmaxdm,2)
36real(8),
external :: trzhmm
39open(50,file=
'TENSMOM'//trim(
filext),form=
'FORMATTED',action=
'WRITE')
40write(50,
'("Density matrix decomposition in coupled tensor moments")')
41write(50,
'("Components are in the spherical basis")')
42write(50,
'(" (see Phys. Rev. B. 80, 035121 (2009))")')
48 t0=sqrt(dble((2*l+1)*2))
52 write(50,
'("Species : ",I4," (",A,"), atom : ",I4)') is,trim(
spsymb(is)),ia
53 write(50,
'(" l = ",I1)') l
58 call dmtotm3(l,k,p,r,lmmaxdm,
dmatmt(:,:,:,:,ias),wkpr)
60 call tm3todm(l,k,p,r,lmmaxdm,wkpr,gamma)
64 write(50,
'(" k = ",I1,", p = ",I1,", r = ",I1)') k,p,r
67 call tm3rtoz(l,k,p,r,lmmaxdm,wkpr,zkpr)
69 write(50,
'(" t = ",I2," : ",2F14.8)') t,zkpr(t)
76 write(50,
'(" t = ",I2," : ",F14.8)') t,t1
80 write(50,
'(" magnitude : ",F14.8)') sm
82 write(50,
'(" Hartree + exchange energy : ",F14.8)') ehx
85 call writevars(
'wkpr',n1=is,n2=ia,n3=l,n4=k,n5=p,n6=r,nv=2*r+1, &
97 call writetest(820,
'Coupled tensor moments',nv=
size(wkpr),tol=2.d-2,rva=wkpr)
subroutine dmtotm3(l, k, p, r, ld, dm, wkpr)
integer, dimension(2, maxdftu) isldu
complex(8), dimension(:,:,:,:,:), allocatable vmatmt
complex(8), dimension(:,:,:,:,:), allocatable dmatmt
integer, dimension(maxspecies) natoms
integer, dimension(maxatoms, maxspecies) idxas
character(64), dimension(maxspecies) spsymb
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)
subroutine writevars(vname, n1, n2, n3, n4, n5, n6, nv, iv, iva, rv, rva, zv, zva, sv, sva)
subroutine tm3rtoz(l, k, p, r, ld, wkpr, zkpr)
subroutine tm3todm(l, k, p, r, ld, wkpr, dm)
pure real(8) function trzhmm(n, a, b)