gpridge.instanton.gate ====================== .. py:module:: gpridge.instanton.gate .. autoapi-nested-parse:: Uncertainty gate in front of a potential. The surrogate is a quadratic mean plus the identity-chart gradient-enhanced kernel in ``manifold_ef``. The quadratic is the Taylor polynomial at the expansion point in mass-weighted coordinates, V_quad(z) = V(q_s) + g_z · z + z · H_z · z / 2, z = M^{1/2} (q - q_s). The GP is trained on the residual energy and the residual mass-weighted gradient. Newton, continuation and the Hill matrix see the posterior mean and its analytic Hessian, the second derivative of the joint energy-force kernel. A true Hessian is never requested from ``pes``. A bead is a new training row when the posterior RMS standard deviation of the residual gradient exceeds ``tau``, or when the mass-weighted gradient error against a true gradient exceeds ``tau``. ``tau_h`` is accepted and ignored: curvature is not a reason to call the true Hessian. ``hessian_check`` is the one true-Hessian batch, taken at a converged orbit and not fed back into the model. ``gradient`` and ``hessian`` follow the spectral call counter: one geometry, one count, with the finite-difference shifts of a Hessian kept in ``displaced_gradients`` rather than in ``gradient``. ``gradient_evaluations`` is the sum, every true Cartesian gradient. Classes ------- .. autoapisummary:: gpridge.instanton.gate.Gate Module Contents --------------- .. py:class:: Gate(raw, x_s, energy_s, gradient_s, hessian_s, masses, tau=1e-06, tau_h=1e-08, tau_e=1e-09, hess_step=1e-05, length_grid=None, budget=256) .. py:attribute:: raw .. py:attribute:: x_s .. py:attribute:: sqrt_m .. py:attribute:: energy_s .. py:attribute:: g_z .. py:attribute:: h_z .. py:attribute:: model .. py:attribute:: tau .. py:attribute:: tau_h .. py:attribute:: tau_e .. py:attribute:: hess_step .. py:attribute:: length_grid :value: None .. py:attribute:: budget :value: 256 .. py:attribute:: energy :value: 0 .. py:attribute:: gradient :value: 0 .. py:attribute:: hessian :value: 0 .. py:attribute:: displaced_gradients :value: 0 .. py:attribute:: true_batches :value: 0 .. py:attribute:: fits :value: 0 .. py:attribute:: last_grad_err_max :value: None .. py:attribute:: acquired :value: 0 .. py:method:: as_dict() .. py:method:: to_z(x) .. py:method:: observe(x, deriv=1) True energy and gradient, then a refit. Used for the seed design. .. py:method:: mean_pes(x, deriv) Posterior only. No true-surface call. The inner Newton converges on this frozen surface. Training happens outside, in the outer residual loop. .. py:method:: observe_true(x) True energies and gradients at x, then a refit. Returns both. .. py:method:: collect_true(x) True energies and gradients, appended and not yet refit. .. py:method:: pes(x, deriv) Spectral signature. x (n, d), deriv 0, 1 or 2 -> energy, grad, hess. The returned Hessian is always the analytic posterior Hessian. .. py:method:: hessian_check(x) One true-Hessian batch at a converged orbit. Not a training update. The finite-difference shifts are displaced gradient calls. The center energy and gradient are not evaluated again. Returns the relative Frobenius error of the GP Hessian and both Hessian batches. .. py:method:: true_energies(x) .. py:method:: eval(u, hessian=False) Bead-solver signature: one array of geometries.