Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::mlip::MaceGNNModel Class Reference

High-performance TorchScript MACE inference engine for atomic systems. More...

#include <MaceGNNModel.hpp>

Inheritance diagram for correlation::mlip::MaceGNNModel:
Collaboration diagram for correlation::mlip::MaceGNNModel:

Classes

struct  Impl

Public Member Functions

 MaceGNNModel (std::string model_path, std::string device="cpu", real_t cutoff=static_cast< real_t >(5.0))
 Constructs a MACE TorchScript model from a serialized .pt or .model file.
 ~MaceGNNModel () override
 MaceGNNModel (MaceGNNModel &&) noexcept
MaceGNNModel & operator= (MaceGNNModel &&) noexcept
 MaceGNNModel (const MaceGNNModel &)=delete
MaceGNNModel & operator= (const MaceGNNModel &)=delete
std::string getModelName () const override
 Returns the model architecture and source path identifier.
MLIPOutput evaluate (const correlation::core::Cell &cell) const override
 Evaluates potential properties (energy, forces, stress) on an atomic Cell.
real_t cutoff () const noexcept
 Gets the radial neighbor cutoff radius.
void setCutoff (real_t cutoff) noexcept
 Sets the radial neighbor cutoff radius.
bool isLoaded () const noexcept
 Checks if LibTorch backend is compiled and model successfully loaded.
Public Member Functions inherited from correlation::mlip::MLIPInterface
virtual ~MLIPInterface ()=default

Private Attributes

std::unique_ptr< Impl > impl_
std::string model_path_
std::string device_str_
real_t cutoff_ {static_cast<real_t>(5.0)}

Detailed Description

High-performance TorchScript MACE inference engine for atomic systems.

Ingests serialized MACE TorchScript models (.pt or .model exported via mace.cli.create_lammps_model) and evaluates potential energy, atomic forces, and virial stress tensors over periodic boundary condition structures.

Constructor & Destructor Documentation

◆ MaceGNNModel() [1/3]

correlation::mlip::MaceGNNModel::MaceGNNModel ( std::string model_path,
std::string device = "cpu",
real_t cutoff = static_cast<real_t>(5.0) )
explicit

Constructs a MACE TorchScript model from a serialized .pt or .model file.

Parameters
[in]model_pathPath to the compiled MACE TorchScript model artifact.
[in]deviceExecution target device (e.g. "cpu", "cuda", "cuda:0").
[in]cutoffRadial neighbor cutoff radius in Angstroms (default: 5.0).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~MaceGNNModel()

correlation::mlip::MaceGNNModel::~MaceGNNModel ( )
overridedefault

◆ MaceGNNModel() [2/3]

correlation::mlip::MaceGNNModel::MaceGNNModel ( MaceGNNModel && )
defaultnoexcept
Here is the call graph for this function:

◆ MaceGNNModel() [3/3]

correlation::mlip::MaceGNNModel::MaceGNNModel ( const MaceGNNModel & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ cutoff()

real_t correlation::mlip::MaceGNNModel::cutoff ( ) const
inlinenodiscardnoexcept

Gets the radial neighbor cutoff radius.

Returns
Cutoff distance in Angstroms.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ evaluate()

MLIPOutput correlation::mlip::MaceGNNModel::evaluate ( const correlation::core::Cell & cell) const
nodiscardoverridevirtual

Evaluates potential properties (energy, forces, stress) on an atomic Cell.

Parameters
[in]cellAtomic configuration cell.
Returns
MLIPOutput containing atomic forces and virial stress tensor.

Implements correlation::mlip::MLIPInterface.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getModelName()

std::string correlation::mlip::MaceGNNModel::getModelName ( ) const
nodiscardoverridevirtual

Returns the model architecture and source path identifier.

Returns
Model descriptor string.

Implements correlation::mlip::MLIPInterface.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLoaded()

bool correlation::mlip::MaceGNNModel::isLoaded ( ) const
nodiscardnoexcept

Checks if LibTorch backend is compiled and model successfully loaded.

Returns
True if model is ready for forward evaluation.
Here is the caller graph for this function:

◆ operator=() [1/2]

MaceGNNModel & correlation::mlip::MaceGNNModel::operator= ( const MaceGNNModel & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

MaceGNNModel & correlation::mlip::MaceGNNModel::operator= ( MaceGNNModel && )
defaultnoexcept
Here is the call graph for this function:

◆ setCutoff()

void correlation::mlip::MaceGNNModel::setCutoff ( real_t cutoff)
inlinenoexcept

Sets the radial neighbor cutoff radius.

Parameters
[in]cutoffNew cutoff distance in Angstroms.
Here is the call graph for this function:

Member Data Documentation

◆ cutoff_

real_t correlation::mlip::MaceGNNModel::cutoff_ {static_cast<real_t>(5.0)}
private

◆ device_str_

std::string correlation::mlip::MaceGNNModel::device_str_
private

◆ impl_

std::unique_ptr<Impl> correlation::mlip::MaceGNNModel::impl_
private

◆ model_path_

std::string correlation::mlip::MaceGNNModel::model_path_
private

The documentation for this class was generated from the following files: