mythos.observables.triplet_angles

Observable for computing angles between atom triplets from a Martini trajectory.

Classes

TripletAngles

Observable for computing angles between atom triplets for a single angle name.

TripletAnglesMapped

Observable for computing angles between atom triplets for multiple angle names.

Functions

_triplet_angle(→ float)

Compute the angle (in radians) at the central atom of a triplet.

Module Contents

mythos.observables.triplet_angles._triplet_angle(centers: jax.numpy.ndarray, triplet: jax.numpy.ndarray, displacement_fn: collections.abc.Callable) float[source]

Compute the angle (in radians) at the central atom of a triplet.

The angle is measured at atom j between rays j→i and j→k.

Parameters:
  • centers – Positions of all atoms, shape (n_atoms, 3).

  • triplet – Array of three atom indices [i, j, k].

  • displacement_fn – Displacement function respecting boundary conditions.

Returns:

Angle in radians.

class mythos.observables.triplet_angles.TripletAngles[source]

Observable for computing angles between atom triplets for a single angle name.

Given a MartiniTopology and an angle name, this observable computes the angle at the central atom for all matching triplets across the trajectory.

topology

The Martini topology containing angle information.

angle_name

Angle name string to compute angles for. Has the form RESIDUE_BEAD1_BEAD2_BEAD3 (e.g. "DMPC_NC3_PO4_GL1"). All angles 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
angle_name: str
displacement_fn: collections.abc.Callable
_matching_triplets() jax.numpy.ndarray[source]

Return topology angle rows whose derived name matches the angle name.

Returns:

Array of shape (n_matching, 3) with atom-index triplets.

Raises:

ValueError – If no angles in the topology match the angle name.

__call__(trajectory: mythos.simulators.io.SimulatorTrajectory) jax.numpy.ndarray[source]

Compute angles for the requested angle name.

Parameters:

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

Returns:

Array of angles (in radians) with shape (n_states, n_matching_angles).

class mythos.observables.triplet_angles.TripletAnglesMapped[source]

Observable for computing angles between atom triplets for multiple angle names.

Given a MartiniTopology and a set of angle names, this observable computes the angle at the central atom for all matching triplets across the trajectory, returning a dictionary keyed by angle name.

topology

The Martini topology containing angle information.

angle_names

Tuple of angle name strings to compute angles for. Each name has the form RESIDUE_BEAD1_BEAD2_BEAD3 (e.g. "DMPC_NC3_PO4_GL1"). All angles 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
angle_names: tuple[str, Ellipsis]
displacement_fn: collections.abc.Callable
__call__(trajectory: mythos.simulators.io.SimulatorTrajectory) dict[str, jax.numpy.ndarray][source]

Compute angles for each requested angle 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 angle name to an array of angles (in radians) with shape (n_states, n_matching_angles).