! !----------------------------------------------------------------------- subroutine reset_sym (xq, nsym, s, invs, irt, rtau) !----------------------------------------------------------------------- ! ! output values of symmetry arrays (nsym, s, rtau, irt) are those ! appropriate to the small-qroup of q. ! ! #include "f_defs.h" USE io_global, ONLY : stdout USE kinds, only : DP USE phcom USE pwcom USE ions_base USE control_flags, only : iswitch, iverbosity, noinv, modenum ! implicit none real(kind=DP) :: xq (3) ! input: q vector !-output variables integer :: nsym, s (3, 3, 48), invs (48), irt (48, nat) ! output: number of symmetry operations ! output: the first nq matrices are those that generate the star of q ! starting from it ! output: list of inverse operation indices ! output: for each atom gives the rotated atom real(kind=DP) :: rtau (3, 48, nat), sxq (3, 48) ! output: for each atom and rotation gives the R vector involved ! output: list of vectors in the star of q ! ! Local variables ! integer :: nsq (48), nrot, isym, jsym, ism1, table (48, 48), & iq, i, j, nks0, npk0, izero ! number of symmetry ops. of bravais lattice. ! counters on symmetry ops. ! index of inverse of isym ! group table ! counter on q-vectors ! generic counter ! number of dummy k-points ! maximum allowed number of dummy k-points ! dummy (zero) value of iswitch passed to sgama real(kind=DP) :: xk0 (3), wk0(1), zero (3), mdum(3,nat) ! auxiliary list of q (crystal coordinates) ! input q in crystal coordinates ! rotated q in crystal coordinates ! coordinates of fractionary translations ! dummy k-points list ! a zero vector: used in eqvect and as dummy q-vector in sgama logical :: nosym, sym (48) ! .t. if the crystal has inversion ! dummy output from sgama ! input for sgama logical, external :: eqvect ! function used to compare two vectors ! ! initialize dummy k-point list and zero vector ! izero = 0 npk0 = 1 nks0 = 1 wk0(:) = 1.d0 xk0(:)= 0.d0 zero(:) = 0.d0 ! ! generate transformation matrices for the bravais lattice ! if (ibrav == 4 .or. ibrav == 5) then call hexsym (at, s, sname, nrot) elseif (ibrav >= 1 .and. ibrav <= 14) then call cubicsym (at, s, sname, nrot) elseif (ibrav == 0) then if (symm_type == 'cubic') call cubicsym (at, s, sname, nrot) if (symm_type == 'hexagonal') call hexsym (at, s, sname, nrot) else call errore ('star_q', 'wrong ibrav', 1) endif if (noinv) then jsym = 0 do isym = 1, nrot if ( s (1, 3, isym) == 0 .and. s (3, 1, isym) == 0 .and. & s (2, 3, isym) == 0 .and. s (3, 2, isym) == 0 .and. & s (3, 3, isym) == 1) then jsym = jsym + 1 do i = 1, 3 do j = 1, 3 s (i, j, jsym) = s (i, j, isym) enddo enddo sname (jsym) = sname (isym) endif enddo nrot = jsym endif ! ! extract from it the crystal symmetry group by calling sgama ! nosym = .false. call sgama (nrot, nat, s, sname, at, bg, tau, ityp, nsym, nr1, & nr2, nr3, irt, ftau, npk0, nks0, xk0, wk0, invsym, minus_q, xq, & iswitch, modenum, .false., mdum) do isym = 1, nsym sym (isym) = .true. enddo call sgam_ph (at, bg, nsym, s, irt, tau, rtau, nat, sym) ! ! computes the inverse of each matrix ! call multable (nsym, s, table) do isym = 1, nsym do jsym = 1, nsym if (table (isym, jsym) .eq.1) invs (isym) = jsym enddo enddo ! if (nsym.gt.1) then call set_irr (nat, at, bg, xq, s, invs, nsym, rtau, irt, & irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, npert, & nirr, gi, gimq, iverbosity) else call set_irr_nosym (nat, at, bg, xq, s, invs, nsym, rtau, irt, & irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, npert, & nirr, gi, gimq, iverbosity) endif ! return end subroutine reset_sym