815 const Eigen::VectorXd& positions,
const Eigen::VectorXd& masses,
816 double step,
const GradientAt& gradient_at,
817 double stiff_floor = std::numeric_limits<double>::infinity())
820 const Eigen::Index dof = positions.size();
821 if (!(step > 0.0) || dof == 0 || dof % 3 != 0 || masses.size() * 3 != dof ||
822 !positions.allFinite() || !masses.allFinite() ||
823 (masses.array() <= 0.0).any())
826 const Eigen::JacobiSVD<Eigen::MatrixXd> svd(rigid, Eigen::ComputeFullU);
827 const Eigen::Index rank = svd.rank();
828 if (rank < 0 || rank >= dof)
return out;
829 const Eigen::MatrixXd basis = svd.matrixU().rightCols(dof - rank);
830 const Eigen::Index m = basis.cols();
831 if (m <= 0)
return out;
832 const double roundoff = std::sqrt(std::numeric_limits<double>::epsilon()) *
833 std::sqrt(
static_cast<double>(m));
835 const auto product = [&](
const Eigen::VectorXd& reduced,
836 Eigen::VectorXd& action) {
837 const Eigen::VectorXd direction = basis * reduced;
838 if (!(direction.norm() > 0.0) || !direction.allFinite())
return false;
839 const Eigen::MatrixXd points =
841 Eigen::VectorXd plus(dof);
842 Eigen::VectorXd minus(dof);
843 if (!gradient_at(points.col(0), plus) ||
844 !gradient_at(points.col(1), minus) || plus.size() != dof ||
845 minus.size() != dof || !plus.allFinite() || !minus.allFinite())
847 action = basis.transpose() * ((plus - minus) / (2.0 * step));
848 return action.size() == m && action.allFinite();
850 const auto orthogonalize = [&](Eigen::VectorXd& direction,
851 const Eigen::MatrixXd& span,
852 Eigen::Index columns) {
853 if (columns <= 0)
return;
854 const Eigen::MatrixXd basis_now = span.leftCols(columns);
855 for (
int pass = 0; pass < 2; ++pass)
856 direction -= basis_now * (basis_now.transpose() * direction);
859 Eigen::MatrixXd directions(m, m);
860 Eigen::MatrixXd actions(m, m);
861 Eigen::Index columns = 0;
862 while (columns < m) {
863 Eigen::VectorXd direction(m);
867 const Eigen::MatrixXd projected =
868 directions.leftCols(columns).transpose() *
869 actions.leftCols(columns);
870 const Eigen::MatrixXd symmetric =
871 0.5 * (projected + projected.transpose());
872 const Eigen::MatrixXd antisymmetric =
873 0.5 * (projected - projected.transpose());
874 const double resolution =
875 antisymmetric.size() == 0
877 : Eigen::JacobiSVD<Eigen::MatrixXd>(antisymmetric)
878 .singularValues()(0);
879 const Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> spectrum(
881 if (spectrum.info() != Eigen::Success ||
882 !spectrum.eigenvalues().allFinite())
884 const Eigen::VectorXd coordinate = spectrum.eigenvectors().col(0);
885 const double theta = spectrum.eigenvalues()(0);
886 Eigen::VectorXd residual =
887 actions.leftCols(columns) * coordinate -
888 theta * (directions.leftCols(columns) * coordinate);
892 const double residual_norm = residual.norm();
893 if (columns >= 2 && std::isfinite(theta) &&
894 std::isfinite(residual_norm) && std::isfinite(resolution)) {
895 const double next = spectrum.eigenvalues()(1);
896 const double gap = next - theta;
897 const double noise = std::max(resolution, roundoff);
901 if (theta + residual_norm < -resolution &&
902 gap > residual_norm && residual_norm <= noise) {
903 out.resolution = resolution;
905 out.lambda_max = spectrum.eigenvalues()(columns - 1);
906 const double floor = std::max(resolution, 0.0);
907 for (Eigen::Index i = 0; i < columns; ++i) {
908 const double value = spectrum.eigenvalues()(i);
909 if (value > floor && !std::isfinite(
out.lambda_min))
910 out.lambda_min = value;
912 Eigen::VectorXd cartesian =
913 basis * (directions.leftCols(columns) * coordinate);
914 const double norm = cartesian.norm();
915 if (!(norm > 0.0) || !cartesian.allFinite())
return {};
917 out.cartesian_lowest = cartesian;
918 out.cartesian = cartesian;
919 double mass_norm = 0.0;
920 for (Eigen::Index atom = 0; atom < masses.size(); ++atom)
923 cartesian.segment<3>(3 * atom).squaredNorm();
924 out.curvature = mass_norm > 0.0 ? theta / mass_norm : theta;
925 out.ok = std::isfinite(
out.curvature);
929 orthogonalize(residual, directions, columns);
930 const double outside =
931 roundoff * (1.0 + actions.leftCols(columns).norm());
932 if (!(residual.norm() > outside)) {
933 Eigen::Index least = 0;
934 double smallest = std::numeric_limits<double>::infinity();
935 const Eigen::MatrixXd span = directions.leftCols(columns);
936 for (Eigen::Index i = 0; i < m; ++i) {
937 const double represented = span.row(i).norm();
938 if (represented < smallest) {
939 smallest = represented;
943 residual = Eigen::VectorXd::Unit(m, least);
944 orthogonalize(residual, directions, columns);
946 direction = residual;
948 const double norm = direction.norm();
949 if (!(norm > roundoff) || !direction.allFinite())
return {};
951 Eigen::VectorXd action;
952 if (!product(direction, action))
return {};
953 directions.col(columns) = direction;
954 actions.col(columns) = action;
958 const Eigen::MatrixXd projected = directions.transpose() * actions;
959 const Eigen::MatrixXd symmetric = 0.5 * (projected + projected.transpose());
960 const Eigen::MatrixXd antisymmetric =
961 0.5 * (projected - projected.transpose());
962 const double resolution =
963 antisymmetric.size() == 0
965 : Eigen::JacobiSVD<Eigen::MatrixXd>(antisymmetric)
966 .singularValues()(0);
967 if (!symmetric.allFinite() || !std::isfinite(resolution))
return {};
968 const Eigen::MatrixXd hessian =
969 basis * (directions * symmetric * directions.transpose()) *
1278 const Eigen::VectorXd& saddle,
const Eigen::VectorXd& masses,
1279 double force_tolerance,
const Eigen::VectorXd& reactant,
1280 const Eigen::VectorXd& product,
const std::vector<int>& atomic_numbers,
1283 const std::function<
bool()>* stop =
nullptr,
1284 const std::vector<KnownOracleRow>* known =
nullptr,
1285 const Eigen::MatrixXd* model_hessian =
nullptr,
1286 const Eigen::MatrixXd* held_directions =
nullptr,
1290 const Eigen::Index dof = saddle.size();
1291 const Eigen::Index n_atoms = masses.size();
1292 if (dof == 0 || dof % 3 != 0 || n_atoms * 3 != dof ||
1293 reactant.size() != dof || product.size() != dof ||
1294 static_cast<Eigen::Index
>(atomic_numbers.size()) != n_atoms ||
1295 !saddle.allFinite() || !masses.allFinite() ||
1296 (masses.array() <= 0.0).any() || !reactant.allFinite() ||
1297 !product.allFinite() || !(force_tolerance > 0.0) ||
1298 !std::isfinite(force_tolerance) || !(hessian_step > 0.0))
1307 Eigen::setNbThreads(1);
1308#ifdef GPR_HAVE_OPENBLAS
1309 openblas_set_num_threads(1);
1312 endpoint_detail::MinimizerState state;
1314 endpoint_detail::OracleMemory
memory;
1315 if (known !=
nullptr) {
1317 memory.add(row.position, row.energy, row.gradient);
1320 state.oracle = [&](
const Eigen::VectorXd& position,
double& energy,
1321 Eigen::VectorXd& gradient) {
1322 if (stop !=
nullptr && (*stop)()) {
1323 state.stopped =
true;
1326 if (
memory.recall(position, energy, gradient))
return true;
1327 const auto started = std::chrono::steady_clock::now();
1328 const auto sample = oracle(position);
1330 std::chrono::steady_clock::now() - started)
1332 energy = sample.first;
1333 gradient = sample.second;
1334 if (!(std::isfinite(energy) && gradient.size() == position.size() &&
1335 gradient.allFinite()))
1337 memory.add(position, energy, gradient);
1342 const auto gradient_at = [&](
const Eigen::VectorXd& position,
1343 Eigen::VectorXd& gradient) {
1344 double energy = 0.0;
1345 if (!state.oracle(position, energy, gradient)) {
1346 if (!state.stopped) state.failed =
true;
1357 const auto minimum_at = [&](
const Eigen::VectorXd& position) {
1359 if (minimum_cache.
recall(position, cached))
return cached;
1360 const auto sample = [&](
const Eigen::VectorXd& queried,
1361 Eigen::VectorXd& gradient) {
1362 double energy = 0.0;
1363 return state.oracle(queried, energy, gradient);
1373 :
spectrumAt(position, masses, hessian_step, gradient_at);
1378 const double reach =
1379 std::max((saddle - reactant).norm(), (saddle - product).norm());
1386 const int vibrational = std::max(1,
static_cast<int>(dof) - 6);
1387 const int max_steps =
1388 std::max(vibrational + vibrational,
1390 std::ceil(std::max(reach, hessian_step) / hessian_step)));
1392 const bool cache_hit = cache !=
nullptr && cache->ready &&
1393 cache->tolerance == force_tolerance &&
1394 cache->atomic_numbers == atomic_numbers &&
1395 cache->deposited_reactant.size() == dof &&
1396 cache->deposited_product.size() == dof &&
1397 cache->deposited_reactant == reactant &&
1398 cache->deposited_product == product &&
1399 cache->relaxed_reactant.size() == dof &&
1400 cache->relaxed_product.size() == dof;
1402 Eigen::VectorXd relaxed_reactant;
1403 Eigen::VectorXd relaxed_product;
1405 relaxed_reactant = cache->relaxed_reactant;
1406 relaxed_product = cache->relaxed_product;
1415 const auto settle = [&](
const Eigen::VectorXd& start) {
1416 endpoint_detail::RelaxedPoint point =
1417 endpoint_detail::relaxWithLbfgs(
1418 state, start, force_tolerance, max_steps, hessian_step,
1419 std::max(reach, hessian_step), vibrational, stop);
1422 pass < vibrational && point.converged && !state.failed;
1425 spec = minimum_at(point.position);
1430 if (!(direction.norm() > 0.0))
break;
1431 direction.normalize();
1432 const double alpha =
1435 const Eigen::VectorXd kick = alpha * direction;
1436 double energy_plus = 0.0;
1437 double energy_minus = 0.0;
1438 Eigen::VectorXd gradient(dof);
1439 const Eigen::VectorXd plus = point.position + kick;
1440 const Eigen::VectorXd minus = point.position - kick;
1441 if (!state.oracle(plus, energy_plus, gradient) ||
1442 !state.oracle(minus, energy_minus, gradient)) {
1444 point.stopped =
true;
1446 state.failed =
true;
1449 const double sign = energy_plus < energy_minus ? 1.0 : -1.0;
1450 Eigen::VectorXd walked = point.position + sign * kick;
1452 energy_plus < energy_minus ? energy_plus : energy_minus;
1453 const int push_cap = std::max(
1454 1,
static_cast<int>(
1455 std::ceil(std::max(reach, kick.norm()) /
1456 std::max(kick.norm(), hessian_step))));
1457 for (
int pushed = 1; pushed < push_cap && !state.failed;
1459 const Eigen::VectorXd trial = walked + sign * kick;
1460 double trial_energy = 0.0;
1461 if (!state.oracle(trial, trial_energy, gradient)) {
1463 point.stopped =
true;
1465 state.failed =
true;
1468 if (!(trial_energy < energy))
break;
1470 point.position, trial, atomic_numbers);
1472 energy = trial_energy;
1473 if (std::isfinite(travelled) && reach > 0.0 &&
1481 point = endpoint_detail::relaxWithLbfgs(
1482 state, walked, force_tolerance, max_steps,
1483 kick.norm() > 0.0 ? kick.norm() : hessian_step,
1484 std::max(reach, kick.norm()), vibrational, stop);
1485 if (point.stopped)
break;
1487 if (point.converged && !state.failed && !spec.
ok) {
1489 spec = minimum_at(point.position);
1492 return std::pair{point, spec};
1494 const auto reactant_settled = settle(reactant);
1495 const auto product_settled = settle(product);
1496 const auto& reactant_min = reactant_settled.first;
1497 const auto& product_min = product_settled.first;
1498 const auto& reactant_spectrum = reactant_settled.second;
1499 const auto& product_spectrum = product_settled.second;
1500 if (reactant_min.stopped || product_min.stopped || state.stopped) {
1501 report.
calls = state.calls;
1506 if (!reactant_min.converged || !product_min.converged || state.failed) {
1507 report.
calls = state.calls;
1512 relaxed_reactant = reactant_min.position;
1513 relaxed_product = product_min.position;
1514 if (!reactant_spectrum.ok || !product_spectrum.ok || state.failed) {
1515 report.
calls = state.calls;
1524 if (cache !=
nullptr) {
1525 cache->deposited_reactant = reactant;
1526 cache->deposited_product = product;
1527 cache->atomic_numbers = atomic_numbers;
1528 cache->tolerance = force_tolerance;
1529 cache->relaxed_reactant = relaxed_reactant;
1530 cache->relaxed_product = relaxed_product;
1533 cache->ready =
true;
1538 labelledRmsd(relaxed_reactant, relaxed_product, atomic_numbers);
1539 const double half_separation =
1541 const double harmonic_reactant =
1543 std::numeric_limits<double>::infinity());
1544 const double harmonic_product =
1546 std::numeric_limits<double>::infinity());
1548 report.
separation, harmonic_reactant, harmonic_product);
1560 const double stiff_floor = force_tolerance / hessian_step;
1563 const Eigen::MatrixXd saddle_directions =
1565 const Eigen::MatrixXd saddle_points =
1567 bool stencil_held = saddle_points.cols() > 0;
1568 for (Eigen::Index j = 0; j < saddle_points.cols() && stencil_held; ++j)
1569 stencil_held =
memory.holds(saddle_points.col(j));
1572 const auto note_measured_index = [&](
const Eigen::MatrixXd& raw) {
1573 if (stencil_held)
return;
1575 raw, saddle, masses, hessian_step,
1576 [&](
const Eigen::MatrixXd& points) {
1577 Eigen::MatrixXd rows(points.cols(), points.rows());
1578 for (Eigen::Index i = 0; i < points.cols(); ++i) {
1579 double energy = 0.0;
1580 Eigen::VectorXd gradient(points.rows());
1581 if (!state.oracle(points.col(i), energy, gradient)) {
1585 rows.row(i) = gradient.transpose();
1589 &saddle_directions);
1590 if (!std::isfinite(decision.resolution))
return;
1600 bool model_mode =
false;
1601 Eigen::MatrixXd measured_columns;
1602 if (!stencil_held && model_hessian !=
nullptr) {
1605 model_mode = saddle_spectrum.
ok &&
1610 spectrumAt(saddle, masses, hessian_step, gradient_at, stiff_floor,
1611 &measured_columns, &saddle_directions);
1612 if (saddle_spectrum.
ok) note_measured_index(measured_columns);
1620 if (state.stopped) {
1621 report.
calls = state.calls;
1626 if (!saddle_spectrum.
ok ||
1629 report.
calls = state.calls;
1637 const Eigen::VectorXd aligned_reactant =
1639 const Eigen::VectorXd aligned_product =
1641 Eigen::VectorXd reaction_chord;
1642 if (aligned_reactant.size() == dof && aligned_product.size() == dof &&
1643 aligned_reactant.allFinite() && aligned_product.allFinite()) {
1646 const double chord_norm = reaction_chord.norm();
1647 if (chord_norm > 0.0)
1648 reaction_chord /= chord_norm;
1650 reaction_chord.resize(0);
1653 Eigen::VectorXd direction =
1655 if (!(direction.norm() > 0.0))
return direction;
1656 direction.normalize();
1657 constexpr double kRelativeTieTolerance = 1e-3;
1658 if (reaction_chord.size() == dof) {
1659 const double projection = direction.dot(reaction_chord);
1660 if (std::abs(projection) > kRelativeTieTolerance) {
1661 if (projection < 0.0) direction = -direction;
1665 const double biggest = direction.cwiseAbs().maxCoeff();
1666 const double tie_floor = (1.0 - kRelativeTieTolerance) * biggest;
1667 Eigen::Index pivot = 0;
1668 for (Eigen::Index i = 0; i < direction.size(); ++i) {
1669 if (std::abs(direction(i)) >= tie_floor) {
1674 if (direction(pivot) < 0.0) direction = -direction;
1677 Eigen::VectorXd mode = signed_mode(saddle_spectrum);
1683 const auto measure_saddle = [&]() {
1684 if (state.stopped)
return false;
1687 spectrumAt(saddle, masses, hessian_step, gradient_at, stiff_floor,
1688 &measured_columns, &saddle_directions);
1690 if (saddle_spectrum.
ok) note_measured_index(measured_columns);
1691 if (!saddle_spectrum.
ok ||
1696 mode = signed_mode(saddle_spectrum);
1697 return mode.norm() > 0.0;
1699 if (model_mode && mode.norm() > 0.0) {
1701 Eigen::VectorXd slope_plus(dof);
1702 Eigen::VectorXd slope_minus(dof);
1704 gradient_at(saddle + hessian_step * mode, slope_plus) &&
1705 gradient_at(saddle - hessian_step * mode, slope_minus);
1707 const double directional =
1708 probed ? (slope_plus - slope_minus).dot(mode) / (2.0 * hessian_step)
1710 const bool imaginary = probed && directional < 0.0;
1720 if (state.stopped) {
1721 report.
calls = state.calls;
1726 if (!measure_saddle()) {
1727 report.
calls = state.calls;
1731 }
else if (model_mode && !measure_saddle()) {
1732 report.
calls = state.calls;
1735 if (!(mode.norm() > 0.0)) {
1736 report.
calls = state.calls;
1741 double alpha = force_tolerance / std::abs(saddle_spectrum.
curvature);
1742 if (half_separation > 0.0) {
1743 const double kick_rmsd =
1744 (alpha * mode).norm() / std::sqrt(
static_cast<double>(n_atoms));
1745 if (kick_rmsd > half_separation) alpha *= half_separation / kick_rmsd;
1747 report.
kick = alpha;
1749 const auto irc = [&](
double sign) {
1750 endpoint_detail::RelaxedPoint
out;
1751 out.position = saddle + sign * alpha * mode;
1752 double energy = 0.0;
1753 Eigen::VectorXd gradient(dof);
1754 if (!state.oracle(
out.position, energy, gradient)) {
1758 state.failed =
true;
1761 out.energy = energy;
1776 const double floor_curvature = saddle_spectrum.
resolution;
1777 double carried_step = hessian_step;
1778 for (
int step = 0; step < max_steps && !state.failed; ++step) {
1779 if (stop !=
nullptr && (*stop)()) {
1783 if (
out.max_force < force_tolerance)
break;
1784 Eigen::VectorXd driving = gradient;
1785 if (saddle_spectrum.
stiff.cols() > 0 &&
1786 saddle_spectrum.
stiff.rows() == gradient.size()) {
1787 const Eigen::VectorXd coeff =
1788 saddle_spectrum.
stiff.transpose() * gradient;
1789 const Eigen::VectorXd soft =
1790 gradient - saddle_spectrum.
stiff * coeff;
1791 if (soft.norm() > 0.0) driving = soft;
1793 Eigen::VectorXd direction(dof);
1794 for (Eigen::Index k = 0; k < dof; ++k)
1795 direction(k) = -driving(k) / masses(k / 3);
1796 if (!(direction.norm() > 0.0))
break;
1797 direction.normalize();
1798 const double slope = -gradient.dot(direction);
1799 if (!(slope > 0.0))
break;
1800 double step_length =
1801 carried_step > 0.0 ? carried_step : hessian_step;
1802 if (reach > 0.0) step_length = std::min(step_length, reach);
1803 bool accepted =
false;
1805 for (
int trial_index = 0;
1806 trial_index < vibrational && step_length > 0.0;
1808 const Eigen::VectorXd trial =
1809 out.position + step_length * direction;
1810 double trial_energy = 0.0;
1811 Eigen::VectorXd trial_gradient(dof);
1812 if (!state.oracle(trial, trial_energy, trial_gradient)) {
1816 state.failed =
true;
1819 const double curvature =
1820 2.0 * (trial_energy - energy + slope * step_length) /
1821 (step_length * step_length);
1822 const bool bounded =
1823 curvature > floor_curvature && std::isfinite(curvature);
1824 const bool descends = trial_energy < energy;
1826 double newton = slope / curvature;
1827 if (!std::isfinite(newton) || !(newton > 0.0))
break;
1828 if (reach > 0.0) newton = std::min(newton, reach);
1829 if (descends && !
extended && newton > step_length) {
1830 step_length = newton;
1834 if (!descends && newton < step_length) {
1835 step_length = newton;
1838 }
else if (!descends) {
1841 if (!descends)
break;
1842 out.position = trial;
1843 energy = trial_energy;
1844 out.energy = energy;
1845 const double slope_trial = -trial_gradient.dot(direction);
1846 gradient = std::move(trial_gradient);
1849 if (!bounded && slope_trial > slope) {
1850 carried_step = step_length * (slope_trial / slope);
1852 carried_step = std::min(carried_step, reach);
1854 carried_step = step_length;
1860 if (
out.stopped || !accepted)
break;
1866 const int descended =
out.steps;
1868 out = endpoint_detail::relaxWithLbfgs(
1869 state,
out.position, force_tolerance, max_steps, carried_step,
1870 std::max(reach, carried_step), vibrational, stop);
1871 out.steps += descended;
1872 if (stop !=
nullptr && (*stop)())
out.stopped =
true;
1878 for (
int pass = 0; pass < vibrational && !state.failed && !
out.stopped;
1880 if (stop !=
nullptr && (*stop)()) {
1884 spec = minimum_at(
out.position);
1886 Eigen::VectorXd direction =
1888 if (!(direction.norm() > 0.0))
break;
1889 direction.normalize();
1890 const double leave =
1893 double energy_plus = 0.0;
1894 double energy_minus = 0.0;
1895 Eigen::VectorXd probe(dof);
1896 if (!state.oracle(
out.position + leave * direction, energy_plus,
1898 !state.oracle(
out.position - leave * direction, energy_minus,
1903 state.failed =
true;
1906 const double side = energy_plus < energy_minus ? 1.0 : -1.0;
1907 const int before_leave =
out.steps;
1908 out = endpoint_detail::relaxWithLbfgs(
1909 state,
out.position + side * leave * direction, force_tolerance,
1910 max_steps, leave, std::max(reach, leave), vibrational, stop);
1911 out.steps += before_leave;
1912 if (
out.stopped)
break;
1915 if (!spec.
ok && !state.failed) spec = minimum_at(
out.position);
1920 const int forward_before = state.calls;
1921 const auto forward =
irc(1.0);
1923 const int reverse_before = state.calls;
1924 const auto reverse =
irc(-1.0);
1926 report.
calls = state.calls;
1927 report.
unresolved = forward.stopped || reverse.stopped || state.stopped;
1928 if (state.failed || !forward.position.allFinite() ||
1929 !reverse.position.allFinite() || forward.position.size() != dof ||
1930 reverse.position.size() != dof) {
1943 const auto match_started = std::chrono::steady_clock::now();
1945 labelledRmsd(relaxed_reactant, forward.position, atomic_numbers);
1947 labelledRmsd(relaxed_product, forward.position, atomic_numbers);
1949 labelledRmsd(relaxed_reactant, reverse.position, atomic_numbers);
1951 labelledRmsd(relaxed_product, reverse.position, atomic_numbers);
1961 forward.position, reverse.position, atomic_numbers);
1964 report.
ambiguous = forward.negative_remains || reverse.negative_remains;
1970 std::chrono::steady_clock::now() - match_started)
1972 const bool forward_reactant_graph =
1975 const bool forward_product_graph =
1978 const bool reverse_reactant_graph =
1981 const bool reverse_product_graph =
1989 forward_reactant_graph != forward_product_graph &&
1990 reverse_reactant_graph != reverse_product_graph &&
1991 forward_reactant_graph != reverse_reactant_graph;
1994 const bool forward_reactant =
1996 current.forward_product, current.reactant_ball);
1997 const bool forward_product =
1999 current.forward_reactant, current.product_ball);
2000 const bool reverse_reactant =
2002 current.reverse_product, current.reactant_ball);
2003 const bool reverse_product =
2005 current.reverse_reactant, current.product_ball);
2006 const bool forward_one = forward_reactant != forward_product;
2007 const bool reverse_one = reverse_reactant != reverse_product;
2008 return forward_one && reverse_one &&
2009 forward_reactant != reverse_reactant;
2018 const bool minima = report.
forward_force < force_tolerance &&
2028 const auto energy_of = [&](
const Eigen::VectorXd& position) {
2029 double energy = 0.0;
2030 Eigen::VectorXd gradient(dof);
2031 if (!state.oracle(position, energy, gradient))
2032 return std::numeric_limits<double>::quiet_NaN();
2046 report.
calls = state.calls;