Cartesius Library
rotations Module Reference

Collects functions devoted to rotations of Rˆ3 space. More...

Data Types

interface  assignment(=)
 
interface  operator(*)
 
interface  operator(.det.)
 
interface  operator(.inv.)
 
type  rotation
 @TODO Add ten more types of triples of angles to be used to define rotations, then one more type of triple of angles: rotation angle and two angles defining the rotation axis. This seems to be all... More...
 
type  xyzangles
 
type  zyzangles
 

Functions/Subroutines

complex function harmonics_r_to_c_coef (l, mc, mr)
 Returns the coefficient of transformation from real (cubic) to complex (spherical) basis <j,mc(complex)|j,mr(real)> More...
 
complex function harmonics_c_to_r_coef (l, mr, mc)
 Returns the coefficient of transformation from complex (spherical) to real (cubic) basis <j,mr(real)|j,mc(complex)> More...
 
subroutine setmatricestotransformsphericaltocubic (sphericalToCubicMatrices)
 @TODO This should not be done in a subroutine. We need to define these matrices explicitly as a public variable (see above). More...
 
subroutine xrot (angle, rm)
 
subroutine yrot (angle, rm)
 
subroutine zrot (angle, rm)
 
type(rotation) function, private r_mult_r (r1, r2)
 
real function det_r (rin)
 
type(rotation) function, private inv_r (rin)
 
subroutine r_to_r (r_result, r_source)
 
subroutine array_to_r (r_result, array_source)
 
subroutine, private xyz_to_r (rm, Angles)
 
subroutine, private zyz_to_r (rm, Angles)
 
subroutine, private q_to_r (rm, q)
 Returns an SO(3) rotation matrix corresponding to the given rotation quaternion. More...
 
subroutine av_to_q (q, a, v)
 Returns a quaternion corresponding to a rotation around the given vector by the given angle. More...
 
subroutine av_to_r (r, a, v)
 Returns an SO(3) rotation matrix corresponding to a rotation around the given vector by the given angle. More...
 
type(vector) function rot_vec (rot, vin)
 
type(point) function rot_point (rot, pin)
 
subroutine wignermatrixelementforrealharmonics_cayleyklein (l, m1, m2, ck_a, ck_b, matrixElement)
 Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over cubic harmonics from the Cayley-Klein parameters, describing rotation. More...
 
subroutine wignermatrixelementforrealharmonics_eulerangles (l, m1, m2, alpha, beta, gamma, matrixElement)
 Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over cubic harmonics from the Euler Angles, describing rotation. More...
 
real function wignermatrixelementreal_eulerangles_fn (l, m1, m2, alpha, beta, gamma)
 Returns the value of the Wigner D-matrix element, describing rotation of a real (cubic) harmonic, in ZYZ convention. More...
 
subroutine wignermatrixelement_cayleyklein (l, m1, m2, ck_a, ck_b, matrixElement)
 Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over spherical harmonics from the Cayley-Klein parameters, describing rotation. More...
 
subroutine wignermatrixelement_eulerangles (l, m1, m2, alpha, beta, gamma, matrixElement)
 Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over spherical harmonics from the Euler angles, describing rotation. Used expression comes from eqs. (1) and (5) of chapter 4.3. from the book of Varshalovich book (in Russian) p.68. Please, note ZYZ convention for Euler angles is used in this book, thus we also use this convention when calculating Euler angles for the transformation of the laboratory frame to the local one (see module 'particles.f90'. More...
 
complex function wignermatrixelement_eulerangles_fn (l, m1, m2, alpha, beta, gamma)
 
real function wignersmalldmatrixelement_eulerangles_fn (l, m1, m2, beta)
 Returns the value of the Wigner small d-matrix element, which specifies coefficients for rotation a complex (spherical) harmonic around the Y axis. More...
 
subroutine geteuleranglesforrotation (somePoint, alpha, beta, gamma)
 
subroutine getcayleykleinforrotation (somePoint, a, b)
 
subroutine eulerangles_to_cayleyklein (alpha, beta, gamma, ck_a, ck_b)
 

Variables

type(complex_matrix), dimension(0:3), public sphericaltocubicmatrices
 
complex, dimension(0:0, 0:0), public harmonicstransform_s = cmplx(1.0, 0.0)
 Global variable containing matrices transforming spherical harmonics for l=0 to the cubic ones. More...
 
complex, dimension(-1:1,-1:1), public harmonicstransform_p = reshape( [cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,sq0p5), cmplx(0.0,0.0),cmplx(1.0,0.0),cmplx(0.0,0.0), cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0)], [3,3])
 Global variable containing matrices transforming spherical harmonics for l=1 to the cubic ones. More...
 
complex, dimension(-2:2,-2:2), public harmonicstransform_d = reshape( [cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,-sq0p5), cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(1.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0),cmplx(0.0,0.0), cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(sq0p5,0.0)], [5,5])
 Global variable containing matrices transforming spherical harmonics for l=2 to the cubic ones. More...
 
complex, dimension(-3:3,-3:3), public harmonicstransform_f = reshape( [cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,sq0p5), cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,-sq0p5),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(1.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0), cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0)], [7,7])
 Global variable containing matrices transforming spherical harmonics for l=3 to the cubic ones. More...
 

Detailed Description

Collects functions devoted to rotations of Rˆ3 space.

Author
Andrei Tchougreeff and Ilya Popov.

Function/Subroutine Documentation

◆ array_to_r()

subroutine rotations::array_to_r ( type (rotation), intent(out)  r_result,
real, dimension(1:3,1:3), intent(in)  array_source 
)

◆ av_to_q()

subroutine rotations::av_to_q ( type(quaternion), intent(out)  q,
real, intent(in)  a,
type(vector), intent(in)  v 
)

Returns a quaternion corresponding to a rotation around the given vector by the given angle.

◆ av_to_r()

subroutine rotations::av_to_r ( type(rotation), intent(out)  r,
real, intent(in)  a,
type(vector), intent(in)  v 
)

Returns an SO(3) rotation matrix corresponding to a rotation around the given vector by the given angle.

Here is the call graph for this function:

◆ det_r()

real function rotations::det_r ( type(rotation), intent(in)  rin)

◆ eulerangles_to_cayleyklein()

subroutine rotations::eulerangles_to_cayleyklein ( real, intent(in)  alpha,
real, intent(in)  beta,
real, intent(in)  gamma,
complex, intent(out)  ck_a,
complex, intent(out)  ck_b 
)

◆ getcayleykleinforrotation()

subroutine rotations::getcayleykleinforrotation ( type(point), intent(in)  somePoint,
complex, intent(out)  a,
complex, intent(out)  b 
)
Here is the call graph for this function:

◆ geteuleranglesforrotation()

subroutine rotations::geteuleranglesforrotation ( type(point), intent(in)  somePoint,
real, intent(out)  alpha,
real, intent(out)  beta,
real, intent(out)  gamma 
)
Remarks
corrected to ZYZ convention

◆ harmonics_c_to_r_coef()

complex function rotations::harmonics_c_to_r_coef ( integer, intent(in)  l,
integer, intent(in)  mr,
integer, intent(in)  mc 
)

Returns the coefficient of transformation from complex (spherical) to real (cubic) basis <j,mr(real)|j,mc(complex)>

Here is the call graph for this function:

◆ harmonics_r_to_c_coef()

complex function rotations::harmonics_r_to_c_coef ( integer, intent(in)  l,
integer, intent(in)  mc,
integer, intent(in)  mr 
)

Returns the coefficient of transformation from real (cubic) to complex (spherical) basis <j,mc(complex)|j,mr(real)>

◆ inv_r()

type(rotation) function, private rotations::inv_r ( type(rotation), intent(in)  rin)
private

◆ q_to_r()

subroutine, private rotations::q_to_r ( type(rotation), intent(out)  rm,
type(quaternion), intent(in)  q 
)
private

Returns an SO(3) rotation matrix corresponding to the given rotation quaternion.

◆ r_mult_r()

type(rotation) function, private rotations::r_mult_r ( type(rotation), intent(in)  r1,
type(rotation), intent(in)  r2 
)
private

◆ r_to_r()

subroutine rotations::r_to_r ( type (rotation), intent(out)  r_result,
type (rotation), intent(in)  r_source 
)

◆ rot_point()

type(point) function rotations::rot_point ( type(rotation), intent(in)  rot,
type(point), intent(in)  pin 
)

◆ rot_vec()

type(vector) function rotations::rot_vec ( type(rotation), intent(in)  rot,
type(vector), intent(in)  vin 
)

◆ setmatricestotransformsphericaltocubic()

subroutine rotations::setmatricestotransformsphericaltocubic ( type(complex_matrix), dimension(0:3), intent(inout)  sphericalToCubicMatrices)

@TODO This should not be done in a subroutine. We need to define these matrices explicitly as a public variable (see above).

◆ wignermatrixelement_cayleyklein()

subroutine rotations::wignermatrixelement_cayleyklein ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
complex, intent(in)  ck_a,
complex, intent(in)  ck_b,
complex, intent(out)  matrixElement 
)

Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over spherical harmonics from the Cayley-Klein parameters, describing rotation.

◆ wignermatrixelement_eulerangles()

subroutine rotations::wignermatrixelement_eulerangles ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
real, intent(in)  alpha,
real, intent(in)  beta,
real, intent(in)  gamma,
complex, intent(out)  matrixElement 
)

Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over spherical harmonics from the Euler angles, describing rotation. Used expression comes from eqs. (1) and (5) of chapter 4.3. from the book of Varshalovich book (in Russian) p.68. Please, note ZYZ convention for Euler angles is used in this book, thus we also use this convention when calculating Euler angles for the transformation of the laboratory frame to the local one (see module 'particles.f90'.

@attenion This calculates the matrix elements based on the assumption that we are rotating in reverse. Shouldn't we make the matrix by following the correct formula, and pass the reverse angles in other modules for clarity?

Remarks
Remark to Dima's attention message: yes, I've corrected it in this way (see orbitals.f90 also).
Warning
This is the test of the usage of the formula in Doxygen the formula itself needs to be checked

\[ D_{m'm}^{l}\left(\pi-\gamma,\beta,\pi-\alpha\right)=e^{im'\left(\pi-\gamma\right)}d_{m'm}\left(\beta\right) e^{im\left(\pi-\alpha\right)}=e^{-im'\gamma}d_{m'm}^{l}\left(\beta\right)e^{-im\alpha}\] \]

Here is the call graph for this function:

◆ wignermatrixelement_eulerangles_fn()

complex function rotations::wignermatrixelement_eulerangles_fn ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
real, intent(in)  alpha,
real, intent(in)  beta,
real, intent(in)  gamma 
)
Here is the call graph for this function:

◆ wignermatrixelementforrealharmonics_cayleyklein()

subroutine rotations::wignermatrixelementforrealharmonics_cayleyklein ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
complex, intent(in)  ck_a,
complex, intent(in)  ck_b,
real, intent(out)  matrixElement 
)

Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over cubic harmonics from the Cayley-Klein parameters, describing rotation.

Here is the call graph for this function:

◆ wignermatrixelementforrealharmonics_eulerangles()

subroutine rotations::wignermatrixelementforrealharmonics_eulerangles ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
real, intent(in)  alpha,
real, intent(in)  beta,
real, intent(in)  gamma,
real, intent(out)  matrixElement 
)

Subroutine calculates matrix elements (m1,m2) of the Wigner D-matrix (Dˆl) over cubic harmonics from the Euler Angles, describing rotation.

Here is the call graph for this function:

◆ wignermatrixelementreal_eulerangles_fn()

real function rotations::wignermatrixelementreal_eulerangles_fn ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
real, intent(in)  alpha,
real, intent(in)  beta,
real, intent(in)  gamma 
)

Returns the value of the Wigner D-matrix element, describing rotation of a real (cubic) harmonic, in ZYZ convention.

Here is the call graph for this function:

◆ wignersmalldmatrixelement_eulerangles_fn()

real function rotations::wignersmalldmatrixelement_eulerangles_fn ( integer, intent(in)  l,
integer, intent(in)  m1,
integer, intent(in)  m2,
real, intent(in)  beta 
)

Returns the value of the Wigner small d-matrix element, which specifies coefficients for rotation a complex (spherical) harmonic around the Y axis.

\[ d^{l}_{m_{1}m_{2}}\left(\beta\right)= \sqrt{\left(j-m_{1}\right)!\left(j+m_{1}\right)!\left(j-m_{2}\right)!\left(j+m_{2}\right)!} \sum_{h=h_{min}}^{h_{max}}\left(-1\right)^{m_{1}-m_{2}+h} \frac{\left(\cos\frac{\beta}{2}\right)^{2j+m_{2}-m_{1}-2h}\left(\sin\frac{\beta}{2}\right)^{m_{1}-m_{2}+2h}} {h!\left(m_{1}-m_{2}+h\right)!\left(j-m_{1}-h\right)!\left(j+m_{2}-h\right)!} \]

◆ xrot()

subroutine rotations::xrot ( real, intent(in)  angle,
type(rotation), intent(out)  rm 
)

◆ xyz_to_r()

subroutine, private rotations::xyz_to_r ( type(rotation), intent(out)  rm,
type(xyzangles), intent(in)  Angles 
)
private

◆ yrot()

subroutine rotations::yrot ( real, intent(in)  angle,
type(rotation), intent(out)  rm 
)

◆ zrot()

subroutine rotations::zrot ( real, intent(in)  angle,
type(rotation), intent(out)  rm 
)

◆ zyz_to_r()

subroutine, private rotations::zyz_to_r ( type(rotation), intent(out)  rm,
type(zyzangles), intent(in)  Angles 
)
private

Variable Documentation

◆ harmonicstransform_d

complex, dimension(-2:2,-2:2), public rotations::harmonicstransform_d = reshape( [cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,-sq0p5), cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(1.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0),cmplx(0.0,0.0), cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(sq0p5,0.0)], [5,5])

Global variable containing matrices transforming spherical harmonics for l=2 to the cubic ones.

◆ harmonicstransform_f

complex, dimension(-3:3,-3:3), public rotations::harmonicstransform_f = reshape( [cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,sq0p5), cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,-sq0p5),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(1.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0), cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(sq0p5,0.0),cmplx(0.0,0.0), cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0)], [7,7])

Global variable containing matrices transforming spherical harmonics for l=3 to the cubic ones.

◆ harmonicstransform_p

complex, dimension(-1:1,-1:1), public rotations::harmonicstransform_p = reshape( [cmplx(0.0,sq0p5),cmplx(0.0,0.0),cmplx(0.0,sq0p5), cmplx(0.0,0.0),cmplx(1.0,0.0),cmplx(0.0,0.0), cmplx(sq0p5,0.0),cmplx(0.0,0.0),cmplx(-sq0p5,0.0)], [3,3])

Global variable containing matrices transforming spherical harmonics for l=1 to the cubic ones.

◆ harmonicstransform_s

complex, dimension(0:0,0:0), public rotations::harmonicstransform_s = cmplx(1.0, 0.0)

Global variable containing matrices transforming spherical harmonics for l=0 to the cubic ones.

◆ sphericaltocubicmatrices

type(complex_matrix), dimension(0:3), public rotations::sphericaltocubicmatrices
Todo:
Remove mention of sphricalToCubic matrices and harmonicstransform_(spdf) matrices. There is a generic function to get the correct coefficient
See also
harmonics_r_to_c_coef(l,mc,mr)