PAOFLOW.epsilon_native#

Optional Rust backend bridge for the dielectric / JDOS response loops.

This package opportunistically imports the compiled paoflow_rs extension and exposes a small, NumPy-friendly API mirroring the vectorised PAOFLOW.response.do_epsilon.eps_loop() and jdos_loop inner loops in batched form (whole rank-local k-slice in one call, rayon-parallel, GIL released).

If the extension is not installed, available() returns False and the callers fall back to the vectorised NumPy path, so the backend is fully optional.

Threads: set PAOFLOW_RS_THREADS to cap intra-rank threads. Force the NumPy fallback (even when installed) with a truthy PAOFLOW_EPSILON_DISABLE.

Functions#

available()

Return True when the compiled Rust backend can be used.

eps_loop(ek, fn_occ, pksp2, ene, intersmear, th0, th1, ...)

Interband dielectric inner loop over the local k-slice.

jdos_loop(ek, fn_occ, kweights, ene, intersmear, smeartype)

JDOS inner loop over the local k-slice.

Package Contents#

PAOFLOW.epsilon_native.available()[source]#

Return True when the compiled Rust backend can be used.

PAOFLOW.epsilon_native.eps_loop(ek, fn_occ, pksp2, ene, intersmear, th0, th1, spin_factor, deltakp2, eta_floor, fnf)[source]#

Interband dielectric inner loop over the local k-slice.

Parameters mirror the vectorised reference; pksp2 is the precomputed Re(P.T * Q) of shape (nk, nbnd, nbnd). deltakp2/fnf may be None. Returns (epsi, epsr, drude_weight).

PAOFLOW.epsilon_native.jdos_loop(ek, fn_occ, kweights, ene, intersmear, smeartype)[source]#

JDOS inner loop over the local k-slice.

smeartype is 'gauss' or 'lorentz'. Returns (jdos, count) partials for MPI reduction by the caller.