jaxvacua.flux_utils.dedup_key#
- dedup_key(moduli, tau, fluxes, n_digits=6)#
Build a hashable dedup key from a single
(moduli, tau, fluxes)triple.Details
The
fluxesvector is rounded to integers and packed as raw bytes (it represents an integer flux quantum in practice). The continuousmoduliandtauare rounded ton_digitsdecimal places to absorb numerical noise from solver convergence. The result is hashable, so it can be used as a Pythonsetelement ordictkey.Note that a single flux vector can admit multiple distinct critical points (because the moduli equations are non-linear), so the key deliberately includes the moduli +
tau, not just the flux.Distinct from
FluxVacuaFinder.deduplicate_vacua(), which is a batchedjnp.uniquepass: this helper is for streaming / incremental dedup of one solution at a time.- Parameters:
moduli (
Any) – Complex structure moduli. Real and imaginary parts are each rounded ton_digitsdecimal places.tau (
Any) – Axio-dilaton. Real and imaginary parts are each rounded ton_digitsdecimal places.fluxes (
Any) – Flux vector. Real part is rounded toint32; imaginary part is ignored.n_digits (
int) – Decimal precision for rounding continuous components. Defaults to6.
- Returns:
tuple – 4-tuple
(flux_bytes, moduli_re_bytes, moduli_im_bytes, tau_tuple),hashable for use in a ``set`` / ``dict``.
- Return type:
Tuple[bytes,bytes,bytes,Tuple[float,float]]
Example:
seen = set() for vac in candidate_vacua: k = dedup_key(vac.moduli, vac.tau, vac.fluxes) if k in seen: continue seen.add(k) ...