mod metatensor_export¶
- module metatensor_export¶
Export
ConFramedata as metatensorTensorBlockinstances.Available behind the
metatensorCargo feature. The block layout mirrors the metatensor convention: rows are samples (one per atom), and columns are properties (x,y,zfor vector quantities or a single column for scalars).Users that want a
TensorMapkeyed by species can build one on top of these blocks; the choice of “per-species block” vs “single block withspeciesas a sample column” is user-specific, so we expose the building blocks rather than baking in one convention.Functions
- fn frame_energies_block(frame: &ConFrame) -> Result<Option<TensorBlock>, metatensor::Error>¶
Builds a
TensorBlockwith shape[N, 1]carrying the per-atom energy contributions. ReturnsOk(None)if the frame did not carry an energies section.
- fn frame_forces_block(frame: &ConFrame) -> Result<Option<TensorBlock>, metatensor::Error>¶
Builds a
TensorBlockwith shape[N, 3]carrying the per-atom forces. ReturnsOk(None)if the frame did not carry a forces section.
- fn frame_positions_block(frame: &ConFrame) -> Result<TensorBlock, metatensor::Error>¶
Builds a
TensorBlockwith shape[N, 3]carrying the per-atom xyz coordinates fromframe. Samples are labelledatom_id(the post-grouping index from the file’s column 5), properties are labelledxyzwith values0,1,2.Returns the underlying metatensor error if the C library rejects the labels or array shape.