pyextal.jaxMultipole.crystal

The crystal a multipole model lives in.

A Crystal is a plain snapshot – cell, metric, operations, sites, voltage – taken from the Bloch engine once, so that everything downstream is pure NumPy / JAX and never touches the engine’s global state again. Reading the structure from the same .dat the Bloch refinement used guarantees the two agree on the cell, the setting, the origin and the atom list, which a second structure input could silently break.

Cartesian frame: a along x, b in the xy plane, c completing a right-handed set. A holds a, b, c as columns, so r = A x for fractional x; reciprocal vectors are k = B* h with B* = inv(A).T, and |k| = 2 s with s = sin(theta)/lambda (no factor 2 pi).

Classes

Site

One asymmetric-unit atom.

Crystal

Cell, symmetry and sites.

Functions

cell_matrix(a, b, c, alpha, beta, gamma)

A with the lattice vectors as columns (a along x, b in xy).

element_of(label)

Element symbol from an engine or user label: 'SR' -> 'Sr', 'O1' -> 'O'.

Module Contents

pyextal.jaxMultipole.crystal.cell_matrix(a, b, c, alpha, beta, gamma)

A with the lattice vectors as columns (a along x, b in xy).

pyextal.jaxMultipole.crystal.element_of(label)

Element symbol from an engine or user label: 'SR' -> 'Sr', 'O1' -> 'O'.

class pyextal.jaxMultipole.crystal.Site

One asymmetric-unit atom.

Variables:
  • label (str) – Unique name, e.g. 'Sr1', 'O1'.

  • element (str) – Element symbol, 'Sr'.

  • engine_label (str) – The label the engine used ('SR', 'TI4+'), which decides its Cromer-Mann row.

  • xyz (np.ndarray) – Fractional coordinates.

  • occ (float) – Occupancy.

  • beta (np.ndarray) – Engine 6-vector (b11, b22, b33, b12, b13, b23).

  • stab (np.ndarray) – (m, 3, 3) fractional rotations that fix the site.

label: str
element: str
engine_label: str
xyz: numpy.ndarray
occ: float
beta: numpy.ndarray
stab: numpy.ndarray
property order
class pyextal.jaxMultipole.crystal.Crystal

Cell, symmetry and sites.

Variables:
  • cell (np.ndarray) – a, b, c, alpha, beta, gamma.

  • A (np.ndarray) – (3, 3) lattice vectors as columns, Angstrom.

  • ops_W (np.ndarray) – (n, 3, 3) fractional rotations of the full group modulo lattice translations (inversion and centring folded in).

  • ops_w (np.ndarray) – (n, 3) their translations.

  • centro (bool) – The group is centrosymmetric.

  • ops_inv (np.ndarray) – (n,) bool, the operation is one of the inversion-related half the engine adds to its coset representatives ((-W, w)); reflections reached only through these are Friedel mates, linked by conjugation (jaxMultipole.symmetry.link_phase).

  • sites (list[Site]) – Asymmetric unit.

  • kv (float) – Accelerating voltage the Ug refer to, kV.

  • source (str) – Where it came from.

cell: numpy.ndarray
A: numpy.ndarray
ops_W: numpy.ndarray
ops_w: numpy.ndarray
centro: bool
sites: list
kv: float
source: str = ''
ops_inv: numpy.ndarray = None
__post_init__()
property Bstar
property G
property Gstar
property omega
property gamma
property n_ops
s(hkl)

sin(theta)/lambda of reflections (..., 3).

site(label)
cart_rotation(W)

Cartesian matrix of a fractional rotation, A W A^-1, snapped orthogonal.

Rounding in the cell leaves A W A^-1 orthogonal only to the cell’s precision; the nearest orthogonal matrix (polar factor) removes that.

with_kv(kv)

Copy at another voltage (Ug scale with gamma).

classmethod manual(cell, ops, sites, kv, centro=None, source='manual', tol=0.0001, ops_inv=None)

Builds a crystal without the engine.

Parameters:
  • cell (sequence) – a, b, c, alpha, beta, gamma.

  • ops (tuple) – (W, w), the full group modulo lattice translations.

  • sites (list[dict]) – dict(label, xyz, beta, occ=1, element=None).

  • kv (float) – Voltage.

  • centro (bool, optional) – Inferred from the operations when None.

  • ops_inv (array, optional) – Marks the inversion-related half of the operations (see the class attributes); none when omitted.

classmethod from_dat(path, labels=None, tol=0.0001)

Snapshots a .dat file through the Bloch engine’s parser.

Parameters:
  • path (path-like) – The crystal file the refinement used.

  • labels (list[str], optional) – Site names; Sr1, Ti1, O1, ... by default.

  • tol (float) – Site-symmetry tolerance, fractional.

Note

bloch_parse resets the engine’s global state and accepts paths of at most 120 characters; a longer absolute path is retried relative to the working directory. No simulation is run, so terminate() is never needed.