vita_core/lib.rs
1//! Foundational vocabulary for the vita ecosystem: the questions a physical system can
2//! answer, not the structures that store the answers.
3//!
4//! > What we observe is not nature itself, but nature exposed to our method of
5//! > questioning.
6//! >
7//! > — Werner Heisenberg
8//!
9//! A system is never a concrete type here. Each kind of question it can answer is a
10//! trait: [`HasElements`] what occupies a site, [`HasPositions`] where it sits,
11//! [`HasNetCharge`] the total charge. Code bounds on exactly the capabilities it needs
12//! and stays blind to the storage behind them.
13//!
14//! # Sites
15//!
16//! Per-site data is keyed on an opaque [`SiteId`]; [`HasSites`] enumerates those keys and
17//! is the supertrait of every per-site capability. A capability is a keyed getter paired
18//! with a `(SiteId, _)` iterator — storage order is never implied. System-wide quantities
19//! ([`HasLattice`], [`HasNetCharge`]) are standalone, single-valued traits.
20//!
21//! # Quantities
22//!
23//! Physical values carry their dimension and unit in the type via [`units`]; geometry uses
24//! the three-dimensional primitives in [`tensor`]. Both are generic over the [`Scalar`]
25//! element type, `f32` or `f64`.
26
27mod capability;
28mod element;
29mod id;
30mod isotope;
31mod lattice;
32mod scalar;
33
34pub mod tensor;
35pub mod units;
36
37pub mod prelude;
38
39pub use scalar::Scalar;
40
41pub use element::Element;
42pub use id::SiteId;
43pub use isotope::Isotope;
44pub use lattice::Lattice;
45
46pub use capability::{
47 HasAccelerations, HasElements, HasIsotopes, HasLattice, HasMasses, HasNetCharge, HasPositions,
48 HasSites, HasVelocities,
49};