Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
MLIPInterface.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
11#include "core/Cell.hpp"
13
14#include <span>
15#include <string>
16#include <vector>
17
18namespace correlation::mlip {
19
24struct alignas(64) MLIPOutput {
25 real_t total_energy{static_cast<real_t>(0.0)};
26 std::vector<real_t> per_atom_energy;
27 std::vector<correlation::math::Vector3<real_t>> forces;
29 std::vector<real_t> ldos;
30 size_t ldos_bins{0};
31 real_t ldos_e_min{static_cast<real_t>(-30.0)};
32 real_t ldos_e_max{static_cast<real_t>(15.0)};
33 real_t ldos_sigma{static_cast<real_t>(0.2)};
34
35 std::vector<real_t>
37 std::vector<correlation::math::Vector3<real_t>>
40 static_cast<real_t>(0.0),
41 };
42 std::vector<real_t>
44
50 [[nodiscard]] std::span<const real_t> getLdos(size_t atom_idx) const noexcept {
51 if (ldos_bins == 0 || (atom_idx + 1) * ldos_bins > ldos.size()) {
52 return {};
53 }
54 return std::span<const real_t>(ldos.data() + atom_idx * ldos_bins, ldos_bins);
55 }
56
62 [[nodiscard]] std::span<real_t> getLdos(size_t atom_idx) noexcept {
63 if (ldos_bins == 0 || (atom_idx + 1) * ldos_bins > ldos.size()) {
64 return {};
65 }
66 return std::span<real_t>(ldos.data() + atom_idx * ldos_bins, ldos_bins);
67 }
68};
69
76public:
77 virtual ~MLIPInterface() = default;
78
83 [[nodiscard]] virtual std::string getModelName() const = 0;
84
90 [[nodiscard]] virtual MLIPOutput evaluate(const correlation::core::Cell &cell) const = 0;
91};
92
93} // namespace correlation::mlip
Simulation cell structure with periodic boundary conditions.
Lightweight 3D vector and matrix classes for geometric calculations.
Represents the simulation cell (periodic box).
Definition Cell.hpp:30
A lightweight, constexpr, stack-based 3x3 matrix.
Definition LinearAlgebra.hpp:261
Abstract interface for machine learning interatomic potential evaluation engines (ORB-v3,...
Definition MLIPInterface.hpp:75
virtual MLIPOutput evaluate(const correlation::core::Cell &cell) const =0
Evaluates potential energy, forces, and stress for a given unit cell.
virtual std::string getModelName() const =0
Returns the model architecture name (e.g. "ORB-v3", "ORB-mol", "MACE").
virtual ~MLIPInterface()=default
Definition GraphDescriptors.hpp:18
double real_t
Definition Precision.hpp:18
Output container for machine learning interatomic potential calculations.
Definition MLIPInterface.hpp:24
real_t ldos_e_min
Definition MLIPInterface.hpp:31
std::vector< real_t > charges
Definition MLIPInterface.hpp:36
real_t energy_variance
Definition MLIPInterface.hpp:39
std::vector< real_t > ldos
Definition MLIPInterface.hpp:29
std::span< real_t > getLdos(size_t atom_idx) noexcept
Returns a mutable span over the LDOS spectrum for a specific atom.
Definition MLIPInterface.hpp:62
std::vector< correlation::math::Vector3< real_t > > forces
Definition MLIPInterface.hpp:27
size_t ldos_bins
Definition MLIPInterface.hpp:30
real_t total_energy
Definition MLIPInterface.hpp:25
std::vector< real_t > force_variances
Definition MLIPInterface.hpp:43
std::vector< correlation::math::Vector3< real_t > > magmoms
Definition MLIPInterface.hpp:38
real_t ldos_sigma
Definition MLIPInterface.hpp:33
std::span< const real_t > getLdos(size_t atom_idx) const noexcept
Returns a const span over the LDOS spectrum for a specific atom.
Definition MLIPInterface.hpp:50
real_t ldos_e_max
Definition MLIPInterface.hpp:32
correlation::math::Matrix3< real_t > stress
Definition MLIPInterface.hpp:28
std::vector< real_t > per_atom_energy
Definition MLIPInterface.hpp:26