mythos.observables.bond_distances ================================= .. py:module:: mythos.observables.bond_distances .. autoapi-nested-parse:: Observable for computing bond distances from a Martini trajectory. Classes ------- .. autoapisummary:: mythos.observables.bond_distances.BondDistances mythos.observables.bond_distances.BondDistancesMapped Functions --------- .. autoapisummary:: mythos.observables.bond_distances._bond_distance Module Contents --------------- .. py:function:: _bond_distance(centers: jax.numpy.ndarray, pair: jax.numpy.ndarray, displacement_fn: collections.abc.Callable) -> float Compute the distance between a bonded pair of atoms. .. py:class:: BondDistances Observable for computing bond distances for a single bond name. Given a :class:`MartiniTopology` and a bond name, this observable computes pairwise distances for all matching bonds across the trajectory. .. attribute:: topology The Martini topology containing bond information. .. attribute:: 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. .. attribute:: displacement_fn Factory that, given a box size vector, returns a displacement function respecting periodic boundary conditions. .. py:attribute:: topology :type: mythos.energy.martini.base.MartiniTopology .. py:attribute:: bond_name :type: str .. py:attribute:: displacement_fn :type: collections.abc.Callable .. py:method:: _matching_pairs() -> jax.numpy.ndarray .. py:method:: __call__(trajectory: mythos.simulators.io.SimulatorTrajectory) -> jax.numpy.ndarray Compute bond distances for the requested bond name. :param trajectory: A :class:`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)``. .. py:class:: BondDistancesMapped Observable for computing bond distances for multiple bond names. Given a :class:`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. .. attribute:: topology The Martini topology containing bond information. .. attribute:: 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. .. attribute:: displacement_fn Factory that, given a box size vector, returns a displacement function respecting periodic boundary conditions. .. py:attribute:: topology :type: mythos.energy.martini.base.MartiniTopology .. py:attribute:: bond_names :type: tuple[str, Ellipsis] .. py:attribute:: displacement_fn :type: collections.abc.Callable .. py:method:: __call__(trajectory: mythos.simulators.io.SimulatorTrajectory) -> dict[str, jax.numpy.ndarray] Compute bond distances for each requested bond name. :param trajectory: A :class:`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)``.