Rotations, orientations and angular momentum#

Euler angles (z-y’-z’’ convention, radians), rotation matrices and quaternions, orientation grids for powder averages, and angular momentum algebra (Wigner symbols, spherical harmonics, irreducible spherical tensor operators).

Rotations#

erot

Passive rotation matrix from Euler angles (z-y'-z'' convention).

eulang

Extract z-y'-z'' Euler angles from a rotation matrix.

euler2quat

Convert z-y'-z'' Euler angles to a unit quaternion.

quat2euler

Convert a unit quaternion to z-y'-z'' Euler angles.

quat2rotmat

Convert a unit quaternion to a rotation matrix.

rotmat2quat

Convert a rotation matrix to a unit quaternion.

rotaxi2mat

Rotation matrix from an axis and angle (Rodrigues formula).

rotmat2axi

Extract the rotation axis and angle from a rotation matrix.

quatinv

Invert a unit quaternion (= conjugate).

quatmult

Quaternion multiplication (Hamilton product) q ⊗ r.

quatvecmult

Rotate a 3-vector (or batch of vectors) by a unit quaternion.

rotateframe

Rotate an Euler frame around a rotation axis.

vec2ang

Convert a Cartesian 3-vector to polar angles (phi, theta).

ang2vec

Convert polar angles to a unit Cartesian 3-vector.

tensor_cart2sph

Convert a 3×3 Cartesian tensor to rank-2 spherical tensor components.

tensor_sph2cart

Convert rank-2 spherical tensor components to a 3×3 Cartesian tensor.

Orientation grids and selection#

sphgrid

Return a spherical powder-averaging grid.

sphrand

Generate N random orientations uniformly distributed on the sphere.

photoselect

Compute photo-selection weight.

Angular momentum#

wigner3j

Wigner 3-j symbol.

wigner6j

Wigner 6-j symbol.

wignerd

Wigner rotation matrix D^J (or reduced d^J).

clebschgordan

Clebsch-Gordan coefficient <j1,m1; j2,m2 | j,m>.

cgmatrix

Transformation matrix between uncoupled and coupled spin representations.

spherharm

Spherical harmonic Y_L^M(theta, phi).

plegendre

Compute associated Legendre polynomial \(P_L^M(z)\).

isto

Irreducible spherical tensor operator T^k_q.

isto2stev

Transformation matrix from ISTOs to Stevens operators.