sim_lib_interference_solve/lib.rs
1#![forbid(unsafe_code)]
2//! Deterministic CPU `f64` solving and certified observation of coherent scalar fields.
3//!
4//! [`ReferencePhasorSolver`] consumes the checked physical model and preflight
5//! vocabulary from `sim-lib-interference-core`. Successful solves return a
6//! [`HostPhasorField`] with separate row-major real and imaginary component
7//! planes plus immutable [`SolveEvidence`].
8//!
9//! The solved model is homogeneous, isotropic, three-dimensional, scalar, and
10//! free-field. It does not model polarization, impedance, interfaces,
11//! obstacles, or diffraction. Amplitude-squared projections and detector
12//! reductions are normalized observables, not physical intensity, power, or
13//! energy.
14//!
15//! [`verify_reference_solver`] independently checks closed-form propagation
16//! identities, true metamorphic field laws, the outgoing time sign, and
17//! second-order convergence of a seven-point Helmholtz residual over point,
18//! plane, mixed, attenuating, and multi-source fixtures. The crate has no SIM
19//! runtime, tensor, compute-provider, or presentation dependency.
20//!
21//! [`project`] derives real, imaginary, amplitude, wrapped phase,
22//! squared-magnitude, and instantaneous scalar fields without rerunning
23//! propagation. [`reduce_for_view`] applies an explicit detector rule over an
24//! exact partition of the source grid. Undefined phase is
25//! [`ScalarSample::Masked`], detail reduction is fail-closed, and every result
26//! carries a [`ProjectionCertificate`] retaining source sampling evidence.
27//! [`analyze_fringes`] then derives deterministic statistics, strict local
28//! node/antinode candidates, and Michelson contrast without dropping either
29//! sampling evidence or projection identity.
30//! [`ScenarioBuilder`] constructs bounded two-point, counter-propagating,
31//! phased-array, and rectangular discrete-aperture problems. Array amplitudes
32//! are normalized and wavelength-relative element spacing remains explicit.
33//! [`ToneStudy`] seals one independently solved frequency with its exact
34//! problem, plane, positive composition weight, and solve evidence.
35//! [`MultiToneStudy`] admits only certified tones on identical physical sample
36//! geometry. [`ToneCombination::IncoherentMagnitudeSquared`] sums weighted
37//! component squared magnitudes and [`ToneCombination::Instant`] sums
38//! weighted real fields at one shared clock time; unlike phasors are never
39//! added. Every [`MultiToneProjection`] carries [`MultiToneCertificate`] with
40//! the highest-frequency [`MultiToneSamplingRequirements`] and all component
41//! [`ToneCertificate`] records.
42
43mod analysis;
44mod analytic;
45mod complex;
46mod error;
47mod field;
48mod helmholtz;
49mod multitone;
50mod multitone_error;
51mod observable;
52mod projection;
53mod reduce;
54mod reference;
55mod scenario;
56mod scenario_admission;
57mod scenario_error;
58mod verification;
59mod verify;
60
61pub use analysis::{
62 AnalysisError, Extremum, ExtremumKind, FieldStats, FringeReport, analyze_fringes,
63};
64pub use error::ReferenceSolveError;
65pub use field::{HostPhasorField, HostPhasorFieldError};
66pub use multitone::{
67 MultiToneCertificate, MultiToneProjection, MultiToneSamplingRequirements, MultiToneStudy,
68 ToneCertificate, ToneCombination, ToneStudy,
69};
70pub use multitone_error::MultiToneError;
71pub use observable::Observable;
72pub use projection::{
73 DetectorFootprint, GridDimensions, LossClass, ProjectionCertificate, ProjectionError,
74 ProjectionIdentity, ScalarProjection, ScalarSample, project,
75};
76pub use reduce::{ReductionRule, reduce_for_view};
77pub use reference::{ReferencePhasorSolver, SolveEvidence};
78pub use scenario::{
79 ABSOLUTE_MAX_GENERATED_ID_BYTES, ABSOLUTE_MAX_SCENARIO_SOURCES, ABSOLUTE_MAX_TOTAL_ID_BYTES,
80 AperturePolicy, ElementSpacingWavelengths, NamedScenario, STRICT_MAX_SPACING_WAVELENGTHS,
81 ScenarioBuilder, ScenarioCertificate, ScenarioKind, ScenarioLimits,
82};
83pub use scenario_error::ScenarioError;
84pub use verification::{
85 MAX_ANALYTIC_RELATIVE_ERROR, MAX_METAMORPHIC_RELATIVE_ERROR, VerificationError,
86 VerificationReport,
87};
88pub use verify::verify_reference_solver;