differentiable_ucg_lut#
- de_ebsd.crystal.differentiable_ucg_lut(crystal, energy_kev, dmin, *, positions=None, occupancies=None, debye_waller=None, absorption=True, device=None, dtype=torch.complex128)[source]#
Assemble the
U_glookup table in torch, differentiable in the crystal.U_g = pre * sum_site occ_site * f_site(g) * sum_r exp(-2 pi i g.r). All three parameter groups are differentiable when passed asrequires_gradtensors:positions – the structure-factor phase
sum_r exp(-2 pi i g.r);occupancies – the linear per-site weight;
debye_waller (
Bin nm^2, one per site) – feeds the torch WK amplitude (de_ebsd.crystal.scattering_torch.wk_scattering_factor_torch()), soU_gdifferentiates w.r.t. the thermal factor.
When
debye_walleris None the amplitudes are evaluated in numpy and held constant (positions/occupancy gradients only). Feed the result to a torch backend (bloch_prism) as itsu_lutfor end-to-endd(intensity)/d(crystal parameter). Lattice gradients (throughg) remain a further step.