Expand description
Analysis compute modules for molrs molecular simulation.
Trajectory analysis (RDF, MSD, clustering, gyration/inertia, PCA,
k-means) built around a single unified Compute trait.
Every analysis is stateless — orchestrate from the caller.
§Stateless Compute — orchestrate from the caller
Each Compute impl is a pure function: &self is an immutable
parameter bag. Two compute calls with identical frames + args
always produce identical output. There is no hidden mutable state,
no DAG, no store — just the trait and per-analysis modules.
For DAG orchestration (topological order, diamond reuse, external
input validation), use molpy.compute.Workflow on the Python side.
It composes Compute nodes via Python’s stdlib graphlib and
calls each Rust kernel directly.
§Unified trait
Every analysis implements Compute. A single frame, a trajectory, and a
whole dataset are the same kind of input — a slice &[&F] — and each
impl decides how to interpret it:
- Whole-sequence accumulators (RDF) iterate every frame.
- Time-series analyses (MSD) use
frames[0]as a reference. - Per-frame analyses (Cluster, COM) return one result per frame.
- Matrix consumers (PCA, k-means) take upstream per-frame outputs as
rows (via
DescriptorRow).
§Results
Every Compute output implements ComputeResult. Accumulating outputs
(RDF) override finalize to normalize; other
outputs use the default no-op.
§Available analyses
| Module | Args | Output |
|---|---|---|
rdf | &Vec<NeighborList> | RDFResult |
msd | () | MSDTimeSeries |
cluster | &Vec<NeighborList> | Vec<ClusterResult> |
cluster_centers | &Vec<ClusterResult> | Vec<ClusterCentersResult> |
center_of_mass | &Vec<ClusterResult> | Vec<COMResult> |
gyration_tensor | (&Vec<ClusterResult>, &Vec<ClusterCentersResult>) | Vec<GyrationTensorResult> |
inertia_tensor | (&Vec<ClusterResult>, &Vec<COMResult>) | Vec<InertiaTensorResult> |
radius_of_gyration | (&Vec<ClusterResult>, &Vec<COMResult>) | Vec<RgResult> |
pca | &Vec<T: DescriptorRow> | PcaResult |
kmeans | &PcaResult | KMeansResult |
Re-exports§
pub use center_of_mass::COMResult;pub use center_of_mass::CenterOfMass;pub use cluster::Cluster;pub use cluster::ClusterProperties;pub use cluster::ClusterPropertiesResult;pub use cluster::ClusterResult;pub use cluster_centers::ClusterCenters;pub use cluster_centers::ClusterCentersResult;pub use density::CorrelationFunction;pub use density::CorrelationFunctionResult;pub use density::GaussianDensity;pub use density::GaussianDensityResult;pub use density::LocalDensity;pub use density::LocalDensityResult;pub use density::SphereVoxelization;pub use density::SphereVoxelizationResult;pub use dielectric::ConductivityResult;pub use dielectric::DielectricSpectrum;pub use dielectric::StaticDielectricResult;pub use dielectric::compute_current_density;pub use dielectric::compute_dipole_moment;pub use dielectric::decompose_current;pub use dielectric::einstein_helfand_conductivity;pub use dielectric::einstein_helfand_spectrum;pub use dielectric::green_kubo_spectrum;pub use dielectric::static_dielectric_constant;pub use dielectric::static_dielectric_constant_components;pub use diffraction::DiffractionPattern;pub use diffraction::DiffractionPatternResult;pub use diffraction::StaticStructureFactorDebye;pub use diffraction::StaticStructureFactorDebyeResult;pub use diffraction::StaticStructureFactorDirect;pub use diffraction::StaticStructureFactorDirectResult;pub use environment::AngularSeparationGlobal;pub use environment::AngularSeparationGlobalResult;pub use environment::AngularSeparationNeighbor;pub use environment::AngularSeparationNeighborResult;pub use environment::BondOrder;pub use environment::BondOrderResult;pub use environment::LocalBondProjection;pub use environment::LocalBondProjectionResult;pub use environment::LocalDescriptors;pub use environment::LocalDescriptorsResult;pub use environment::MatchEnv;pub use environment::MatchEnvResult;pub use error::ComputeError;pub use gyration_tensor::GyrationTensor;pub use gyration_tensor::GyrationTensorResult;pub use inertia_tensor::InertiaTensor;pub use inertia_tensor::InertiaTensorResult;pub use jacf::JacfResult;pub use jacf::green_kubo_conductivity;pub use kmeans::KMeans;pub use kmeans::KMeansResult;pub use msd::MSD;pub use msd::MSDResult;pub use msd::MSDTimeSeries;pub use msd::MsdMode;pub use onsager::OnsagerResult;pub use onsager::onsager_correlation;pub use order::ContinuousCoordination;pub use order::ContinuousCoordinationResult;pub use order::Cubatic;pub use order::CubaticResult;pub use order::Hexatic;pub use order::HexaticResult;pub use order::Nematic;pub use order::NematicResult;pub use order::RotationalAutocorrelation;pub use order::RotationalAutocorrelationResult;pub use order::SolidLiquid;pub use order::SolidLiquidResult;pub use order::Steinhardt;pub use order::SteinhardtResult;pub use pca::Pca2;pub use pca::PcaResult;pub use persist::PersistResult;pub use persist::SurvivalMethod;pub use persist::pair_survival_tcf;pub use pmft::PMFTR12;pub use pmft::PMFTR12Args;pub use pmft::PMFTR12Result;pub use pmft::PMFTXY;pub use pmft::PMFTXYArgs;pub use pmft::PMFTXYResult;pub use pmft::PMFTXYT;pub use pmft::PMFTXYTArgs;pub use pmft::PMFTXYTResult;pub use pmft::PMFTXYZ;pub use pmft::PMFTXYZArgs;pub use pmft::PMFTXYZResult;pub use radius_of_gyration::RadiusOfGyration;pub use radius_of_gyration::RgResult;pub use rdf::RDF;pub use rdf::RDFResult;pub use result::ComputeResult;pub use result::DescriptorRow;pub use spectra::RamanSpectrum;pub use spectra::Spectrum;pub use spectra::ir_spectrum;pub use spectra::ir_spectrum;pub use spectra::power_spectrum;pub use spectra::power_spectrum;pub use spectra::raman_spectrum;pub use spectra::raman_spectrum;pub use traits::Compute;
Modules§
- center_
of_ mass - Mass-weighted cluster centers (center of mass) with MIC.
- cluster
- cluster_
centers - Geometric cluster centers computed with minimum image convention.
- density
- Density-related analyzers ported from
freud.density. - dielectric
- Dielectric susceptibility computation.
- diffraction
- Diffraction / structure-factor analyzers ported from
freud.diffraction. - environment
- Local-environment analyzers ported from
freud.environment. - error
- gyration_
tensor - Gyration tensor computation for clusters.
- inertia_
tensor - Moment of inertia tensor computation for clusters.
- jacf
- Ionic conductivity from the charge-current autocorrelation (Green–Kubo).
- kmeans
- k-means clustering with k-means++ initialization.
- msd
- Mean squared displacement analysis (stateless).
- onsager
- Onsager transport coefficients from collective mean-displacement correlations.
- order
- Bond-orientational order parameters ported from
freud.order. - pca
- 2-component Principal Component Analysis (PCA).
- persist
- Pair-survival (persistence) time-correlation functions.
- pmft
- Pair Mode Fourier Transform (PMFT) analyzers.
- radius_
of_ gyration - Radius of gyration computation for clusters.
- rdf
- Radial distribution function g(r) computation.
- result
- Traits carried by every
Computeoutput. - spectra
- Vibrational spectra from molecular-dynamics time-series data.
- traits
- Unified
Computetrait — the single public entry point for any analysis. - util
- Internal helpers shared across compute kernels.
- validate
- Domain-validation checks for computed dielectric / conductivity spectra.