_images/metatensor-horizontal.png _images/metatensor-horizontal-dark.png

metatensor is a library for defining, manipulating, storing, and sharing arrays with many, potentially sparse, indices. Think numpy’s ndarray or PyTorch’s Tensor with additional metadata and block-sparse storage.

metatensor was designed to work with data in atomistic machine learning and makes it easy, memory efficient, and fast to keep track of spherical harmonics orders, neighboring atoms indices, atomic types, and much more. It can also store gradients, keeping them together with the associated values.

🚀 Getting started

Install the right version of metatensor for your programming language! The core of this library is written in Rust and we provide API for C, C++, and Python.

Installation
💡 Our goals

Learn about the core goals of metatensor, and what the library is about:

  • an exchange format for ML data;

  • a tool to develop new ML models;

  • an interface for atomistic simulations.

Metatensor’s goals
🛠️ Core classes

Explore the core types of metatensor: TensorMap, TensorBlock and Labels, and discover how to used them.

Overview
📈 Operations

Use operations to manipulate the core types of metatensor and write new algorithms operating on metatensor’s sparse data.

Operations
🔥 TorchScript interface

Learn about the TorchScript version of metatensor, used to export and execute custom models inside non-Python software.

TorchScript backend
🧑‍💻 Learning utilities

Use the utility class with the same API as torch or scikit-learn to train models using metatensor!

Learning utilities
⚛️ Running atomistic simulations

Learn about the facilities provided to define atomistic models, and use them to run molecular dynamics simulations and more!

Atomistic applications