eOn client
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
CatLearnPot.h
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#pragma once
13
14
#define PYBIND11_DETAILED_ERROR_MESSAGES
15
16
#include "
eon/SurrogatePotential.h
"
17
18
#include <pybind11/eigen.h>
19
#include <pybind11/embed.h>
20
#include <pybind11/pybind11.h>
21
22
namespace
py = pybind11;
23
using namespace
pybind11::literals;
// to bring in the `_a` literal
24
25
class
CatLearnPot
:
public
SurrogatePotential
{
26
27
public
:
28
CatLearnPot
(
const
Parameters
&a_params);
29
30
// Functions
31
void
train_optimize
(
const
MatrixXd
&features,
32
const
MatrixXd
&targets)
override
;
33
void
force
(
long
nAtoms,
const
double
*positions,
const
int
*atomicNrs,
34
double
*forces,
double
*energy,
double
*
variance
,
35
const
double
*box)
override
;
36
[[nodiscard]]
bool
isThreadSafe
() const noexcept
override
{
return
false
; }
37
// Variables [public]
38
py::object
m_gpmod
;
39
MatrixXd
40
variance
;
// XXX: This is a hacky way to populate and use this variable
41
};
MatrixXd
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, eOnStorageOrder > MatrixXd
Definition
Eigen.h:33
SurrogatePotential.h
CatLearnPot::train_optimize
void train_optimize(const MatrixXd &features, const MatrixXd &targets) override
Definition
CatLearnPot.cpp:31
CatLearnPot::force
void force(long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energy, double *variance, const double *box) override
Definition
CatLearnPot.cpp:36
CatLearnPot::m_gpmod
py::object m_gpmod
Definition
CatLearnPot.h:38
CatLearnPot::isThreadSafe
bool isThreadSafe() const noexcept override
Whether this potential's force() can be called from multiple threads on the SAME instance.
Definition
CatLearnPot.h:36
CatLearnPot::CatLearnPot
CatLearnPot(const Parameters &a_params)
Definition
CatLearnPot.cpp:16
CatLearnPot::variance
MatrixXd variance
Definition
CatLearnPot.h:40
eonc::Parameters
Definition
Parameters.h:28
eonc::SurrogatePotential::SurrogatePotential
SurrogatePotential(PotType a_ptype, const Parameters &a_params)
Definition
SurrogatePotential.h:21
include
eon
potentials
CatLearnPot
CatLearnPot.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf