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
17
18#include <pybind11/eigen.h>
19#include <pybind11/embed.h>
20#include <pybind11/pybind11.h>
21
22namespace py = pybind11;
23using namespace pybind11::literals; // to bring in the `_a` literal
24
26
27public:
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;
40 variance; // XXX: This is a hacky way to populate and use this variable
41};
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, eOnStorageOrder > MatrixXd
Definition Eigen.h:33
void train_optimize(const MatrixXd &features, const MatrixXd &targets) override
void force(long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energy, double *variance, const double *box) override
py::object m_gpmod
Definition CatLearnPot.h:38
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(const Parameters &a_params)
MatrixXd variance
Definition CatLearnPot.h:40
SurrogatePotential(PotType a_ptype, const Parameters &a_params)