The Elk Code
 
Loading...
Searching...
No Matches
genlmirep.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2008 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine genlmirep(lmax,ld,elm,ulm)
7use modmain
8implicit none
9! arguments
10integer, intent(in) :: lmax
11integer, intent(in) :: ld
12real(8), intent(out) :: elm(ld,natmtot)
13complex(8), intent(out) :: ulm(ld,ld,natmtot)
14! local variables
15integer isym,lspl,is,ia,ias
16integer lmmax,i,j,l,lm,n,p
17integer info,lwork
18! allocatable arrays
19real(8), allocatable :: rwork(:)
20complex(8), allocatable :: ulat(:,:,:)
21complex(8), allocatable :: a(:,:),b(:,:)
22complex(8), allocatable :: h(:,:),work(:)
23lmmax=(lmax+1)**2
24allocate(rwork(3*lmmax))
25allocate(ulat(lmmax,lmmax,nsymlat))
26allocate(a(lmmax,lmmax),b(lmmax,lmmax))
27allocate(h(lmmax,lmmax))
28lwork=2*lmmax
29allocate(work(lwork))
30! construct Yₗₘ rotation matrix for each lattice symmetry
31a(:,:)=0.d0
32do i=1,lmmax
33 a(i,i)=1.d0
34end do
35do isym=1,nsymlat
36 call rotzflm(symlatc(:,:,isym),0,lmax,lmmax,lmmax,lmmax,a,ulat(:,:,isym))
37end do
38! set up pseudorandom symmetric matrix H
39h(:,:)=0.d0
40p=0
41do l=0,lmax
42 n=2*l
43 lm=l**2+1
44 do i=lm,lm+n
45 do j=i,lm+n
46 p=p+1
47 h(i,j)=p
48 h(j,i)=p
49 end do
50 end do
51end do
52! loop over species and atoms
53do is=1,nspecies
54 do ia=1,natoms(is)
55 ias=idxas(ia,is)
56! symmetrise H with site symmetries
57 b(:,:)=0.d0
58 do isym=1,nsymsite(ias)
59! spatial rotation element in lattice point group
60 lspl=lsplsyms(isym,ias)
61! apply lattice symmetry as U*H*conjg(U')
62 call zgemm('N','N',lmmax,lmmax,lmmax,zone,ulat(:,:,lspl),lmmax,h,lmmax, &
63 zzero,a,lmmax)
64 call zgemm('N','C',lmmax,lmmax,lmmax,zone,a,lmmax,ulat(:,:,lspl),lmmax, &
65 zone,b,lmmax)
66 end do
67! block diagonalise symmetrised H
68 do l=0,lmax
69 n=2*l+1
70 lm=l**2+1
71 call zheev('V','U',n,b(lm,lm),lmmax,elm(lm,ias),work,lwork,rwork,info)
72 end do
73! the unitary matrix U is the transpose of the eigenvector array
74 do i=1,lmmax
75 do j=1,lmmax
76 ulm(i,j,ias)=b(j,i)
77 end do
78 end do
79 end do
80end do
81deallocate(rwork,ulat,a,b,h,work)
82end subroutine
83
subroutine genlmirep(lmax, ld, elm, ulm)
Definition genlmirep.f90:7
complex(8), parameter zzero
Definition modmain.f90:1238
integer nsymlat
Definition modmain.f90:342
real(8), dimension(3, 3, 48) symlatc
Definition modmain.f90:350
integer, dimension(maxspecies) natoms
Definition modmain.f90:36
integer, dimension(maxatoms, maxspecies) idxas
Definition modmain.f90:42
integer, dimension(:), allocatable nsymsite
Definition modmain.f90:374
complex(8), parameter zone
Definition modmain.f90:1238
integer, dimension(:,:), allocatable lsplsyms
Definition modmain.f90:376
integer nspecies
Definition modmain.f90:34
subroutine rotzflm(rot, lmin, lmax, lmmax, n, ld, zflm1, zflm2)
Definition rotzflm.f90:10