2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Copyright (C) 2001 PWSCF group
|
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!---------------------------------------------------------------------
|
|
|
|
subroutine set_irr_mode (nat, at, bg, xq, s, invs, nsym, rtau, &
|
2003-07-21 21:35:53 +08:00
|
|
|
irt, irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, &
|
|
|
|
npert, nirr, gi, gimq, iverbosity, modenum)
|
2003-01-20 05:58:50 +08:00
|
|
|
!---------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! This routine computes the symmetry matrix of the mode defined
|
|
|
|
! by modenum. It sets also the modes u for all the other
|
|
|
|
! representation
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
#include "machine.h"
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, only : DP
|
2004-03-07 21:47:42 +08:00
|
|
|
USE constants, ONLY: tpi
|
2003-02-08 00:04:36 +08:00
|
|
|
implicit none
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! first the dummy variables
|
|
|
|
!
|
|
|
|
|
|
|
|
integer :: nat, nsym, s (3, 3, 48), invs (48), irt (48, nat), &
|
|
|
|
iverbosity, modenum, npert (3 * nat), irgq (48), nsymq, irotmq, &
|
2003-01-28 00:42:47 +08:00
|
|
|
nirr, max_irr_dim
|
2003-01-20 05:58:50 +08:00
|
|
|
! input: the number of atoms
|
|
|
|
! input: the number of symmetries
|
|
|
|
! input: the symmetry matrices
|
|
|
|
! input: the inverse of each matrix
|
|
|
|
! input: the rotated of each atom
|
|
|
|
! input: write control
|
|
|
|
! input: the mode to be done
|
|
|
|
! output: the dimension of each represe
|
|
|
|
! output: the small group of q
|
|
|
|
! output: the order of the small group
|
|
|
|
! output: the symmetry sending q -> -q+
|
|
|
|
! output: the number of irr. representa
|
|
|
|
|
|
|
|
real(kind=DP) :: xq (3), rtau (3, 48, nat), at (3, 3), bg (3, 3), &
|
|
|
|
gi (3, 48), gimq (3)
|
|
|
|
! input: the q point
|
|
|
|
! input: the R associated to each tau
|
|
|
|
! input: the direct lattice vectors
|
|
|
|
! input: the reciprocal lattice vectors
|
|
|
|
! output: [S(irotq)*q - q]
|
|
|
|
! output: [S(irotmq)*q + q]
|
|
|
|
|
2003-07-21 21:35:53 +08:00
|
|
|
complex(kind=DP) :: u(3*nat, 3*nat), t(max_irr_dim, max_irr_dim, 48, 3*nat),&
|
2003-01-28 00:42:47 +08:00
|
|
|
tmq (max_irr_dim, max_irr_dim, 3 * nat)
|
2003-01-20 05:58:50 +08:00
|
|
|
! output: the pattern vectors
|
|
|
|
! output: the symmetry matrices
|
|
|
|
! output: the matrice sending q -> -q+G
|
2003-02-08 00:04:36 +08:00
|
|
|
logical :: minus_q
|
2004-03-07 21:47:42 +08:00
|
|
|
! output: if true one symmetry send q -> -q+G
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! here the local variables
|
|
|
|
!
|
|
|
|
integer :: na, imode, jmode, ipert, jpert, nsymtot, imode0, irr, &
|
|
|
|
ipol, jpol, isymq, irot, sna
|
2004-03-07 21:47:42 +08:00
|
|
|
! counters and auxilary variables
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
real(kind=DP) :: modul, arg
|
2003-01-20 05:58:50 +08:00
|
|
|
! the modulus of the mode
|
|
|
|
! the argument of the phase
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
complex(kind=DP) :: wrk_u (3, nat), wrk_ru (3, nat), fase
|
2003-01-20 05:58:50 +08:00
|
|
|
! one pattern
|
|
|
|
! the rotated of one pattern
|
|
|
|
! the phase factor
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
logical :: lgamma
|
2003-01-20 05:58:50 +08:00
|
|
|
! if true gamma point
|
|
|
|
!
|
|
|
|
! Allocate the necessary quantities
|
|
|
|
!
|
2004-03-07 21:47:42 +08:00
|
|
|
lgamma = (xq (1) == 0.d0 .and. xq (2) == 0.d0 .and. xq (3) == 0.d0)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! find the small group of q
|
|
|
|
!
|
2003-01-28 00:42:47 +08:00
|
|
|
call smallgq (xq, at, bg, s, nsym, irgq, nsymq, irotmq, minus_q, gi, gimq)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! set the modes to be done
|
|
|
|
!
|
2004-03-07 21:47:42 +08:00
|
|
|
u (:, :) = (0.d0, 0.d0)
|
2003-02-08 00:04:36 +08:00
|
|
|
do imode = 1, 3 * nat
|
|
|
|
u (imode, imode) = (1.d0, 0.d0)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
!
|
|
|
|
! Here we count the irreducible representations and their dimensions
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
nirr = 3 * nat
|
2004-03-07 21:47:42 +08:00
|
|
|
! initialization
|
|
|
|
npert (:) = 1
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! And we compute the matrices which represent the symmetry transformat
|
|
|
|
! in the basis of the displacements
|
|
|
|
!
|
2004-03-07 21:47:42 +08:00
|
|
|
|
|
|
|
t(:, :, :, :) = (0.d0, 0.d0)
|
|
|
|
tmq (:, :, :) = (0.d0, 0.d0)
|
2003-02-08 00:04:36 +08:00
|
|
|
if (minus_q) then
|
|
|
|
nsymtot = nsymq + 1
|
|
|
|
else
|
|
|
|
nsymtot = nsymq
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2004-03-07 21:47:42 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
do isymq = 1, nsymtot
|
|
|
|
if (isymq.le.nsymq) then
|
|
|
|
irot = irgq (isymq)
|
|
|
|
else
|
|
|
|
irot = irotmq
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
imode0 = 0
|
|
|
|
do irr = 1, nirr
|
|
|
|
do ipert = 1, npert (irr)
|
|
|
|
imode = imode0 + ipert
|
|
|
|
do na = 1, nat
|
|
|
|
do ipol = 1, 3
|
|
|
|
jmode = 3 * (na - 1) + ipol
|
|
|
|
wrk_u (ipol, na) = u (jmode, imode)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
!
|
|
|
|
! transform this pattern to crystal basis
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
do na = 1, nat
|
|
|
|
call trnvecc (wrk_u (1, na), at, bg, - 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
!
|
|
|
|
! the patterns are rotated with this symmetry
|
|
|
|
!
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk_ru(:,:) = (0.d0, 0.d0)
|
2003-02-08 00:04:36 +08:00
|
|
|
do na = 1, nat
|
|
|
|
sna = irt (irot, na)
|
|
|
|
arg = 0.d0
|
|
|
|
do ipol = 1, 3
|
|
|
|
arg = arg + xq (ipol) * rtau (ipol, irot, na)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
arg = arg * tpi
|
2004-03-07 21:47:42 +08:00
|
|
|
if (isymq == nsymtot .and. minus_q) then
|
2003-02-08 00:04:36 +08:00
|
|
|
fase = DCMPLX (cos (arg), sin (arg) )
|
|
|
|
else
|
|
|
|
fase = DCMPLX (cos (arg), - sin (arg) )
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
do ipol = 1, 3
|
|
|
|
do jpol = 1, 3
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk_ru (ipol, sna) = wrk_ru (ipol, sna) + fase * &
|
|
|
|
s (jpol, ipol, irot) * wrk_u (jpol, na)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
!
|
|
|
|
! Transform back the rotated pattern
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
do na = 1, nat
|
|
|
|
call trnvecc (wrk_ru (1, na), at, bg, 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
!
|
|
|
|
! Computes the symmetry matrices on the basis of the pattern
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
do jpert = 1, npert (irr)
|
|
|
|
imode = imode0 + jpert
|
|
|
|
do na = 1, nat
|
|
|
|
do ipol = 1, 3
|
|
|
|
jmode = ipol + (na - 1) * 3
|
2004-03-07 21:47:42 +08:00
|
|
|
if (isymq == nsymtot .and. minus_q) then
|
|
|
|
tmq (jpert, ipert, irr) = tmq (jpert, ipert, irr) + &
|
|
|
|
conjg (u (jmode, imode) * wrk_ru (ipol, na) )
|
2003-02-08 00:04:36 +08:00
|
|
|
else
|
2003-01-20 05:58:50 +08:00
|
|
|
t (jpert, ipert, irot, irr) = t (jpert, ipert, irot, irr) &
|
|
|
|
+ conjg (u (jmode, imode) ) * wrk_ru (ipol, na)
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
imode0 = imode0 + npert (irr)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
2003-11-06 03:01:20 +08:00
|
|
|
! WRITE( stdout,*) 'nsymq',nsymq
|
2003-01-20 05:58:50 +08:00
|
|
|
! do isymq=1,nsymq
|
|
|
|
! irot=irgq(isymq)
|
2003-11-06 03:01:20 +08:00
|
|
|
! WRITE( stdout,'("t(1,1,irot,modenum)",i5,2f10.5)')
|
2003-01-20 05:58:50 +08:00
|
|
|
! + irot,t(1,1,irot,modenum)
|
|
|
|
! enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
end subroutine set_irr_mode
|