gpridge.instanton.gate

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

Module Contents

class gpridge.instanton.gate.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)
raw
x_s
sqrt_m
energy_s
g_z
h_z
model
tau
tau_h
tau_e
hess_step
length_grid = None
budget = 256
energy = 0
gradient = 0
hessian = 0
displaced_gradients = 0
true_batches = 0
fits = 0
last_grad_err_max = None
acquired = 0
as_dict()
to_z(x)
observe(x, deriv=1)

True energy and gradient, then a refit. Used for the seed design.

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.

observe_true(x)

True energies and gradients at x, then a refit. Returns both.

collect_true(x)

True energies and gradients, appended and not yet refit.

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.

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.

true_energies(x)
eval(u, hessian=False)

Bead-solver signature: one array of geometries.