crystal#

Crystallography-related utilities and functions.

Functions

B_matrix(lattice_parameters)

Compute the B matrix of a lattice in float64 (from anri.crystal.lpars_to_B(), no 2 pi).

B_to_rmt(B)

Convert the B matrix to the reciprocal metric tensor.

UBI_to_mt(UBI)

Convert from (U.B)^-1 matrix to metric tensor.

allowed_hkls(hkls, sym_matrices[, tol])

Mark the reflections that are not systematically absent in a space group.

cubic_grid_misorientation(step_deg)

Largest misorientation (degrees) from any orientation to its nearest point of the cubic Rodrigues grid.

cubochoric_quaternions(semi_edge_steps)

Quaternions of the cubochoric grid of rotations, uniform in volume (Rosca et al., 2014; Singh & De Graef, 2016).

disorientation(Ua, Ub, ops)

Smallest misorientation angle between orientations over a Laue group.

float64()

Evaluate JAX in float64 inside a with block, without changing the global setting.

lattice_parameters(structure)

Return the lattice parameters of a Dans_Diffraction.Crystal.

laue_rotations(sym_ops, B)

Proper rotations of a crystal's Laue group, as Cartesian matrices S in the crystal frame.

lpars_rlpars_to_B(lpars, rlpars)

Get the Busing-Levy B matrix from the direct and reciprocal lattice parameters.

lpars_to_B(lpars)

Convert lattice parameters to B matrix (cross-transform).

lpars_to_mt(lpars)

Convert lattice parameters to metric tensor.

mat_to_quat(U)

Convert rotation matrices to unit quaternions (w, x, y, z) with w >= 0.

mat_to_rod(U)

Convert rotation matrices (rotation angle below 180 degrees) to Rodrigues vectors.

metric_to_volume(metric)

Get the volume of the (direct or reciprocal space) unit cell from the (direct or reciprocal space) metric tensor.

mt_to_lpars(metric)

Convert (direct or reciprocal) metric tensor back to (direct or reciprocal) lattice parameters.

mt_to_rmt(mt)

Convert metric tensor to reciprocal metric tensor.

orientation_grid(step_deg, ops)

Orientations covering one fundamental zone of a Laue group, and their worst-case spacing.

quat_mul(a, b)

Multiply quaternions (w, x, y, z): the rotation b followed by a.

quat_to_mat(q)

Convert unit quaternions (w, x, y, z) to rotation matrices.

reflections(lattice_parameters, ...)

List every reflection of a crystal up to a d* (and that diffracts at this wavelength), without absences.

rings(ds[, tol])

Group reflections into rings of equal d*.

rmt_to_mt(rmt)

Convert reciprocal metric tensor to metric tensor.

rod_to_mat(r)

Convert Rodrigues vectors r = tan(t / 2) n to rotation matrices.

space_group(structure_or_name)

Return the space-group number of a Dans_Diffraction.Crystal, or of a Hermann-Mauguin symbol.

structure_factors(structure, hkl, wavelength)

Compute |F|^2 of reflections of a structure, with Debye-Waller factors and anomalous dispersion.

symmetry_matrices(space_group_number)

Return a space group's operations as 4 x 4 matrices acting on fractional coordinates.

to_fundamental_zone(U, ops)

Replace each orientation by its equivalent U S with the smallest rotation angle.