24 use,
intrinsic :: iso_fortran_env
54 integer :: rot_red(1:3, 1:3)
55 integer :: rot_red_inv(1:3, 1:3)
56 real(real64),
public :: rot_cart(1:3, 1:3)
57 real(real64) :: trans_red(1:3)
58 real(real64) :: trans_cart(1:3)
90 real(real64),
public,
parameter :: tol_translation = 1e-7_real64
91 real(real64),
parameter :: tol_identity = 5.0e-6_real64
97 type(symm_op_t),
intent(out) :: this
98 integer,
intent(in) :: rot(:, :)
99 type(lattice_vectors_t),
intent(in) :: latt
100 integer,
intent(in) :: dim
101 real(real64),
optional,
intent(in) :: trans(:)
114 this%rot_red(1:dim, 1:dim) = rot(1:dim, 1:dim)
116 this%rot_red(idim,idim) = 1
122 this%rot_red_inv(1,1) = +(this%rot_red(2,2)*this%rot_red(3,3) - this%rot_red(2,3)*this%rot_red(3,2))
123 this%rot_red_inv(2,1) = -(this%rot_red(2,1)*this%rot_red(3,3) - this%rot_red(2,3)*this%rot_red(3,1))
124 this%rot_red_inv(3,1) = +(this%rot_red(2,1)*this%rot_red(3,2) - this%rot_red(2,2)*this%rot_red(3,1))
125 this%rot_red_inv(1,2) = -(this%rot_red(1,2)*this%rot_red(3,3) - this%rot_red(1,3)*this%rot_red(3,2))
126 this%rot_red_inv(2,2) = +(this%rot_red(1,1)*this%rot_red(3,3) - this%rot_red(1,3)*this%rot_red(3,1))
127 this%rot_red_inv(3,2) = -(this%rot_red(1,1)*this%rot_red(3,2) - this%rot_red(1,2)*this%rot_red(3,1))
128 this%rot_red_inv(1,3) = +(this%rot_red(1,2)*this%rot_red(2,3) - this%rot_red(1,3)*this%rot_red(2,2))
129 this%rot_red_inv(2,3) = -(this%rot_red(1,1)*this%rot_red(2,3) - this%rot_red(1,3)*this%rot_red(2,1))
130 this%rot_red_inv(3,3) = +(this%rot_red(1,1)*this%rot_red(2,2) - this%rot_red(1,2)*this%rot_red(2,1))
132 this%trans_red(1:3) =
m_zero
133 if (
present(trans))
then
134 this%trans_red(1:dim) = trans(1:dim)
148 integer,
intent(in) :: dim
158 this%rot_cart(1:dim, 1:dim) = matmul(latt%rlattice(1:dim, 1:dim), &
159 matmul(this%rot_red(1:dim, 1:dim),transpose(latt%klattice(1:dim, 1:dim))/ (
m_two *
m_pi)))
161 this%rot_cart(idim,idim) =
m_one
164 this%trans_cart(1:3) =
m_zero
166 this%trans_cart(1:dim) = latt%red_to_cart(this%trans_red(1:dim))
170 if (any(abs(matmul(this%rot_cart,transpose(this%rot_cart)) &
171 -reshape((/1, 0, 0, 0, 1, 0, 0, 0, 1/), (/3, 3/)))>tol_identity))
then
172 message(1) =
"Internal error: This matrix is not a rotation matrix"
173 write(
message(2),
'(3(3f19.13,2x))') this%rot_cart
175 write(
message(4),
'(3(3f19.13,2x))') latt%rlattice
189 outp%rot_red(1:3, 1:3) = inp%rot_red(1:3, 1:3)
190 outp%rot_red_inv(1:3, 1:3) = inp%rot_red_inv(1:3, 1:3)
191 outp%trans_red(1:3) = inp%trans_red(1:3)
192 outp%rot_cart(1:3, 1:3) = inp%rot_cart(1:3, 1:3)
193 outp%trans_cart(1:3) = inp%trans_cart(1:3)
201 real(real64),
intent(in) :: prec
203 has = any(abs(this%trans_red(1:this%dim)) >= prec)
211 integer :: matrix(1:this%dim, 1:this%dim)
213 matrix(1:this%dim, 1:this%dim) = this%rot_red(1:this%dim, 1:this%dim)
221 real(real64) :: matrix(1:this%dim, 1:this%dim)
223 matrix(1:this%dim, 1:this%dim) = this%rot_cart(1:this%dim, 1:this%dim)
232 real(real64) :: vector(1:this%dim)
234 vector(1:this%dim) = this%trans_red(1:this%dim)
242 real(real64) :: vector(1:this%dim)
244 vector(1:this%dim) = this%trans_cart(1:this%dim)
254 is_identity = is_identity .and. all(abs(this%trans_red) <
tol_translation)
255 is_identity = is_identity .and. all(abs(this%rot_red(:, 1) - (/ m_one, m_zero, m_zero/)) <
tol_identity)
256 is_identity = is_identity .and. all(abs(this%rot_red(:, 2) - (/ m_zero, m_one, m_zero/)) <
tol_identity)
257 is_identity = is_identity .and. all(abs(this%rot_red(:, 3) - (/ m_zero, m_zero, m_one/)) <
tol_identity)
265 integer,
intent(in) :: aa(:)
266 integer :: bb(1:this%dim)
276 integer,
intent(in) :: aa(:)
277 integer :: bb(1:this%dim)
285#include "symm_op_inc.F90"
288#include "complex.F90"
289#include "symm_op_inc.F90"
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_pi
some mathematical constants
real(real64), parameter, public m_one
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
logical pure function zsymm_op_invariant_cart(this, aa, prec)
pure real(real64) function, dimension(1:this%dim) dsymm_op_apply_red(this, aa)
subroutine, public symm_op_copy(inp, outp)
pure real(real64) function, dimension(1:this%dim) dsymm_op_apply_inv_red(this, aa)
pure real(real64) function, dimension(1:this%dim) dsymm_op_apply_transpose_red(this, aa)
pure complex(real64) function, dimension(1:this%dim) zsymm_op_apply_cart(this, aa)
real(real64) function, dimension(1:this%dim), public symm_op_translation_vector_red(this)
logical pure function, public symm_op_has_translation(this, prec)
logical pure function dsymm_op_invariant_red(this, aa, prec)
real(real64) function, dimension(1:this%dim, 1:this%dim), public symm_op_rotation_matrix_cart(this)
pure complex(real64) function, dimension(1:this%dim) zsymm_op_apply_transpose_red(this, aa)
pure real(real64) function, dimension(1:this%dim) dsymm_op_apply_cart(this, aa)
integer function, dimension(1:this%dim, 1:this%dim), public symm_op_rotation_matrix_red(this)
logical pure function, public symm_op_is_identity(this)
pure complex(real64) function, dimension(1:this%dim) zsymm_op_apply_red(this, aa)
pure complex(real64) function, dimension(1:this%dim) zsymm_op_apply_inv_red(this, aa)
pure complex(real64) function, dimension(1:this%dim) zsymm_op_apply_inv_cart(this, aa, rotation_only)
integer function, dimension(1:this%dim) isymm_op_apply_inv_red(this, aa)
real(real64), parameter tol_identity
real(real64), parameter, public tol_translation
pure real(real64) function, dimension(1:this%dim) dsymm_op_apply_inv_cart(this, aa, rotation_only)
real(real64) function, dimension(1:this%dim), public symm_op_translation_vector_cart(this)
subroutine, public symm_op_build_cartesian(this, latt, dim)
Computes the Cartesian rotation matrix and translation vectors from the reduced ones.
logical pure function dsymm_op_invariant_cart(this, aa, prec)
pure integer function, dimension(1:this%dim) isymm_op_apply_red(this, aa)
subroutine, public symm_op_init(this, rot, latt, dim, trans)
logical pure function zsymm_op_invariant_red(this, aa, prec)