mod pullback

module pullback

Weighted regularized pullback from descriptor increments to Cartesian steps.

Functions

fn regularized_pullback(jacobian: ArrayView2<f64>, desired: ArrayView1<f64>, weights: ArrayView1<f64>, reference_coordinates: Option<ArrayView1<f64>>, constraints: &PullbackConstraints, config: PullbackConfig) -> Result<PullbackResult, PullbackError>

Solve the weighted D21 pullback after projecting forbidden Cartesian modes.

Enums

enum PullbackError

Classified input or numerical failure.

DescriptorDimension

Desired increment and weights must match the Jacobian row count.

jacobian_rows: usize

Jacobian row count.

desired: usize

Desired-increment length.

weights: usize

Weight-vector length.

FrozenDimension

Frozen mask must match the Jacobian column count.

expected: usize

Jacobian column count.

actual: usize

Supplied mask length.

CartesianDimension

Translation and group constraints require complete Cartesian triples.

actual: usize

Jacobian column count.

GroupDimension

Rigid-group labels must match the Cartesian atom count.

expected: usize

Cartesian atom count.

actual: usize

Supplied label count.

ReferenceDimension

Rigid groups require reference coordinates matching the Jacobian columns.

expected: usize

Jacobian column count.

actual: usize

Supplied reference-coordinate length.

InvalidDamping

Damping must be finite and strictly positive.

InvalidTrustRadius

Trust radius must be finite and nonnegative.

InvalidLengthScale

Length scale must be finite and strictly positive.

NonFiniteInput

A Jacobian, desired increment, weight, or coordinate is NaN or infinite.

NonPositiveWeight

Descriptor weights must be strictly positive.

CoincidentGroupedAtoms

A grouped atom pair has coincident reference coordinates.

first_atom: usize

Lower atom index.

second_atom: usize

Higher atom index.

LinearSolve

The damped normal equations could not be solved stably.

Structs and Unions

struct PullbackConfig

Numerical scales controlling one regularized pullback.

damping: f64

Positive Tikhonov damping parameter lambda.

trust_radius: f64

Largest accepted dimensionless norm ||dx|| / length_scale.

length_scale: f64

Canonical Cartesian length scale.

struct PullbackConstraints

Linear Cartesian modes excluded from a pullback.

frozen_coordinates: Vec<bool>

Coordinate-level mask; true coordinates remain exactly zero.

rigid_group_labels: Vec<u32>

Per-atom rigid-group labels; equal labels preserve pair distances to first order.

remove_translation: bool

Remove the three global translational modes.

struct PullbackResult

Cartesian step and diagnostics from one regularized pullback.

Implementations

impl PullbackResult

Functions

fn clipped(&self) -> bool

Whether the unconstrained numerical solution exceeded the trust radius.

fn realized_weighted_residual(&self) -> f64

Weighted norm of J dx - Delta p after clipping.

fn requested_weighted_norm(&self) -> f64

Weighted norm of the requested descriptor increment.

fn step(&self) -> &Array1<f64>

Constrained and trust-radius-limited Cartesian step.