pyspinw.basis#

Functions for working with different basis vectors

Functions

angle_axis_rotation_matrix(angle_rad, axis)

Get a matrix for rotation by angle_rad radians around the axis axis

demo_angle_axis_rotation_matrix()

Show some plots demonstrating the angle-axis rotations

demo_find_aligned_basis()

Example / test for find_aligned_basis

find_aligned_basis(vectors[, rcond])

Find a set of orthonormal basis vectors aligned with the first being aligned to the input vectors

site_rotations(vectors[, rcond])

Return an aligned basis as an n-by-3-by-3 matrix

pyspinw.basis.angle_axis_rotation_matrix(angle_rad, axis: ndarray)#

Get a matrix for rotation by angle_rad radians around the axis axis

pyspinw.basis.demo_angle_axis_rotation_matrix()#

Show some plots demonstrating the angle-axis rotations

pyspinw.basis.demo_find_aligned_basis()#

Example / test for find_aligned_basis

pyspinw.basis.find_aligned_basis(vectors: ndarray, rcond: float | None = None) → tuple[ndarray, ndarray, ndarray]#

Find a set of orthonormal basis vectors aligned with the first being aligned to the input vectors

Parameters:
  • vectors – an n-by-3 numpy array containing the vectors to use to calculate the basis

  • rcond – tolerance on the calculation, default is 3 * machine precision

pyspinw.basis.site_rotations(vectors: ndarray, rcond: float | None = None)#

Return an aligned basis as an n-by-3-by-3 matrix