.. index:: pair: namespace; atmd .. _doxid-namespaceatmd: namespace atmd ============== .. toctree:: :hidden: enum_atmd_DimerOracleProgressAction.rst enum_atmd_DimerProposalGlobalizationAction.rst enum_atmd_DimerRelaxationCycleKind.rst enum_atmd_DimerRelaxationTerminationReason.rst enum_atmd_DimerResidualGlobalizationAction.rst enum_atmd_DimerSurrogateActionTermination.rst enum_atmd_HssvdModeSelectionPolicy.rst struct_atmd_DimerRelaxationBacktrackResult.rst struct_atmd_DimerRelaxationCycleCertificate.rst struct_atmd_DimerSaddleMeritBacktrackResult.rst struct_atmd_DimerSurrogateActionCertificate.rst class_atmd_AtomicDimer.rst class_atmd_OracleBudgetExhausted.rst Overview ~~~~~~~~ The atomic dimer search (class :ref:`AtomicDimer `) and its status types. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace atmd { // enums enum :ref:`DimerOracleProgressAction`; enum :ref:`DimerProposalGlobalizationAction`; enum :ref:`DimerRelaxationCycleKind`; enum :ref:`DimerRelaxationTerminationReason`; enum :ref:`DimerResidualGlobalizationAction`; enum :ref:`DimerSurrogateActionTermination`; enum :ref:`HssvdModeSelectionPolicy`; // structs struct :ref:`DimerRelaxationBacktrackResult`; struct :ref:`DimerRelaxationCycleCertificate`; struct :ref:`DimerSaddleMeritBacktrackResult`; struct :ref:`DimerSurrogateActionCertificate`; // classes class :ref:`AtomicDimer`; class :ref:`OracleBudgetExhausted`; // global variables :ref:`gpr::Index_t` :ref:`kMaxStalledDegenerateProbes` = 30; int :ref:`kMaxConsecutiveOracleFailures` = 8; // global functions bool :target:`shouldLogDimerFinalState`(const :ref:`gpr::Index_t` debug_level); void :ref:`writeDimerCampaignSummary`(std::ostream& os, double energy, bool converged, double energy_zero = 0.0); Eigen::Index :ref:`selectHssvdModeIndex`(const Eigen::VectorXd& eigenvalues, const Eigen::MatrixXd& eigenvectors, const Eigen::VectorXd& reference, :ref:`HssvdModeSelectionPolicy` policy); const :ref:`gpr::Coord`& :ref:`selectHssvdModeReference`(const :ref:`gpr::Coord`& initial_reference, const :ref:`gpr::Coord`& current_orientation, :ref:`HssvdModeSelectionPolicy` policy, bool preserve_initial_reference); :ref:`DimerOracleProgressAction` :ref:`selectDimerOracleProgressAction`(bool path_leashed_recovery, bool oracle_certified, double best_oracle_force, double trial_oracle_force); bool :target:`is_subsystem`(const :ref:`gpr::AtomsConfiguration`& atoms_config); bool :ref:`dimerPhaseBudgetAllows`(:ref:`gpr::Index_t` phase, :ref:`gpr::Index_t` limit); bool :target:`dimerSearchStalled`(:ref:`gpr::Index_t` consecutive_degenerate_probes); bool :ref:`dimerGeometriesCoincide`(const :ref:`gpr::Coord`& a, const :ref:`gpr::Coord`& b); bool :ref:`refusalRepeatsIndexZeroExpansion`(const :ref:`gpr::Coord`& midpoint, const :ref:`gpr::Coord`& expansion_midpoint, double curvature, double curvature_resolution, double separation); :ref:`DimerRelaxationCycleCertificate` :ref:`certifyDimerRelaxationCycle`(const :ref:`gpr::Coord`& current, const :ref:`gpr::Coord`& proposed, const :ref:`gpr::Coord`* preceding, double force_current, double force_preceding); bool :ref:`repeatedProjectedTrustStep`(const :ref:`gpr::Coord`& step, double curvature, const :ref:`gpr::Coord`& previous_step, double previous_curvature); bool :ref:`shouldTerminateDimerRelaxationForLostProgress`(double curvature, double current_residual, double proposed_residual); bool :ref:`shouldBacktrackDimerRelaxationForResidualDecrease`(double curvature, double current_residual); double :ref:`dimerPosteriorActionForceScale`(double current_residual, double force_tolerance); bool :ref:`posteriorForceResolved`(double proposed_force_variance, double action_scale); bool :ref:`measuredRadiusClipRequestsOracle`(bool clipped, double proposed_force_variance, double action_scale); :ref:`DimerResidualGlobalizationAction` :ref:`resolvedPointKeepsTheSurrogateWalk`(:ref:`DimerResidualGlobalizationAction` action, double proposed_force_variance, double action_scale); double :ref:`posteriorResolvedStep`(double force_sigma, double curvature); double :ref:`rejectedTrialRadius`(double shrunk, double displacement, double force_sigma, double curvature, double prediction_error, double force_increase = std::numeric_limits::quiet_NaN(), bool transverse_residual_exceeds_step = false); double :target:`modelAgreementTrustDistance`(double configured, double length_scale, double force_error, double force_scale, double energy_error, double energy_scale); bool :ref:`dimerOracleTrialNeedsRefit`(double reference_force, double trial_force, double measured_change, double prediction_error, double force_tolerance); :ref:`DimerProposalGlobalizationAction` :ref:`selectDimerProposalGlobalizationAction`(double curvature, double current_residual, double force_tolerance, double proposed_force_variance, double posterior_action_force_scale); :ref:`DimerProposalGlobalizationAction` :target:`selectDimerProposalGlobalizationAction`(double curvature, double current_residual, double force_tolerance, double proposed_force_variance); :ref:`DimerResidualGlobalizationAction` :ref:`selectDimerResidualGlobalizationAction`(double curvature, double current_residual, bool backtrack_accepted); :ref:`DimerResidualGlobalizationAction` :ref:`selectDimerPosteriorResidualGlobalizationAction`(:ref:`DimerProposalGlobalizationAction` proposal_action, double curvature, double current_residual, bool backtrack_accepted); :ref:`DimerRelaxationBacktrackResult` :ref:`backtrackDimerRelaxationForResidualDecrease`(const :ref:`gpr::Coord`& current, const :ref:`gpr::Coord`& proposed, double current_residual, const std::function`&)>& evaluate_residual); :ref:`DimerSaddleMeritBacktrackResult` :ref:`backtrackDimerSaddleMerit`(const :ref:`gpr::Coord`& current, const :ref:`gpr::Coord`& proposed, const :ref:`gpr::Coord`& gradient, const :ref:`gpr::Coord`& orientation, double curvature, const std::function`&)>& energy_change); int :target:`convergenceExitCode`(const :ref:`AtomicDimer`& dimer); } // namespace atmd .. _details-namespaceatmd: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The atomic dimer search (class :ref:`AtomicDimer `) and its status types. Global Variables ---------------- .. index:: pair: variable; kMaxStalledDegenerateProbes .. _doxid-namespaceatmd_1a79303b0769c7d247f97531043d731aad: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::Index_t` kMaxStalledDegenerateProbes = 30 A search that is not a burst stops once this many consecutive probes added no distinct observation: the structural image-1 recovery has had many chances, and the outer loop would otherwise repeat the same rejected observation until the caller kills it. .. index:: pair: variable; kMaxConsecutiveOracleFailures .. _doxid-namespaceatmd_1a30c85bb7b96e1b256383a8a7f74fee28: .. ref-code-block:: cpp :class: doxyrest-title-code-block int kMaxConsecutiveOracleFailures = 8 Consecutive trial geometries at which the oracle may fail (raise, or return a non-finite energy or force) before the dimer search stops with an error. Each failure is a rejected trial: no training row, a shorter next step. Global Functions ---------------- .. index:: pair: function; writeDimerCampaignSummary .. _doxid-namespaceatmd_1a0abc6cd6275c12b7401afa90b63eaff2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void writeDimerCampaignSummary(std::ostream& os, double energy, bool converged, double energy_zero = 0.0) One-line paper-campaign fields. Independent of debug_level so run_one.sh can parse saddle energy and convergence on every cell. .. index:: pair: function; selectHssvdModeIndex .. _doxid-namespaceatmd_1a9ea5f1fdec1979886f3efe89b0861f3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Index selectHssvdModeIndex(const Eigen::VectorXd& eigenvalues, const Eigen::MatrixXd& eigenvectors, const Eigen::VectorXd& reference, :ref:`HssvdModeSelectionPolicy` policy) Select an HS-SVD eigenmode. Reference-connected selection follows the negative-curvature mode with greatest overlap to the supplied mode; when no negative mode exists it returns the lowest-curvature mode. .. index:: pair: function; selectHssvdModeReference .. _doxid-namespaceatmd_1a60e831ddb16fa9858f21354d923e4f88: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`gpr::Coord`& selectHssvdModeReference(const :ref:`gpr::Coord`& initial_reference, const :ref:`gpr::Coord`& current_orientation, :ref:`HssvdModeSelectionPolicy` policy, bool preserve_initial_reference) Reference-connected OCI mode tracking uses the immutable path axis at each rotation phase. Other dimer policies continue from the current orientation. .. index:: pair: function; selectDimerOracleProgressAction .. _doxid-namespaceatmd_1a1fce7d9d4f498bdc9883c19ad6486efa: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerOracleProgressAction` selectDimerOracleProgressAction(bool path_leashed_recovery, bool oracle_certified, double best_oracle_force, double trial_oracle_force) A path-leashed recovery burst accepts only strict progress measured on the true PES. Standalone searches and surrogate-filled phases keep exploring. .. index:: pair: function; dimerPhaseBudgetAllows .. _doxid-namespaceatmd_1a9cf25c7d817025c134c454b14c70eb60: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool dimerPhaseBudgetAllows(:ref:`gpr::Index_t` phase, :ref:`gpr::Index_t` limit) Nonpositive phase limits leave termination to the dimer's convergence, cycle, curvature, trust, and alignment certificates. Positive limits are explicit caller budgets. .. index:: pair: function; dimerGeometriesCoincide .. _doxid-namespaceatmd_1a96e843b09100eeaab4bfac8ad0048eb5: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool dimerGeometriesCoincide(const :ref:`gpr::Coord`& a, const :ref:`gpr::Coord`& b) Numerical geometry identity for cycle detection and measured-force rescue. .. index:: pair: function; refusalRepeatsIndexZeroExpansion .. _doxid-namespaceatmd_1ac375de769ba6ad84988e5eb9cc2a4ef2: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool refusalRepeatsIndexZeroExpansion(const :ref:`gpr::Coord`& midpoint, const :ref:`gpr::Coord`& expansion_midpoint, double curvature, double curvature_resolution, double separation) A final-stencil refusal repeats a complete index-zero expansion when it lies within one dimer separation of that expansion's midpoint and its own measured curvature is not resolvably negative: the forward differences of both carry that much truncation, so a new expansion measures the same Hessian. .. index:: pair: function; certifyDimerRelaxationCycle .. _doxid-namespaceatmd_1a9f78e02e0fe1a5608f2929e8a11258ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerRelaxationCycleCertificate` certifyDimerRelaxationCycle(const :ref:`gpr::Coord`& current, const :ref:`gpr::Coord`& proposed, const :ref:`gpr::Coord`* preceding, double force_current, double force_preceding) Terminal certificate for a condition-driven dimer relaxation step. ~proposed~ is the map image of ~current~. ~preceding~ is the geometry accepted on the previous inner step (null/empty on the first step). ~force\_\*~ are surrogate force scales (max abs component) used only to choose the lower-force member of a period-two cycle; ties keep current. .. index:: pair: function; repeatedProjectedTrustStep .. _doxid-namespaceatmd_1a554f12617df26bc26388531176608f80: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool repeatedProjectedTrustStep(const :ref:`gpr::Coord`& step, double curvature, const :ref:`gpr::Coord`& previous_step, double previous_curvature) The surrogate trust-region step repeated. Its displacement and curvature agree to the HS-SVD singular-value cutoff (``sqrt(eps)``), so another inner iteration applies the same proposal. The geometry need not yet coincide: a limited step can translate for several iterations before a coordinate cycle closes, and each of those iterations rebuilds the same posterior. .. index:: pair: function; shouldTerminateDimerRelaxationForLostProgress .. _doxid-namespaceatmd_1a413ed1124a0dc69ee9a8e568f4d3db8a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool shouldTerminateDimerRelaxationForLostProgress(double curvature, double current_residual, double proposed_residual) A trusted negative-curvature MMF proposal must reduce the translated-force residual. Non-finite residuals terminate in every curvature regime. The strict comparison supplies condition-driven terminality without an iteration count or a fitted progress tolerance. .. index:: pair: function; shouldBacktrackDimerRelaxationForResidualDecrease .. _doxid-namespaceatmd_1a537de1855c206b23116ce2732543a41d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool shouldBacktrackDimerRelaxationForResidualDecrease(double curvature, double current_residual) A trusted negative-curvature MMF step follows a translated-force root. Backtracking keeps each surrogate proposal on a strict residual descent path; coordinate resolution bounds the search when no descent point exists. .. index:: pair: function; dimerPosteriorActionForceScale .. _doxid-namespaceatmd_1a360f3e48546997af125a4ad5f5079634: .. ref-code-block:: cpp :class: doxyrest-title-code-block double dimerPosteriorActionForceScale(double current_residual, double force_tolerance) Resolve a surrogate action against the larger of its live force signal and the final convergence scale. This is the denominator of the dimensionless posterior action ratio tr(Sigma_F) / max(||F||^2, tau^2). .. index:: pair: function; posteriorForceResolved .. _doxid-namespaceatmd_1a0be6ffd7908da68c3030898300a384b6: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool posteriorForceResolved(double proposed_force_variance, double action_scale) The posterior force is resolved when its variance is below the squared action scale. A non-finite variance is not resolved. .. index:: pair: function; measuredRadiusClipRequestsOracle .. _doxid-namespaceatmd_1a9984edd816240f8cebc78604e39c4a98: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool measuredRadiusClipRequestsOracle(bool clipped, double proposed_force_variance, double action_scale) A clip onto the measured-trial radius is an oracle only while the clipped point is still unresolved. A resolved clip is already inside the model, so the surrogate keeps the bounded step. .. index:: pair: function; resolvedPointKeepsTheSurrogateWalk .. _doxid-namespaceatmd_1a5eeecf6bb6ac4f7b75a75ba5e86bffdc: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerResidualGlobalizationAction` resolvedPointKeepsTheSurrogateWalk(:ref:`DimerResidualGlobalizationAction` action, double proposed_force_variance, double action_scale) A lost-progress rule measures the trial so the next fit can move. When the posterior force is already resolved, that measurement repeats a force the model has, and the surrogate walk continues instead. .. index:: pair: function; posteriorResolvedStep .. _doxid-namespaceatmd_1aaeb164da86790f3345aa17f3c6eba6c8: .. ref-code-block:: cpp :class: doxyrest-title-code-block double posteriorResolvedStep(double force_sigma, double curvature) Displacement on which the curvature changes the force by one posterior standard deviation. A shorter step is inside the noise of the model. .. index:: pair: function; rejectedTrialRadius .. _doxid-namespaceatmd_1abb3398eb61901a09d2bc5906cab74b3a: .. ref-code-block:: cpp :class: doxyrest-title-code-block double rejectedTrialRadius(double shrunk, double displacement, double force_sigma, double curvature, double prediction_error, double force_increase = std::numeric_limits::quiet_NaN(), bool transverse_residual_exceeds_step = false) Radius after a rejected trial. The rho = 0 shrink is undone toward the posterior resolution when that resolution lies inside the failed step, by the fraction of the posterior the force-change error used (``force_sigma / prediction_error``, at most one). When the resolution lies beyond the step, the failed displacement is still inside one posterior standard deviation of curvature, so the shrink is undone all the way when three posterior facts hold together: the measured force increase is at most one standard deviation, the curvature's own force change over the step covers that increase (``|curvature| * displacement >= force_increase``), and the step did not leave a larger residual on a transverse mode than on the modes it moved. A transverse residual the radius did not bound is not a reason to put the radius back, and a worsening the curvature does not cover is not either. .. index:: pair: function; dimerOracleTrialNeedsRefit .. _doxid-namespaceatmd_1a73b52a9eb7e17660c91fb799e5779fbd: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool dimerOracleTrialNeedsRefit(double reference_force, double trial_force, double measured_change, double prediction_error, double force_tolerance) A worsening measured trial needs another fit when its force prediction error exceeds the accepted center's force scale or convergence floor. The trial cannot enlarge its own error budget by reversing the force. Accurate uphill steps remain admissible during escape from a minimum. .. index:: pair: function; selectDimerProposalGlobalizationAction .. _doxid-namespaceatmd_1a8a0897c9607d57df94d0a46a209cdbf8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerProposalGlobalizationAction` selectDimerProposalGlobalizationAction(double curvature, double current_residual, double force_tolerance, double proposed_force_variance, double posterior_action_force_scale) Use posterior force resolution as the global trust certificate and reserve monotone residual line search for the local minimum-mode root basin. .. index:: pair: function; selectDimerResidualGlobalizationAction .. _doxid-namespaceatmd_1a3e3b3ffa2144aecd7e9e114bed9b2942: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerResidualGlobalizationAction` selectDimerResidualGlobalizationAction(double curvature, double current_residual, bool backtrack_accepted) Select how a trust-bounded dimer translation proceeds after residual globalization. A stalled negative-curvature trial is measured rather than rejected at the source geometry or followed by further surrogate steps. .. index:: pair: function; selectDimerPosteriorResidualGlobalizationAction .. _doxid-namespaceatmd_1a947c7df8353129414211835ca23c8440: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerResidualGlobalizationAction` selectDimerPosteriorResidualGlobalizationAction(:ref:`DimerProposalGlobalizationAction` proposal_action, double curvature, double current_residual, bool backtrack_accepted) Posterior resolution certifies global surrogate motion. Once the translated force enters its local convergence basin, residual globalization supplies the stronger root-finding certificate. An unresolved proposal is measured. .. index:: pair: function; backtrackDimerRelaxationForResidualDecrease .. _doxid-namespaceatmd_1a071af09f4cb066e6d8bd0b938d9421f6: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerRelaxationBacktrackResult` backtrackDimerRelaxationForResidualDecrease(const :ref:`gpr::Coord`& current, const :ref:`gpr::Coord`& proposed, double current_residual, const std::function`&)>& evaluate_residual) Search the trusted proposal segment for strict residual descent. Midpoint contraction ends when a decreasing point is found or the candidate coincides with the source geometry at coordinate resolution. .. index:: pair: function; backtrackDimerSaddleMerit .. _doxid-namespaceatmd_1a8abd9a15ccaebac61c1a7a8cfd843f18: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DimerSaddleMeritBacktrackResult` backtrackDimerSaddleMerit(const :ref:`gpr::Coord`& current, const :ref:`gpr::Coord`& proposed, const :ref:`gpr::Coord`& gradient, const :ref:`gpr::Coord`& orientation, double curvature, const std::function`&)>& energy_change) Local saddle merit of Gould, Ortner and Packwood (2016): F(x+s)-F(x) = E(x+s)-E(x)-2(g.v)(s.v)-lambda(s.v)^2. Its gradient at x is the reflected dimer gradient. Armijo contraction permits transverse descent without requiring the force norm to decrease.