run_neb¶
- run_neb(program, theta_1, theta_2, *, n_pivots=12, n_steps=50, learning_rate=0.1, gradient_method=GradientMethod.PARAMETER_SHIFT, eps=0.001, convergence_tol=None, reporter=None)[source]¶
Find a minimum-energy path between two parameter vectors via NEB.
Places n_pivots images (including the two fixed endpoints) along a straight line from theta_1 to theta_2 and iteratively relaxes the interior images. At each step the gradient perpendicular to the chain tangent is computed and the images are updated via gradient descent, then redistributed uniformly along the path.
Warning
This function is experimental. Convergence is sensitive to
learning_rate,eps, andn_pivots.- Parameters:
program (
_SupportsVizScan) – Variational program whose loss landscape is explored.theta_1 (
TypeAliasType) – First endpoint (fixed).theta_2 (
TypeAliasType) – Second endpoint (fixed).n_pivots (
int) – Total number of images including the two endpoints. Must be at least 3.n_steps (
int) – Maximum number of NEB relaxation iterations.learning_rate (
float) – Step size for gradient descent on interior images.gradient_method (
GradientMethod) – Strategy for computing gradients.GradientMethod.PARAMETER_SHIFT(default) uses the parameter-shift rule.GradientMethod.FINITE_DIFFERENCEuses centered finite differences with step size eps.eps (
float) – Finite-difference step size. Only used when gradient_method isGradientMethod.FINITE_DIFFERENCE.convergence_tol (
float|None) – If set, stop early when the maximum pivot displacement in a step falls below this threshold.reporter (
ProgressReporter|None) – OptionalProgressReporter.
- Returns:
Relaxed path, energies, cumulative distances, and the full iteration history.
- Return type:
- Raises:
TypeError – If
programis not a supported variational program.NotImplementedError – If
programis anIterativeQAOAinstance.ValueError – If shapes mismatch or
n_pivots < 3.