Loading...
Searching...
No Matches
IRCDriver.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
5#include "IRCDriver.h"
6
7#include <Eigen/Eigenvalues>
8#include <Eigen/SVD>
9#include <algorithm>
10#include <cmath>
11#include <limits>
12#include <stdexcept>
13#include <string>
14#include <utility>
15
18
19namespace gpr {
20namespace irc {
21
22namespace {
23
24struct IrcSurface {
25 const GradientFn* gradient = nullptr;
26 int* evals = nullptr;
27 Eigen::Index ndof = 0;
28 bool capture = false;
29 bool captured = false;
30 Eigen::VectorXd position;
31 Eigen::VectorXd gradient_value;
32 double energy = 0.0;
33 bool saw_last = false;
34 Eigen::VectorXd last_position;
35 Eigen::VectorXd last_gradient;
36 double last_energy = 0.0;
37};
38
39extern "C" rgsaddle_status_t ircSurface(void* user,
40 rgsaddle_surface_request_t* req)
41{
42 auto* surface = static_cast<IrcSurface*>(user);
43 if (surface == nullptr || surface->gradient == nullptr || req == nullptr ||
44 req->positions == nullptr || req->energies == nullptr ||
45 req->gradients == nullptr || req->n_images != 1 ||
46 req->n_atoms * 3 != surface->ndof) {
47 return RGSADDLE_SHAPE;
48 }
49 try {
50 Eigen::VectorXd position(surface->ndof);
51 for (Eigen::Index i = 0; i < surface->ndof; ++i)
52 position(i) = req->positions[i];
53 const auto evaluated = (*surface->gradient)(position);
54 if (evaluated.second.size() != surface->ndof) return RGSADDLE_SHAPE;
55 req->energies[0] = evaluated.first;
56 for (Eigen::Index i = 0; i < surface->ndof; ++i)
57 req->gradients[i] = evaluated.second(i);
58 if (surface->evals != nullptr) ++(*surface->evals);
59 if (surface->capture) {
60 // The first evaluation is the point the step started from.
61 // A later evaluation can be the geometry the library accepts.
62 if (!surface->captured) {
63 surface->position = position;
64 surface->gradient_value = evaluated.second;
65 surface->energy = evaluated.first;
66 surface->captured = true;
67 }
68 surface->last_position = std::move(position);
69 surface->last_gradient = evaluated.second;
70 surface->last_energy = evaluated.first;
71 surface->saw_last = true;
72 }
73 } catch (...) {
74 return RGSADDLE_SURFACE_FAILED;
75 }
76 return RGSADDLE_OK;
77}
78
79Eigen::VectorXd buildSqrtMasses(const Eigen::VectorXd& masses)
80{
81 const Eigen::Index n = masses.size();
82 Eigen::VectorXd s(3 * n);
83 for (Eigen::Index a = 0; a < n; ++a) {
84 const double sm = std::sqrt(masses(a));
85 for (int k = 0; k < 3; ++k)
86 s(3 * a + k) = sm;
87 }
88 return s;
89}
90
91Eigen::MatrixXd hessianToMassWeighted(const Eigen::MatrixXd& h_plain,
92 const Eigen::VectorXd& sqrt_masses)
93{
94 const Eigen::VectorXd inv_s = sqrt_masses.cwiseInverse();
95 return inv_s.asDiagonal() * h_plain * inv_s.asDiagonal();
96}
97
98// rgsaddle signs its kick so the first nonzero Cartesian component is
99// positive. The public Forward direction follows +v_mw, so a negative
100// leading component swaps the code passed to the library.
101int32_t rgsaddleDirection(bool along_positive_mode, const Eigen::VectorXd& v_mw)
102{
103 bool flipped = false;
104 for (Eigen::Index i = 0; i < v_mw.size(); ++i) {
105 if (std::abs(v_mw(i)) > 1e-16) {
106 flipped = v_mw(i) < 0.0;
107 break;
108 }
109 }
110 const bool library_reverse = (along_positive_mode == flipped);
111 return library_reverse ? RGSADDLE_IRC_REVERSE : RGSADDLE_IRC_FORWARD;
112}
113
114rgsaddle_irc_config_t ircConfig(const gpr::neb::RgsaddleClient& client,
115 const IRCOptions& options, int32_t direction)
116{
117 rgsaddle_irc_config_t cfg{};
118 cfg.version.major = client.abiMajor();
119 cfg.version.minor = client.abiMinor();
120 cfg.dx = options.step_size;
121 cfg.force_tol = options.conv_tol;
122 cfg.force_gate = RGSADDLE_FORCE_MW_L2;
123 cfg.max_inner = 2;
124 cfg.kind = RGSADDLE_IRC_MOROKUMA;
125 cfg.direction = direction;
126 cfg.flags = options.method == IRCMethod::MorokumaExtended
127 ? RGSADDLE_IRC_ADAPTIVE
128 : 0;
129 cfg.kick = options.initial_displacement;
130 cfg.max_step = options.max_step;
131 cfg.min_step = options.min_step;
132 cfg.dr = options.hv_eps;
133 cfg.krylov_dim = 0;
134 cfg.eigen_kind = 0;
135 return cfg;
136}
137
138uint64_t splitmix64(uint64_t& state)
139{
140 state += 0x9E3779B97F4A7C15ULL;
141 uint64_t z = state;
142 z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ULL;
143 z = (z ^ (z >> 27)) * 0x94D049BB133111EBULL;
144 return z ^ (z >> 31);
145}
146
147// The develop driver's Nystrom sketch: one Box-Muller normal per draw.
148// sketch_seed 0 is 1, so an unset seed stays reproducible.
149Eigen::VectorXd gaussianSketch(uint64_t sketch_seed, Eigen::Index ndof)
150{
151 uint64_t state = sketch_seed != 0 ? sketch_seed : 1ULL;
152 const double pi = std::acos(-1.0);
153 Eigen::VectorXd draw(ndof);
154 for (Eigen::Index i = 0; i < ndof; ++i) {
155 const uint64_t z1 = splitmix64(state);
156 const double u1 =
157 static_cast<double>(z1 & 0xFFFFFFFFULL) / 4294967296.0 + 1e-12;
158 const uint64_t z2 = splitmix64(state);
159 const double u2 = static_cast<double>(z2 >> 32) / 4294967296.0;
160 draw(i) = std::sqrt(-2.0 * std::log(u1)) * std::cos(2.0 * pi * u2);
161 }
162 return draw;
163}
164
165void projectOut(Eigen::VectorXd& vector, const Eigen::MatrixXd& directions)
166{
167 if (directions.cols() == 0 || vector.size() != directions.rows()) return;
168 const Eigen::JacobiSVD<Eigen::MatrixXd> svd(directions,
169 Eigen::ComputeThinU);
170 const auto& values = svd.singularValues();
171 const double scale =
172 values.size() > 0 ? values(0) : std::numeric_limits<double>::min();
173 const double cut =
174 1e-10 * std::max(scale, std::numeric_limits<double>::min());
175 Eigen::Index rank = 0;
176 for (Eigen::Index k = 0; k < values.size(); ++k)
177 if (values(k) > cut) ++rank;
178 if (rank == 0) return;
179 const Eigen::MatrixXd span = svd.matrixU().leftCols(rank);
180 vector -= span * (span.transpose() * vector);
181}
182
183// Cartesian seed whose mass-weighted image is the projected Gaussian.
184// rgsaddle multiplies the Cartesian seed by M^{1/2} before Lanczos, which
185// is the same weighting as the surface Hessian. This driver has no cell,
186// so rotations are rigid once three atoms can define them.
187Eigen::VectorXd surfaceLaunchSeed(uint64_t sketch_seed,
188 const Eigen::VectorXd& positions,
189 const Eigen::VectorXd& masses,
190 const Eigen::VectorXd& sqrt_masses)
191{
192 Eigen::VectorXd weighted = gaussianSketch(sketch_seed, sqrt_masses.size())
193 .cwiseProduct(sqrt_masses);
194 Eigen::MatrixXd rigid =
195 gpr::optim::massWeightedRigidMotions(positions, masses);
196 if (masses.size() < 3) rigid.conservativeResize(rigid.rows(), 3);
197 projectOut(weighted, rigid);
198 const double floor = 64.0 * std::numeric_limits<double>::epsilon() *
199 std::max(1.0, static_cast<double>(weighted.size()));
200 if (!(weighted.norm() > floor)) {
201 const Eigen::MatrixXd vibrational =
202 gpr::optim::vibrationalComplement(positions, masses);
203 if (vibrational.cols() > 0) weighted = vibrational.col(0);
204 }
205 return weighted.cwiseQuotient(sqrt_masses);
206}
207
208// Rayleigh quotient of M^{-1/2} H M^{-1/2} along a Cartesian kick. The
209// kick is parallel to the mode rgsaddle returned.
210double massWeightedCurvature(const Eigen::VectorXd& saddle,
211 const Eigen::VectorXd& kick,
212 const Eigen::VectorXd& sqrt_masses, double eps,
213 const GradientFn& gradient)
214{
215 const double scale = kick.norm();
216 if (!(scale > 0.0) || !kick.allFinite()) return 0.0;
217 const Eigen::VectorXd dir = kick / scale;
218 const auto plus = gradient(saddle + eps * dir);
219 const auto minus = gradient(saddle - eps * dir);
220 if (plus.second.size() != dir.size() || minus.second.size() != dir.size()) {
221 throw std::invalid_argument(
222 "IRCDriver::run: gradient length differs from the positions");
223 }
224 const double directional =
225 dir.dot(plus.second - minus.second) / (2.0 * eps);
226 const double mass_norm = dir.cwiseProduct(sqrt_masses).squaredNorm();
227 if (!(mass_norm > 0.0)) return 0.0;
228 return directional / mass_norm;
229}
230
231void requireRgsaddle(gpr::neb::RgsaddleClient& client)
232{
233 if (!client.load()) {
234 throw std::runtime_error(
235 "IRCDriver: rgsaddle is required and is not available (" +
236 client.lastMessage() +
237 "). IRC does not fall back to a local stepper.");
238 }
239 if (!client.hasIrc()) {
240 throw std::runtime_error(
241 "IRCDriver: the linked librgsaddle has no IRC entry points "
242 "(rgsaddle_irc_create, rgsaddle_irc_step, "
243 "rgsaddle_irc_set_direction). IRC does not fall back to a "
244 "local stepper.");
245 }
246 if (!client.hasIrcControls()) {
247 throw std::runtime_error(
248 "IRCDriver: the linked librgsaddle has no "
249 "rgsaddle_irc_set_lengths. IRC needs the carried rgsaddle "
250 "controls (adaptive Morokuma length, a kick length, and the "
251 "mass-weighted force gate). IRC does not fall back to a "
252 "local stepper.");
253 }
254}
255
256class IrcSessionGuard {
257public:
258 IrcSessionGuard(gpr::neb::RgsaddleClient& client,
260 : client_(&client), session_(session)
261 {
262 }
263 ~IrcSessionGuard()
264 {
265 if (client_ != nullptr) client_->ircFree(session_);
266 }
267 IrcSessionGuard(const IrcSessionGuard&) = delete;
268 IrcSessionGuard& operator=(const IrcSessionGuard&) = delete;
270 {
271 return session_;
272 }
273
274private:
277};
278
279} // namespace
280
281IRCDriver::IRCDriver(GradientFn gradient_fn, Eigen::VectorXd masses,
282 IRCOptions options)
283 : gradient_fn_(std::move(gradient_fn)),
284 masses_(std::move(masses)),
285 options_(options)
286{
287 if (!gradient_fn_) {
288 throw std::invalid_argument(
289 "IRCDriver: gradient functor must not be null");
290 }
291 if (masses_.size() < 1) {
292 throw std::invalid_argument(
293 "IRCDriver: masses vector must have at least one atom");
294 }
295 for (Eigen::Index a = 0; a < masses_.size(); ++a) {
296 if (!(masses_(a) > 0.0) || !std::isfinite(masses_(a))) {
297 throw std::invalid_argument(
298 "IRCDriver: each mass must be finite and positive");
299 }
300 }
301 sqrt_masses_ = buildSqrtMasses(masses_);
302}
303
304IRCResult IRCDriver::run(const Eigen::VectorXd& saddle_positions,
305 const Eigen::MatrixXd& saddle_hessian)
306{
307 const Eigen::Index ndof = 3 * masses_.size();
308 if (saddle_positions.size() != ndof) {
309 throw std::invalid_argument(
310 "IRCDriver::run: positions size mismatch with masses");
311 }
312 if (saddle_hessian.rows() != ndof || saddle_hessian.cols() != ndof) {
313 throw std::invalid_argument(
314 "IRCDriver::run: hessian shape mismatch with positions");
315 }
316 if (options_.method != IRCMethod::Morokuma &&
317 options_.method != IRCMethod::MorokumaExtended) {
318 throw std::invalid_argument("IRCDriver::run: unknown IRC method");
319 }
320
322 requireRgsaddle(client);
323
324 const bool want_forward = options_.direction == IRCDirection::Forward ||
325 options_.direction == IRCDirection::Both;
326 const bool want_reverse = options_.direction == IRCDirection::Reverse ||
327 options_.direction == IRCDirection::Both;
328
329 Eigen::VectorXd mode = Eigen::VectorXd::Zero(ndof);
330 bool compensate_sign = false;
331 if (options_.hessian_sketch_rank > 0) {
332 if (options_.mode_to_follow != 1) {
333 throw std::runtime_error(
334 "IRCDriver::run: rgsaddle_irc_create_from_surface returns "
335 "only the lowest mode");
336 }
337 if (!client.hasIrcFromSurface()) {
338 throw std::runtime_error(
339 "IRCDriver::run: the linked librgsaddle has no "
340 "rgsaddle_irc_create_from_surface");
341 }
342 } else {
343 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es(
344 hessianToMassWeighted(saddle_hessian, sqrt_masses_));
345 if (es.info() != Eigen::Success) {
346 throw std::runtime_error(
347 "IRCDriver::run: eigendecomposition of saddle Hessian failed");
348 }
349 const int k = std::max(1, options_.mode_to_follow) - 1;
350 if (k >= es.eigenvalues().size()) {
351 throw std::invalid_argument(
352 "IRCDriver::run: mode_to_follow exceeds available "
353 "eigenmodes");
354 }
355 if (es.eigenvalues()(k) >= 0.0) {
356 throw std::runtime_error(
357 "IRCDriver::run: requested mode is not imaginary "
358 "(eigenvalue >= 0); not a saddle along this coordinate");
359 }
360 const Eigen::VectorXd v_mw = es.eigenvectors().col(k);
361 mode = v_mw.cwiseQuotient(sqrt_masses_);
362 compensate_sign = true;
363 }
364
365 int evals = 0;
366 IrcSurface surface;
367 surface.gradient = &gradient_fn_;
368 surface.evals = &evals;
369 surface.ndof = ndof;
370
371 auto direction_code = [&](bool forward) -> int32_t {
372 if (!compensate_sign)
373 return forward ? RGSADDLE_IRC_FORWARD : RGSADDLE_IRC_REVERSE;
374 return rgsaddleDirection(forward, mode.cwiseProduct(sqrt_masses_));
375 };
376
377 const bool first_is_forward = want_forward || !want_reverse;
378 const int32_t first_direction = direction_code(first_is_forward);
379 const rgsaddle_irc_config_t cfg =
380 ircConfig(client, options_, first_direction);
381 gpr::neb::RgsaddleClient::Irc raw = nullptr;
382 if (options_.hessian_sketch_rank > 0) {
383 const Eigen::VectorXd seed = surfaceLaunchSeed(
384 options_.sketch_seed, saddle_positions, masses_, sqrt_masses_);
385 raw = client.ircCreateFromSurface(
386 &cfg, static_cast<int64_t>(masses_.size()), saddle_positions.data(),
387 masses_.data(), seed.data(), ircSurface, &surface);
388 } else {
389 raw = client.ircCreate(&cfg, static_cast<int64_t>(masses_.size()),
390 saddle_positions.data(), masses_.data(),
391 mode.data());
392 }
393 if (raw == nullptr) {
394 throw std::runtime_error(
395 options_.hessian_sketch_rank > 0
396 ? "IRCDriver::run: rgsaddle_irc_create_from_surface returned "
397 "null"
398 : "IRCDriver::run: rgsaddle_irc_create returned null");
399 }
400 IrcSessionGuard session(client, raw);
401 const int lengths = client.ircSetLengths(
402 session.get(), options_.initial_displacement, options_.max_step,
403 options_.min_step,
404 options_.method == IRCMethod::MorokumaExtended ? 1 : 0);
405 if (lengths != RGSADDLE_OK) {
406 throw std::runtime_error(
407 "IRCDriver::run: rgsaddle_irc_set_lengths failed with status " +
408 std::to_string(lengths));
409 }
410 if (options_.hessian_sketch_rank > 0) {
411 // The kick displacement is parallel to the mode Lanczos returned.
412 // Put the session back on the saddle before the branch is traced.
413 surface.capture = true;
414 surface.captured = false;
415 surface.saw_last = false;
416 rgsaddle_report_t launch{};
417 const int stepped =
418 client.ircStep(session.get(), ircSurface, &surface, &launch);
419 if (stepped != RGSADDLE_OK) {
420 throw std::runtime_error(
421 "IRCDriver::run: rgsaddle_irc_step failed with status " +
422 std::to_string(stepped));
423 }
424 if (!surface.captured) {
425 throw std::runtime_error(
426 "IRCDriver::run: rgsaddle_irc_step did not evaluate "
427 "the surface");
428 }
429 const Eigen::VectorXd kick = surface.position - saddle_positions;
430 const int restored =
431 client.ircSetDirection(session.get(), first_direction);
432 if (restored != RGSADDLE_OK) {
433 throw std::runtime_error(
434 "IRCDriver::run: rgsaddle_irc_set_direction failed "
435 "with status " +
436 std::to_string(restored));
437 }
438 const double eps =
439 options_.hv_eps > 0.0 && std::isfinite(options_.hv_eps)
440 ? options_.hv_eps
441 : 1e-3;
442 const double curvature = massWeightedCurvature(
443 saddle_positions, kick, sqrt_masses_, eps, gradient_fn_);
444 if (curvature >= 0.0) {
445 throw std::runtime_error(
446 "IRCDriver::run: requested mode is not imaginary "
447 "(eigenvalue >= 0); not a saddle along this coordinate");
448 }
449 }
450
451 auto trace = [&]() {
452 IRCBranch branch;
453 branch.path.reserve(
454 static_cast<std::size_t>(std::max(options_.max_steps, 0)) + 1);
455 const int evals_before = evals;
456 IRCStep saddle_step;
457 saddle_step.positions = saddle_positions;
458 if (options_.record_energy) {
459 const auto evaluated = gradient_fn_(saddle_positions);
460 ++evals;
461 if (evaluated.second.size() != ndof) {
462 throw std::invalid_argument(
463 "IRCDriver::run: gradient length differs from the "
464 "positions");
465 }
466 saddle_step.energy = evaluated.first;
467 saddle_step.gradient = evaluated.second;
468 saddle_step.g_norm =
469 evaluated.second.cwiseQuotient(sqrt_masses_).norm();
470 }
471 branch.path.push_back(std::move(saddle_step));
472
473 Eigen::VectorXd previous = saddle_positions;
474 double arc = 0.0;
475 for (int step = 0; step < options_.max_steps; ++step) {
476 surface.capture = true;
477 surface.captured = false;
478 surface.saw_last = false;
479 rgsaddle_report_t report{};
480 const int rc =
481 client.ircStep(session.get(), ircSurface, &surface, &report);
482 if (rc != RGSADDLE_OK) {
483 throw std::runtime_error(
484 "IRCDriver::run: rgsaddle_irc_step failed with status " +
485 std::to_string(rc));
486 }
487 if (!surface.captured) {
488 throw std::runtime_error(
489 "IRCDriver::run: rgsaddle_irc_step did not evaluate "
490 "the surface");
491 }
492 IRCStep sample;
493 sample.positions = surface.position;
494 sample.gradient = surface.gradient_value;
495 sample.energy = surface.energy;
496 sample.g_norm =
497 surface.gradient_value.cwiseQuotient(sqrt_masses_).norm();
498 arc +=
499 (surface.position - previous).cwiseProduct(sqrt_masses_).norm();
500 sample.cumulative_arc = arc;
501 previous = surface.position;
502 const bool small_gradient = sample.g_norm <= options_.conv_tol;
503 branch.path.push_back(std::move(sample));
504 // The kick keeps at_minimum false, so a small force on that
505 // first sample is the saddle neighborhood. A later step that
506 // is already inside tolerance returns at_minimum without
507 // moving; that sample is the stop. The block below does not
508 // append a point the session did not leave.
509 const bool library_done =
510 report.status == RGSADDLE_STATUS_CONVERGED;
511 if (small_gradient && library_done) {
512 branch.converged = true;
513 break;
514 }
515 // status 1 describes the session position after the step, which
516 // can be a later evaluation than the sample just stored. Stop
517 // only when that accepted geometry is inside conv_tol.
518 if (report.status == RGSADDLE_STATUS_CONVERGED) {
519 Eigen::VectorXd accepted(ndof);
520 if (client.ircPosition(session.get(), accepted.data()) !=
521 RGSADDLE_OK) {
522 throw std::runtime_error(
523 "IRCDriver::run: rgsaddle_irc_position failed");
524 }
525 if ((accepted - branch.path.back().positions).norm() > 1e-12) {
526 IRCStep arrived;
527 const bool last_is_accepted =
528 surface.saw_last &&
529 (surface.last_position - accepted).norm() <= 1e-12;
530 if (last_is_accepted) {
531 arrived.positions = surface.last_position;
532 arrived.gradient = surface.last_gradient;
533 arrived.energy = surface.last_energy;
534 } else {
535 const auto evaluated = gradient_fn_(accepted);
536 ++evals;
537 if (evaluated.second.size() != ndof) {
538 throw std::invalid_argument(
539 "IRCDriver::run: gradient length differs "
540 "from the positions");
541 }
542 arrived.positions = accepted;
543 arrived.energy = evaluated.first;
544 arrived.gradient = evaluated.second;
545 }
546 arrived.g_norm =
547 arrived.gradient.cwiseQuotient(sqrt_masses_).norm();
548 if (arrived.g_norm <= options_.conv_tol) {
549 arc += (arrived.positions - previous)
550 .cwiseProduct(sqrt_masses_)
551 .norm();
552 arrived.cumulative_arc = arc;
553 previous = arrived.positions;
554 branch.path.push_back(std::move(arrived));
555 branch.converged = true;
556 break;
557 }
558 }
559 }
560 }
561 branch.gradient_evals = evals - evals_before;
562 branch.final_energy =
563 branch.path.empty() ? 0.0 : branch.path.back().energy;
564 return branch;
565 };
566
568 if (want_forward) out.forward = trace();
569 if (want_reverse) {
570 if (want_forward) {
571 const int rc =
572 client.ircSetDirection(session.get(), direction_code(false));
573 if (rc != RGSADDLE_OK) {
574 throw std::runtime_error(
575 "IRCDriver::run: rgsaddle_irc_set_direction failed "
576 "with status " +
577 std::to_string(rc));
578 }
579 }
580 out.reverse = trace();
581 }
582 return out;
583}
584
585} // namespace irc
586} // namespace gpr
@ z
Definition Enums.h:28
IRCDriver(GradientFn gradient_fn, Eigen::VectorXd masses, IRCOptions options={})
IRCResult run(const Eigen::VectorXd &saddle_positions, const Eigen::MatrixXd &saddle_hessian)
int ircStep(Irc session, rgsaddle_surface_fn surface, void *user, rgsaddle_report_t *out)
Irc ircCreateFromSurface(const rgsaddle_irc_config_t *cfg, int64_t n_atoms, const double *saddle, const double *masses, const double *seed, rgsaddle_surface_fn surface, void *user)
uint32_t abiMajor() const noexcept
Irc ircCreate(const rgsaddle_irc_config_t *cfg, int64_t n_atoms, const double *saddle, const double *masses, const double *mode)
bool hasIrcControls() const noexcept
int ircPosition(const Irc session, double *out)
uint32_t abiMinor() const noexcept
int ircSetLengths(Irc session, double kick, double max_step, double min_step, int adaptive)
bool load(const std::string &path={})
bool hasIrc() const noexcept
const std::string & lastMessage() const noexcept
int ircSetDirection(Irc session, int32_t direction)
bool hasIrcFromSurface() const noexcept
rgsaddle_irc_create_from_surface. The Lanczos kick needs it.
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
eon_relax_band_t eon_relax_surface_fn surface
eon_relax_band_t eon_relax_surface_fn void * user
Intrinsic reaction coordinate drivers in mass-weighted coordinates.
Definition IRCDriver.cpp:20
std::function< std::pair< double, Eigen::VectorXd >(const Eigen::VectorXd &)> GradientFn
Definition IRCDriver.h:114
Eigen::MatrixXd vibrationalComplement(const Eigen::VectorXd &positions, const Eigen::VectorXd &masses)
Eigen::MatrixXd massWeightedRigidMotions(const Eigen::VectorXd &positions, const Eigen::VectorXd &masses)
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
STL namespace.
std::vector< IRCStep > path
Definition IRCDriver.h:101
double initial_displacement
Definition IRCDriver.h:73
Eigen::VectorXd gradient
Definition IRCDriver.h:94
Eigen::VectorXd positions
Definition IRCDriver.h:93
double cumulative_arc
Definition IRCDriver.h:97