@matteria-js/analysis
v0.1.0
Published
Small structure analysis helpers for MATTERIA.
Downloads
9
Readme
@matteria-js/analysis
Derived materials summaries built from existing @matteria-js/core structures. The current API covers cutoff neighbors with getNeighbors, full neighbor lists with getNeighborList, unique pairs with getNeighborPairs, covalent-radius bond candidates with inferBondCandidates, distance matrices, coordination summaries, radial distributions, composition descriptors, and overrideable covalent radii/tolerance helpers.
This package should not run electronic-structure calculations, molecular dynamics, phonon solvers, or rendering pipelines. Treat the current neighbor helpers as lightweight structure tools, not high-performance simulation kernels.
Public API
getNeighbors,getNeighborList,getNeighborPairsinferBondCandidates,getBondCutoff,getCovalentRadiusdistanceMatrixcoordinationNumbersradialDistributioncompositionDescriptor
Example
import {
compositionDescriptor,
coordinationNumbers,
distanceMatrix,
radialDistribution,
} from "@matteria-js/analysis";
const distances = distanceMatrix(structure);
const coordination = coordinationNumbers(structure, { cutoff: 3 });
const rdf = radialDistribution(structure, { cutoff: 6, binWidth: 0.1 });
const composition = compositionDescriptor(structure);
console.log(distances.values); // Float64Array
console.log(coordination[0]?.neighbors);
console.log(rdf.g); // Float64Array
console.log(composition.reducedFormula);Coordination counts periodic image multiplicity by default. Pass { usePeriodicImages: false } when you want one minimum-image neighbor record per site pair.
Next Slice
Near-term analysis work should stay close to structures. Useful additions are simple local-environment labels, structure descriptors for filtering viewer data, and basic structure comparison helpers once the core model can represent the needed metadata.
Electronic, volumetric, and phonon result containers should live in their own packages. @matteria-js/analysis can summarize those objects later, but it should not become a parser, solver, or plotting package.
