pymiediff.helper

pymiediff.helper#

Helper namespace for pymiediff.

This package groups utility functions used by the main scattering solvers and exposes an optional bridge to torchgdm.

Submodules#

helper

General-purpose helper utilities used across pymiediff.

tg

pymiediff.helper.tg

Frequently used symbols#

helper.get_truncution_criteroin_wiscombe(ka)

Estimate n_max with Wiscombe's truncation criterion.

helper.get_truncution_criteroin_pena2009(k0, ...)

Peña/Pal (2009) truncation criterion for multilayer spheres.

helper.detach_tensor(args[, item])

Detach tensors and convert them to NumPy arrays.

helper.transform_fields_spherical_to_cartesian(...)

Convert field components from spherical to Cartesian basis.

helper.transform_spherical_to_xyz(r, theta, phi)

Convert spherical coordinates to Cartesian coordinates.

helper.transform_xyz_to_spherical(x, y, z)

Convert Cartesian coordinates to spherical coordinates.

helper.interp1d(x_eval, x_dat, y_dat)

One-dimensional linear interpolation in PyTorch.

helper.funct_grad_checker(z, funct, inputs)

Compare autograd and numerical derivatives.

helper.plane_wave_expansion(n)

Return plane-wave VSH expansion coefficient a_pw_n.

tg.StructAutodiffMieEffPola3D(mie_particle, ...)

TorchGDM Mie-theory based 3D point polarizability with auto-diff support

tg.StructAutodiffMieGPM3D(mie_particle, ...)

Autodiff-capable TorchGDM GPM structure from a pymiediff.Particle.