BlochPrismBackend#

class de_ebsd.diffraction.BlochPrismBackend(cdtype=torch.complex128)[source]#

Bases: BlochWaveBackend

Scattering-matrix (PRISM) Bloch backend: one shared eigen-decomposition.

cdtype selects the working precision: torch.complex128 (default, exact against the reference) or torch.complex64 (faster, ~1e-4).

The whole intensity path is torch (matrix_exp + a depth recurrence), so it is autograd-differentiable: with a requires_grad structure-factor LUT (u_lut) gradients flow through the Bloch solve back to U_g (matching finite differences; M4). Connecting U_g to crystal parameters needs torch structure factors – the remaining M4 piece.

Methods

intensities

Intensities (K,) for unit directions (K, 3).

prepare

Build and cache per-simulation tensors on the target device.

Attributes

name

intensities(directions)[source]#

Intensities (K,) for unit directions (K, 3). Called after prepare.

prepare(inputs)[source]#

Build and cache per-simulation tensors on the target device.

uses_depth_profile = True#

whether this backend consumes a Monte Carlo exit-depth profile; the simulator builds a native one (EMsoft-free) when the user supplies none.