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

Constructs periodic neighbor graphs and extracts tensors for GNN evaluation. More...

#include <PeriodicGraphBuilder.hpp>

Static Public Member Functions

static PeriodicGraphData buildGraph (const correlation::core::Cell &cell, real_t cutoff_radius=static_cast< real_t >(5.0), bool include_self_loops=false, size_t l_max=0, size_t max_num_neighbors=0)
 Constructs a periodic atomic graph with periodic boundary condition shift vectors.
static ElementCompatibilityReport validateElementCompatibility (const correlation::core::Cell &cell)
 Validates whether all elements in a Cell map to valid atomic numbers and Cellulose LDOS training species ({H, C, O}).
static PeriodicGraphData buildOrbGraph (const correlation::core::Cell &cell, const OrbDescriptorConfig &config={})
 Constructs a periodic atomic graph and extracts complete ORB-v3 descriptors.
static int64_t getAtomicNumber (std::string_view symbol) noexcept
 Resolves atomic number Z for a chemical element symbol.
static real_t computeCutoffEnvelope (real_t distance, real_t cutoff_radius) noexcept
 Computes a smooth polynomial cutoff envelope f_c(d) decaying to zero at cutoff.
static real_t computeOrbCutoffEnvelope (real_t distance, real_t cutoff_radius) noexcept
 Computes ORB-v3 polynomial cutoff envelope f_c(d) of order p=4 decaying smoothly to 0 at cutoff_radius.
static std::vector< real_t > computeBesselBasis (real_t distance, real_t cutoff_radius, size_t num_basis)
 Computes spherical Bessel radial basis functions with polynomial envelope.
static std::vector< real_t > computeOrbBesselBasis (real_t distance, const OrbDescriptorConfig &config={})
 Computes ORB-v3 Bessel radial basis functions without envelope.
static std::vector< real_t > computeGaussianRBF (real_t distance, const GaussianRBFConfig &config)
 Computes Gaussian radial basis functions (RBF) for an interatomic distance.
static void computeSphericalHarmonics (const correlation::math::Vector3< real_t > &vec, size_t l_max, std::span< real_t > out) noexcept
 Evaluates real orthonormal spherical harmonics Y_lm(r) up to l_max <= 3 into a pre-allocated span.
static std::vector< real_t > computeSphericalHarmonics (const correlation::math::Vector3< real_t > &vec, size_t l_max)
 Evaluates real orthonormal spherical harmonics Y_lm(r) up to l_max <= 3 returning a newly allocated vector.
static void computeOrbSphericalHarmonics (const correlation::math::Vector3< real_t > &unit_vec, size_t l_max, std::span< real_t > out) noexcept
 Evaluates e3nn component-normalized spherical harmonics Y_lm(r) up to l_max <= 3 into a span.
static std::vector< real_t > computeOrbSphericalHarmonics (const correlation::math::Vector3< real_t > &unit_vec, size_t l_max)
 Evaluates e3nn component-normalized spherical harmonics Y_lm(r) returning a vector.

Detailed Description

Constructs periodic neighbor graphs and extracts tensors for GNN evaluation.

Member Function Documentation

◆ buildGraph()

PeriodicGraphData correlation::mlip::PeriodicGraphBuilder::buildGraph ( const correlation::core::Cell & cell,
real_t cutoff_radius = static_cast<real_t>(5.0),
bool include_self_loops = false,
size_t l_max = 0,
size_t max_num_neighbors = 0 )
staticnodiscard

Constructs a periodic atomic graph with periodic boundary condition shift vectors.

Parameters
[in]cellSimulation cell containing lattice vectors and atomic positions.
[in]cutoff_radiusCutoff sphere radius in Angstroms (default: 5.0).
[in]include_self_loopsWhether to include zero-displacement self-loops (default: false).
[in]l_maxMaximum spherical harmonics degree (0..3) to embed (default: 0, no harmonics computed).
[in]max_num_neighborsOptional cap on nearest neighbors per atom (0 = unlimited).
Returns
Extracted flat PeriodicGraphData buffers.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildOrbGraph()

PeriodicGraphData correlation::mlip::PeriodicGraphBuilder::buildOrbGraph ( const correlation::core::Cell & cell,
const OrbDescriptorConfig & config = {} )
staticnodiscard

Constructs a periodic atomic graph and extracts complete ORB-v3 descriptors.

Parameters
[in]cellSimulation cell containing lattice vectors and atomic positions.
[in]configORB descriptor configuration parameters.
Returns
Extracted flat PeriodicGraphData buffers including ORB tensors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeBesselBasis()

std::vector< real_t > correlation::mlip::PeriodicGraphBuilder::computeBesselBasis ( real_t distance,
real_t cutoff_radius,
size_t num_basis )
staticnodiscard

Computes spherical Bessel radial basis functions with polynomial envelope.

Parameters
[in]distanceInteratomic distance d.
[in]cutoff_radiusCutoff radius r_c.
[in]num_basisNumber of radial Bessel basis functions.
Returns
Vector of Bessel basis values of length num_basis.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeCutoffEnvelope()

real_t correlation::mlip::PeriodicGraphBuilder::computeCutoffEnvelope ( real_t distance,
real_t cutoff_radius )
staticnodiscardnoexcept

Computes a smooth polynomial cutoff envelope f_c(d) decaying to zero at cutoff.

Parameters
[in]distanceInteratomic distance d.
[in]cutoff_radiusCutoff radius r_c.
Returns
Envelope value in range [0, 1].
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeGaussianRBF()

std::vector< real_t > correlation::mlip::PeriodicGraphBuilder::computeGaussianRBF ( real_t distance,
const GaussianRBFConfig & config )
staticnodiscard

Computes Gaussian radial basis functions (RBF) for an interatomic distance.

Parameters
[in]distanceInteratomic distance d.
[in]configGaussian RBF configuration parameters.
Returns
Vector of Gaussian RBF values of length config.num_basis.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeOrbBesselBasis()

std::vector< real_t > correlation::mlip::PeriodicGraphBuilder::computeOrbBesselBasis ( real_t distance,
const OrbDescriptorConfig & config = {} )
staticnodiscard

Computes ORB-v3 Bessel radial basis functions without envelope.

Parameters
[in]distanceInteratomic distance d.
[in]configORB descriptor configuration specifying cutoff and basis count.
Returns
Vector of Bessel basis values of length config.num_rbf.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeOrbCutoffEnvelope()

real_t correlation::mlip::PeriodicGraphBuilder::computeOrbCutoffEnvelope ( real_t distance,
real_t cutoff_radius )
staticnodiscardnoexcept

Computes ORB-v3 polynomial cutoff envelope f_c(d) of order p=4 decaying smoothly to 0 at cutoff_radius.

Parameters
[in]distanceInteratomic distance d.
[in]cutoff_radiusCutoff radius.
Returns
Envelope value in range [0, 1].
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeOrbSphericalHarmonics() [1/2]

std::vector< real_t > correlation::mlip::PeriodicGraphBuilder::computeOrbSphericalHarmonics ( const correlation::math::Vector3< real_t > & unit_vec,
size_t l_max )
staticnodiscard

Evaluates e3nn component-normalized spherical harmonics Y_lm(r) returning a vector.

Parameters
[in]unit_vec3D normalized unit displacement vector.
[in]l_maxMaximum degree (clamped to 3).
Returns
Vector of length (l_max + 1)^2.
Here is the call graph for this function:

◆ computeOrbSphericalHarmonics() [2/2]

void correlation::mlip::PeriodicGraphBuilder::computeOrbSphericalHarmonics ( const correlation::math::Vector3< real_t > & unit_vec,
size_t l_max,
std::span< real_t > out )
staticnoexcept

Evaluates e3nn component-normalized spherical harmonics Y_lm(r) up to l_max <= 3 into a span.

Parameters
[in]unit_vec3D normalized unit displacement vector.
[in]l_maxMaximum degree (clamped to 3). Total components evaluated: (l_max + 1)^2.
[out]outDestination span of size at least (l_max + 1)^2.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeSphericalHarmonics() [1/2]

std::vector< real_t > correlation::mlip::PeriodicGraphBuilder::computeSphericalHarmonics ( const correlation::math::Vector3< real_t > & vec,
size_t l_max )
staticnodiscard

Evaluates real orthonormal spherical harmonics Y_lm(r) up to l_max <= 3 returning a newly allocated vector.

Parameters
[in]vec3D displacement vector r.
[in]l_maxMaximum degree (clamped to 3). Total components evaluated: (l_max + 1)^2.
Returns
Vector of length (l_max + 1)^2 containing real spherical harmonics.
Here is the call graph for this function:

◆ computeSphericalHarmonics() [2/2]

void correlation::mlip::PeriodicGraphBuilder::computeSphericalHarmonics ( const correlation::math::Vector3< real_t > & vec,
size_t l_max,
std::span< real_t > out )
staticnoexcept

Evaluates real orthonormal spherical harmonics Y_lm(r) up to l_max <= 3 into a pre-allocated span.

Parameters
[in]vec3D displacement vector r.
[in]l_maxMaximum degree (clamped to 3). Total components evaluated: (l_max + 1)^2.
[out]outDestination span of size at least (l_max + 1)^2.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAtomicNumber()

int64_t correlation::mlip::PeriodicGraphBuilder::getAtomicNumber ( std::string_view symbol)
staticnodiscardnoexcept

Resolves atomic number Z for a chemical element symbol.

Parameters
[in]symbolElement symbol string (e.g. "Si", "Fe", "O").
Returns
Atomic number Z (1..118) or 0 if unknown.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateElementCompatibility()

ElementCompatibilityReport correlation::mlip::PeriodicGraphBuilder::validateElementCompatibility ( const correlation::core::Cell & cell)
staticnodiscard

Validates whether all elements in a Cell map to valid atomic numbers and Cellulose LDOS training species ({H, C, O}).

Parameters
[in]cellSimulation cell to inspect.
Returns
ElementCompatibilityReport detailing any unmapped (Z=0) or out-of-domain species.
Here is the call graph for this function:
Here is the caller graph for this function:

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