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 smallgq (xq, at, bg, s, nsym, irgq, nsymq, irotmq, &
|
|
|
|
minus_q, gi, gimq)
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! This routine selects, among the symmetry matrices of the point group
|
|
|
|
! of a crystal, the symmetry operations which leave q unchanged.
|
|
|
|
! Furthermore it checks if one of the matrices send q <-> -q+G. In
|
|
|
|
! this case minus_q is set true.
|
|
|
|
!
|
|
|
|
! Revised 2 Sept. 1995 by Andrea Dal Corso
|
|
|
|
! Modified 22 April 1997 by SdG: minus_q is sought also among sym.op.
|
|
|
|
! such that Sq=q+G (i.e. the case q=-q+G is dealt with).
|
|
|
|
!
|
|
|
|
#include"machine.h"
|
|
|
|
!
|
|
|
|
! The dummy variables
|
|
|
|
!
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, only : DP
|
2003-02-08 00:04:36 +08:00
|
|
|
implicit none
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
real(kind=DP) :: bg (3, 3), at (3, 3), xq (3), gi (3, 48), gimq (3)
|
2003-01-20 05:58:50 +08:00
|
|
|
! input: the reciprocal lattice vectors
|
|
|
|
! input: the direct lattice vectors
|
|
|
|
! input: the q point of the crystal
|
2004-03-07 21:47:42 +08:00
|
|
|
! output: the G associated to a symmetry:[S(irotq)*q - q]
|
2003-01-20 05:58:50 +08:00
|
|
|
! output: the G associated to: [S(irotmq)*q + q]
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: s (3, 3, 48), irgq (48), irotmq, nsymq, nsym
|
2003-01-20 05:58:50 +08:00
|
|
|
! input: the symmetry matrices
|
|
|
|
! output: the symmetry of the small group
|
|
|
|
! output: op. symmetry: s_irotmq(q)=-q+G
|
|
|
|
! output: dimension of the small group of q
|
|
|
|
! input: dimension of the point group
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
logical :: minus_q
|
2004-03-07 21:47:42 +08:00
|
|
|
! input: .t. if sym.ops. such that Sq=-q+G are searched for
|
|
|
|
! output: .t. if such a symmetry has been found
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
real(kind=DP) :: wrk (3), aq (3), raq (3), zero (3)
|
2003-01-20 05:58:50 +08:00
|
|
|
! additional space to compute gi and gimq
|
|
|
|
! q vector in crystal basis
|
|
|
|
! the rotated of the q vector
|
|
|
|
! the zero vector
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: isym, ipol, jpol
|
2003-01-20 05:58:50 +08:00
|
|
|
! counter on symmetry operations
|
|
|
|
! counter on polarizations
|
|
|
|
! counter on polarizations
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
logical :: look_for_minus_q, eqvect
|
2004-03-07 21:47:42 +08:00
|
|
|
! .t. if sym.ops. such that Sq=-q+G are searched for
|
|
|
|
! logical function, check if two vectors are equal
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Set to zero some variables and transform xq to the crystal basis
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
look_for_minus_q = minus_q
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
minus_q = .false.
|
2004-03-07 21:47:42 +08:00
|
|
|
zero = 0.d0
|
|
|
|
gi = 0.d0
|
|
|
|
gimq = 0.d0
|
|
|
|
aq = xq
|
2003-02-08 00:04:36 +08:00
|
|
|
call cryst_to_cart (1, aq, at, - 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! test all symmetries to see if the operation S sends q in q+G ...
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
nsymq = 0
|
|
|
|
do isym = 1, nsym
|
2004-03-07 21:47:42 +08:00
|
|
|
raq = 0.d0
|
2003-02-08 00:04:36 +08:00
|
|
|
do ipol = 1, 3
|
|
|
|
do jpol = 1, 3
|
2004-03-07 21:47:42 +08:00
|
|
|
raq (ipol) = raq (ipol) + float (s (ipol, jpol, isym) ) * &
|
|
|
|
aq (jpol)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
if (eqvect (raq, aq, zero) ) then
|
|
|
|
nsymq = nsymq + 1
|
|
|
|
irgq (nsymq) = isym
|
|
|
|
do ipol = 1, 3
|
|
|
|
wrk (ipol) = raq (ipol) - aq (ipol)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
call cryst_to_cart (1, wrk, bg, 1)
|
2004-03-07 21:47:42 +08:00
|
|
|
gi (:, nsymq) = wrk (:)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! ... and in -q+G
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
if (look_for_minus_q.and..not.minus_q) then
|
2004-03-07 21:47:42 +08:00
|
|
|
raq (:) = - raq(:)
|
2003-02-08 00:04:36 +08:00
|
|
|
if (eqvect (raq, aq, zero) ) then
|
|
|
|
minus_q = .true.
|
|
|
|
irotmq = isym
|
|
|
|
do ipol = 1, 3
|
|
|
|
wrk (ipol) = - raq (ipol) + aq (ipol)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
call cryst_to_cart (1, wrk, bg, 1)
|
2004-03-07 21:47:42 +08:00
|
|
|
gimq (:) = wrk (:)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
!
|
|
|
|
! if xq=(0,0,0) minus_q always apply with the identity operation
|
|
|
|
!
|
2004-03-07 21:47:42 +08:00
|
|
|
if (xq (1) == 0.d0 .and. xq (2) == 0.d0 .and. xq (3) == 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
minus_q = .true.
|
|
|
|
irotmq = 1
|
2004-03-07 21:47:42 +08:00
|
|
|
gimq = 0.d0
|
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
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
end subroutine smallgq
|