Skip to main content

Module index_proj

Module index_proj 

Source
Expand description

Campaign screening scalars / CON ingest contracts for corpus stores (readcon-db). Campaign-store index projection: screening scalars and contracts derived from a parsed ConFrame so corpora (e.g. readcon-db) do not fork CON semantics.

§Finite scalars

Energy, mass, volume, (f_{\max}), and metadata channels used for ordered indexes are included only when finite (f64::is_finite). NaN/Inf are omitted so B-tree range scans never see non-orderable keys.

§Sections mask

[sections_present_mask] / [SECTIONS_MASK_*] summarize forces / velocities / energies presence for flag indexes without scanning blobs twice.

§Spans

Multi-frame ingest should use crate::iterators::ConFrameIterator::next_with_raw_span so stored blobs are exact substrings; [frame_byte_spans] is a structural pre-pass (offsets only) for planning.

Structs§

FrameByteSpan
Byte span of one frame within a multi-frame CON buffer (start inclusive, end exclusive).
FrameIndexProjection
ASE.db-competitive / CON-derivable screening projection for one frame.

Constants§

SECTIONS_MASK_ENERGIES
Bit 2: energies section or finite frame energy present.
SECTIONS_MASK_FORCES
Bit 0: forces section or per-atom forces present.
SECTIONS_MASK_VELOCITIES
Bit 1: velocities section or per-atom velocities present.

Functions§

composition_formula
Canonical multiset formula: sorted non-empty Sym:count joined by |. Example: Cu₂H₂ → Cu:2|H:2. Shared with campaign idx_formula keys.
finite_energy
Finite frame energy from header helper or metadata "energy"; None if missing or non-finite.
frame_byte_spans
Structural pre-pass: frame byte ranges via span-preserving iteration (parses each frame). Concatenating spans in order reproduces file_contents for well-formed multi-frame CON with no leading/trailing junk (trailing newline at EOF may be absorbed into the last span).
frame_cell_volume
Cell volume: prefer lattice determinant; else triclinic from boxl + angles (degrees).
frame_composition_formula
Canonical formula string for frame (empty string if no non-empty symbols).
frame_fmax
Max Euclidean (|F_i|) over atoms with force data; None if no finite forces.
frame_has_energies
True if energies section is declared or a finite frame energy exists.
frame_has_forces
True if forces are declared or any atom carries force data.
frame_has_velocities
True if velocities are declared or any atom carries velocity data.
frame_species_counts
Species multiset from a frame’s atom_data symbols.
frame_total_mass
Total mass = Σ masses_per_type[i] * natms_per_type[i] (all finite).
sections_present_mask
Bitmask of present sections (forces / velocities / energies) for flag indexes.
spans_cover_buffer
Ingest contract: successive next_with_raw_span slices concatenate to the full buffer when the file is only frames (no prefix garbage). Used by tests and corpus docs.
species_counts_from_symbols
Species multiset from atom symbols (non-empty only), sorted by symbol.
symbol_histogram
Symbol multiset histogram without retaining frames (ingest planning / cheap stats).