maxwelllink.matter.helpers module

Small helpers shared by the standalone matter interfaces (MD, …).

maxwelllink.matter.helpers.field_rows(field, n_steps, dt_au)[source]

Normalize field to None or a per-step (3,) getter.

maxwelllink.matter.helpers.resolve_backend(backend)[source]

Resolve the requested backend to (name, array_module).

None (auto) picks the GPU when CuPy can reach a CUDA device and falls back to the CPU otherwise; 'cpu' and 'gpu' force the choice.

maxwelllink.matter.helpers.to_host(array)[source]

A NumPy copy of array, whether it lives on the host or the device.