GPRidge v1.0.0
GPR-accelerated saddle point searches on potential energy surfaces
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
NEBOraclePotential.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
// Copyright (c) gpridge developers
3
// See LICENSE for details.
4
22
23
#ifndef GPR_NEB_NEBORACLE_POTENTIAL_H_
24
#define GPR_NEB_NEBORACLE_POTENTIAL_H_
25
26
#include <Eigen/Dense>
27
28
#include "
GPNEB.h
"
29
#include "
gpr/potentials/PotentialWrapper.h
"
30
31
namespace
gpr
{
32
namespace
neb
{
33
37
inline
pot::PotentialWrapper
makePotentialWrapperFromOracle
(
NEBOracle
oracle)
38
{
39
pot::PotentialWrapper::ForceFn
fn =
40
[oracle = std::move(oracle)](
41
long
N,
const
double
* R,
const
int
*
/*atomicNrs*/
,
double
* F,
42
double
* U,
double
* variance,
const
double
*
/*box*/
)
mutable
{
43
Eigen::VectorXd positions(3 * N);
44
for
(
long
i = 0; i < 3 * N; ++i)
45
positions(i) = R[i];
46
47
auto
[energy, gradient] = oracle(positions);
48
49
if
(U) *U = energy;
50
// Force = -gradient. Dimer reads from F.
51
for
(
long
i = 0; i < 3 * N; ++i)
52
F[i] = -gradient(i);
53
// The dimer's variance arm is left unfilled (the NEB oracle
54
// is the true PES, no surrogate variance to report).
55
if
(variance) *variance = 0.0;
56
};
57
return
pot::PotentialWrapper
(std::move(fn));
58
}
59
60
}
// namespace neb
61
}
// namespace gpr
62
63
#endif
// GPR_NEB_NEBORACLE_POTENTIAL_H_
GPNEB.h
GP-accelerated NEB: AIE and OIE variants.
PotentialWrapper.h
pot::PotentialWrapper
Type-erased wrapper around any potential that provides a force() interface.
Definition
PotentialWrapper.h:94
pot::PotentialWrapper::ForceFn
std::function< void( long N, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise_rms, const double *box)> ForceFn
Definition
PotentialWrapper.h:102
gpr::neb
The nudged elastic band: path, GP-NEB driver, configuration and result, acquisition,...
Definition
ChainRealign.h:29
gpr::neb::NEBOracle
std::function< std::pair< double, Eigen::VectorXd >( const Eigen::VectorXd &positions)> NEBOracle
Oracle function: positions -> (energy, gradient).
Definition
GPNEB.h:82
gpr::neb::makePotentialWrapperFromOracle
pot::PotentialWrapper makePotentialWrapperFromOracle(NEBOracle oracle)
Definition
NEBOraclePotential.h:37
gpr
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition
Macros.h:16
gpr
neb
NEBOraclePotential.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf