RDF δr_ref ε_noise

RDF first-peak delta_r_ref → ε_noise calibration (center-only rattle).

An alternative to the thermal atom_hifi.training.judge.measure_eps_noise() route for obtaining the per-element descriptor noise floor ε_noise (eps_error).

Instead of a thermal Gaussian rattle at a physics-derived σ, the amplitude is read from the database’s own nearest-neighbour RDF first-peak width and applied as a fixed-magnitude, single-atom (“Dirac”) displacement of the focus atom; the induced embedding shift ‖Δembed‖ is aggregated into a scalar ε per element. The result is dimensionally identical to the thermal ε_noise and is consumed by exactly the same downstream code (the c-factor scan bandwidth unit, the r100 k_micro selection).

Validated by the 2026-06-19 sweep (4 systems × 3600 variants, 0 fallbacks) and the 2026-06-23/24 downstream benchmark. Recommended variant (the locked defaults below): xall / gauss / sigma / sqrt2 / bin_width 0.01 / light smoothing / median.

Pure functions ported verbatim from the validated probe rdf_deltar_core.py; center_only_eps() is generalised to accept either an embed_op matrix or an embed callable so it matches the embed_fn convention used by measure_eps_noise. Seed 42; n_samples default 3000.

atom_hifi.training.rdf_eps.rdf_first_peak(structs, focus_el, neighbour_el=None, r_max=5.0, bin_width=0.01, smoothing='none')[source]

Compute g(r) and detect the first peak.

Uses get_all_distances(mic=True) directly (avoids the ase.ga.utilities cell-size restriction that fails for small ML training boxes). g(r) uses a pair-count-weighted density normalisation Σ_s n_X^s n_Y^s / V_s so bulk structures dominate over isolated dimers in vacuum boxes. Returns a dict with r, g, g_smooth, peak_r/g/i, window_L/R(_i), pair_counts, n_structs.

atom_hifi.training.rdf_eps.fit_peak(r, g, window, mode='gauss', gmm_weight_min=0.0, sigma_floor=0.0)[source]

Fit the first RDF peak within window → σ / FWHM.

Returns a dict with status (‘ok’|’poor_fit’|’failed’), sigma_peak, fwhm, center, residual, mode (and GMM extras for mode=’gmm’).

atom_hifi.training.rdf_eps.delta_r_ref(system_inputs, focus_el, source='xall', agg='min', conversion='direct', fit_mode='gauss', gmm_weight_min=0.0, width_metric='sigma', bin_width=0.01, smoothing='none')[source]

RDF first-peak width → reference displacement amplitude (Å).

Fallback ladder: pair-resolved → aggregate → if all pairs fail try xall → if xall fails return (None, provenance) (caller falls back). See module docstring for the recommended variant.

atom_hifi.training.rdf_eps.center_only_eps(lib, focus_el, embed, descriptor_fn, delta_r, n_samples=3000, seed=42)[source]

Center-only fixed-sphere (“Dirac”) rattle producing embed-shift samples.

Move ONLY the focus atom by a fixed displacement delta_r in a uniformly random direction on the unit sphere; the cage is frozen. embed is a matrix or an embed callable (see _apply_embed()). Returns a 1-D array of per-sample embedding-shift norms.

atom_hifi.training.rdf_eps.eps_tol(eps_samples, stat='mean')[source]

Aggregate ‖Δembed‖ samples to a scalar ε (‘mean’ | ‘median’ | ‘q95’).

atom_hifi.training.rdf_eps.measure_eps_noise_rdf(atoms_list, descriptor_fn, embed_fn, species, rdf_cfg=None, *, seed=42)[source]

Per-element ε_noise from the RDF delta_r_ref center-only rattle.

Drop-in alternative to atom_hifi.training.judge.measure_eps_noise(): returns a per-element scalar ε that feeds the c-factor scan bandwidth and the r100 k_micro selection.

Parameters:
  • atoms_list (list[ase.Atoms])

  • descriptor_fn (callable(list[Atoms]) → (n_atoms, n_feat))

  • embed_fn (dict{el: callable|matrix} or a single callable/matrix — the) – SAME embedding used to build the microstate covers.

  • species (list[str])

  • rdf_cfg (dict — exposed knobs (n_samples, eps_stat) override the) – locked RDF_DEFAULTS; None → all defaults.

  • seed (int)

Returns:

dict {el – ‘fit_status’: str|None, ‘fallback’: bool}} eps is None (fallback=True) when no RDF peak is found; the caller substitutes the mean ε of the elements that did peak.

Return type:

{‘eps’: float|None, ‘delta_r’: float|None, ‘n_eps_samples’: int,