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)
93 type(symm_op_t),
intent(out) :: this
94 integer,
intent(in) :: rot(:, :)
95 type(lattice_vectors_t),
intent(in) :: latt
96 integer,
intent(in) :: dim
97 real(real64),
optional,
intent(in) :: trans(:)
110 this%rot_red(1:dim, 1:dim) = rot(1:dim, 1:dim)
112 this%rot_red(idim,idim) = 1
118 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))
119 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))
120 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))
121 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))
122 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))
123 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))
124 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))
125 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))
126 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))
128 this%trans_red(1:3) =
m_zero
129 if (
present(trans))
then
130 this%trans_red(1:dim) = trans(1:dim)
142 type(symm_op_t),
intent(inout) :: this
143 type(lattice_vectors_t),
intent(in) :: latt
144 integer,
intent(in) :: dim
154 this%rot_cart(1:dim, 1:dim) = matmul(latt%rlattice(1:dim, 1:dim), &
155 matmul(this%rot_red(1:dim, 1:dim),transpose(latt%klattice(1:dim, 1:dim))/ (
m_two *
m_pi)))
157 this%rot_cart(idim,idim) =
m_one
160 this%trans_cart(1:3) =
m_zero
162 this%trans_cart(1:dim) = latt%red_to_cart(this%trans_red(1:dim))
166 if (any(abs(matmul(this%rot_cart,transpose(this%rot_cart)) &
167 -reshape((/1, 0, 0, 0, 1, 0, 0, 0, 1/), (/3, 3/)))>5.0e-6_real64))
then
168 message(1) =
"Internal error: This matrix is not a rotation matrix"
169 write(
message(2),
'(3(3f19.13,2x))') this%rot_cart
171 write(
message(4),
'(3(3f19.13,2x))') latt%rlattice
179 type(symm_op_t),
intent(in) :: inp
180 type(symm_op_t),
intent(out) :: outp
185 outp%rot_red(1:3, 1:3) = inp%rot_red(1:3, 1:3)
186 outp%rot_red_inv(1:3, 1:3) = inp%rot_red_inv(1:3, 1:3)
187 outp%trans_red(1:3) = inp%trans_red(1:3)
188 outp%rot_cart(1:3, 1:3) = inp%rot_cart(1:3, 1:3)
189 outp%trans_cart(1:3) = inp%trans_cart(1:3)
197 real(real64),
intent(in) :: prec
199 has = any(abs(this%trans_red(1:this%dim)) >= prec)
207 integer :: matrix(1:this%dim, 1:this%dim)
209 matrix(1:this%dim, 1:this%dim) = this%rot_red(1:this%dim, 1:this%dim)
217 real(real64) :: matrix(1:this%dim, 1:this%dim)
219 matrix(1:this%dim, 1:this%dim) = this%rot_cart(1:this%dim, 1:this%dim)
228 real(real64) :: vector(1:this%dim)
230 vector(1:this%dim) = this%trans_red(1:this%dim)
238 real(real64) :: vector(1:this%dim)
240 vector(1:this%dim) = this%trans_cart(1:this%dim)
250 is_identity = is_identity .and. all(abs(this%trans_red) < 1.0e-5_real64)
251 is_identity = is_identity .and. all(abs(this%rot_red(:, 1) - (/ m_one, m_zero, m_zero/)) < 1.0e-5_real64)
252 is_identity = is_identity .and. all(abs(this%rot_red(:, 2) - (/ m_zero, m_one, m_zero/)) < 1.0e-5_real64)
253 is_identity = is_identity .and. all(abs(this%rot_red(:, 3) - (/ m_zero, m_zero, m_one/)) < 1.0e-5_real64)
261 integer,
intent(in) :: aa(:)
262 integer :: bb(1:this%dim)
272 integer,
intent(in) :: aa(:)
273 integer :: bb(1:this%dim)
281#include "symm_op_inc.F90"
284#include "complex.F90"
285#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)
pure complex(real64) function, dimension(1:this%dim) zsymm_op_apply_inv_cart(this, aa)
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)
pure real(real64) function, dimension(1:this%dim) dsymm_op_apply_inv_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)
integer function, dimension(1:this%dim) isymm_op_apply_inv_red(this, aa)
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)