Expand description
Foundational vocabulary for the vita ecosystem: the questions a physical system can answer, not the structures that store the answers.
What we observe is not nature itself, but nature exposed to our method of questioning.
— Werner Heisenberg
A system is never a concrete type here. Each kind of question it can answer is a
trait: HasElements what occupies a site, HasPositions where it sits,
HasNetCharge the total charge. Code bounds on exactly the capabilities it needs
and stays blind to the storage behind them.
§Sites
Per-site data is keyed on an opaque SiteId; HasSites enumerates those keys and
is the supertrait of every per-site capability. A capability is a keyed getter paired
with a (SiteId, _) iterator — storage order is never implied. System-wide quantities
(HasLattice, HasNetCharge) are standalone, single-valued traits.
§Quantities
Physical values carry their dimension and unit in the type via units; geometry uses
the three-dimensional primitives in tensor. Both are generic over the Scalar
element type, f32 or f64.
Modules§
- prelude
- The
vita-coreprelude. - tensor
- Fixed-size geometric primitives in three dimensions.
- units
- Dimensionally-typed physical quantities.
Structs§
- Element
- A chemical element, identified by its atomic number Z — the proton count.
- Isotope
- A nuclide: an
Elementtogether with its mass number A. - Lattice
- A periodic lattice: the three basis vectors a, b, c that generate a system’s translational symmetry.
- SiteId
- An opaque, dense identifier for a simulation site (e.g., an atom).
Traits§
- HasAccelerations
- Per-site acceleration: the
Vector3acceleration of each site. - HasElements
- Per-site chemical identity: the
Elementoccupying each site. - HasIsotopes
- Per-site nuclear identity: the
Isotopeoccupying each site. - HasLattice
- The periodic
Latticeof a system. - HasMasses
- Per-site mass: the
Massof the particle at each site. - HasNet
Charge - The net electric charge of a system.
- HasPositions
- Per-site position: the
Point3locating each site in space. - HasSites
- The identity skeleton: the
SiteIds every per-site datum is keyed on. - HasVelocities
- Per-site velocity: the
Vector3velocity of each site. - Scalar
- Numeric scalar type for values in physical-quantity and tensor types.