mythos.observables.bond_distances

Observable for computing bond distances from a Martini trajectory.

Classes

BondDistances

Observable for computing bond distances for a single bond name.

BondDistancesMapped

Observable for computing bond distances for multiple bond names.

Functions

_bond_distance(→ float)

Compute the distance between a bonded pair of atoms.

Module Contents

mythos.observables.bond_distances._bond_distance(centers: jax.numpy.ndarray, pair: jax.numpy.ndarray, displacement_fn: collections.abc.Callable) float[source]

Compute the distance between a bonded pair of atoms.

class mythos.observables.bond_distances.BondDistances[source]

Observable for computing bond distances for a single bond name.

Given a MartiniTopology and a bond name, this observable computes pairwise distances for all matching bonds across the trajectory.

topology

The Martini topology containing bond information.

bond_name

Bond name string to compute distances for. Has the form RESIDUE_BEAD1_BEAD2 (e.g. "DMPC_GL1_GL2"). All bonds in the topology matching this name will be included in the output.

displacement_fn

Factory that, given a box size vector, returns a displacement function respecting periodic boundary conditions.

topology: mythos.energy.martini.base.MartiniTopology
bond_name: str
displacement_fn: collections.abc.Callable
_matching_pairs() jax.numpy.ndarray[source]
__call__(trajectory: mythos.simulators.io.SimulatorTrajectory) jax.numpy.ndarray[source]

Compute bond distances for the requested bond name.

Parameters:

trajectory – A SimulatorTrajectory whose center has shape (n_states, n_atoms, 3) and box_size has shape (n_states, 3).

Returns:

Distance array of shape (n_states, n_matching_bonds).

class mythos.observables.bond_distances.BondDistancesMapped[source]

Observable for computing bond distances for multiple bond names.

Given a MartiniTopology and a set of bond names, this observable computes pairwise distances for all matching bonds across the trajectory, returning a dictionary keyed by bond name.

topology

The Martini topology containing bond information.

bond_names

Tuple of bond name strings to compute distances for. Each name has the form RESIDUE_BEAD1_BEAD2 (e.g. "DMPC_GL1_GL2"). All bonds in the topology matching a given name will be included in the output.

displacement_fn

Factory that, given a box size vector, returns a displacement function respecting periodic boundary conditions.

topology: mythos.energy.martini.base.MartiniTopology
bond_names: tuple[str, Ellipsis]
displacement_fn: collections.abc.Callable
__call__(trajectory: mythos.simulators.io.SimulatorTrajectory) dict[str, jax.numpy.ndarray][source]

Compute bond distances for each requested bond name.

Parameters:

trajectory – A SimulatorTrajectory whose center has shape (n_states, n_atoms, 3) and box_size has shape (n_states, 3).

Returns:

Dictionary mapping each bond name to a distance array of shape (n_states, n_matching_bonds).