Skip to main content

Crate elasticrab

Crate elasticrab 

Source
Expand description

Anisotropic Network Model (ANM) normal-mode analysis.

Give it atoms, get back the vibrational modes of an elastic network: a coarse spring model where every pair of atoms closer than a cutoff is joined by a harmonic spring. Diagonalizing the resulting Hessian yields the normal modes — the collective, low-energy motions a structure most readily makes.

use elasticrab::{Atom, Params, NormalModes};

let atoms = vec![
    Atom { position: [0.0, 0.0, 0.0], mass: 12.0 },
    Atom { position: [3.8, 0.0, 0.0], mass: 12.0 },
    Atom { position: [3.8, 3.8, 0.0], mass: 12.0 },
];
let modes = NormalModes::new(&atoms, &Params::default()).unwrap();

// Eigenvalues are ascending; the lowest few are the ~zero rigid-body modes.
assert_eq!(modes.len(), 9); // 3 atoms × 3 Cartesian axes

§Scope

This is the standard ANM with a uniform spring constant, the same super-element Hessian used by tools such as ProDy and Pepsi-SAXS. It deliberately stops at “frequencies and modes”: structure parsing, hydration, coarse-graining, and any fitting of amplitudes to data belong to the caller.

The default solver is dense (cost grows with the cube of the atom count), ideal for small and medium systems. Params::k_modes returns only the lowest k non-zero modes; the optional sparse feature then computes them without forming the dense Hessian, which is what scales to large systems.

Structs§

Atom
A point mass in the elastic network.
NormalModes
The normal modes of an elastic network: eigenvalues paired with mode shapes, sorted by ascending eigenvalue.
Params
Parameters of the elastic-network model.

Enums§

Error
Why an analysis could not be performed.