mod neus_bridge

module neus_bridge

Umbrella bridges between two catalog minima in descriptor space. Nonequilibrium-umbrella bridge machinery between two known minima.

A bridge is a string of images through descriptor space between two validated minima, tiling the channel with Voronoi regions that each receive their own segment budget. Confined walkers record attempted exits as crossings; weights transfer on every attempt and their fixed point is flux balance; the forward crossing fractions compose into a committor surrogate along the string. The construction follows nonequilibrium umbrella sampling in its string form and direct forward flux sampling in its staging, with the descriptor playing the order parameter, so the machinery is engine-agnostic: any segment runner that propagates and reports descriptors drives it.

This module is pure state and arithmetic: no wire, no engine, no randomness beyond a caller-supplied draw for entry selection.

Enums

enum BridgeError

Invalid bridge construction or update input.

TooFewImages

A string needs at least three images: two endpoints and a channel.

DimensionMismatch

Endpoint descriptors must share one dimension.

DegenerateChord

Endpoints must be separated to define a chord.

RegionOutOfRange

A referenced region does not exist.

InvalidTransfer

Weight transfer fraction must lie in (0, 1).

Structs and Unions

struct BridgeString

A string of images through descriptor space with fixed endpoints.

Implementations

impl BridgeString

Functions

fn assign(&self, descriptor: &Array1<f64>) -> usize

The region owning a descriptor: the nearest image.

fn chord(a: &Array1<f64>, b: &Array1<f64>, k: usize) -> Result<Self, BridgeError>

The chord between two endpoint descriptors, sampled at k + 1 images inclusive of both endpoints.

fn chord_distance(&self, descriptor: &Array1<f64>) -> f64

Distance from a descriptor to the endpoint chord segment.

Membership in the bridge tube is a cheap test against this distance; points outside the tube belong to ordinary search space rather than to any region.

fn images(&self) -> &[Array1<f64>]

Images in order from the A endpoint to the B endpoint.

fn regions(&self) -> usize

Number of regions, one per image.

fn update(&mut self, means: &[Option<Array1<f64>>], alpha: f64) -> f64

Move interior images toward observed walker means, smooth, and reparametrize to equal arc length. Endpoints never move: they are the validated minima the bridge connects. Returns the largest image displacement, the caller’s convergence signal.

struct EntryLists

Stored entry configurations for each region.

Implementations

impl EntryLists

Functions

fn draw(&self, region: usize, draw: u64) -> Option<&Array1<f64>>

Draw an entry for a region by a caller-supplied index draw.

fn is_empty(&self, region: usize) -> bool

Whether a region has no stored entry.

fn len(&self, region: usize) -> usize

Number of stored entries for a region.

fn new(regions: usize, capacity: usize) -> Self

Lists for regions, each holding at most capacity entries.

fn push(&mut self, region: usize, state: Array1<f64>) -> Result<(), BridgeError>

Record an entry configuration for a region, evicting the oldest beyond capacity.

struct WeightLedger

Region weights under the nonequilibrium umbrella update.

Implementations

impl WeightLedger

Functions

fn committor_surrogate(&self) -> Vec<f64>

Committor surrogate along the string: the probability that a segment from the A side reaches image k before returning, as the running product of forward fractions.

fn crossing(&mut self, from: usize, to: usize) -> Result<(), BridgeError>

Record an attempted exit and transfer weight toward its target.

The update is Dickson and Dinner’s: weight moves with attempted flux, and its fixed point balances flux in and out of every region. Total weight is conserved exactly.

fn flux_balance_residual(&self) -> f64

How far the weights sit from flux balance: the largest absolute mismatch between weighted flux in and out of a region, with the observed crossing counts normalized to rates so the residual measures the weights rather than the length of the observation. Zero at the fixed point.

fn forward_fractions(&self) -> Vec<f64>

Forward crossing fraction out of each region toward its successor.

fn launch(&mut self, region: usize) -> Result<(), BridgeError>

Record a launched segment in a region.

fn launches(&self, region: usize) -> u64

Segments launched in a region so far.

fn new(regions: usize, s: f64) -> Result<Self, BridgeError>

Uniform weights over regions, transferring fraction s on each attempted exit.

fn weights(&self) -> &[f64]

Current region weights, summing to one.