mythos.energy.martini.base
Common Martini Energy Utilities.
Classes
Class representing the topology of a Martini system. |
|
Base class for Martini energy functions. |
|
Base class for Martini energy function configurations. |
Functions
|
Return displacement function given box_size. |
Module Contents
- mythos.energy.martini.base.get_periodic(box_size: mythos.utils.types.Vector3D) callable[source]
Return displacement function given box_size.
- class mythos.energy.martini.base.MartiniTopology[source]
Class representing the topology of a Martini system.
This class contains information about the atom types, bonded interactions, and angles in the system. It can be used to construct energy functions and to interpret simulation results.
- atom_types
A tuple of atom type names.
- atom_names
A tuple of atom names.
- angles
An array of shape (n_angles, 3) containing the indices of the atoms involved in each angle.
- bonded_neighbors
An array of shape (n_bonds, 2) containing the indices of the bonded pairs of atoms.
- unbonded_neighbors
An array of shape (n_unbonded, 2) containing the indices of the unbonded pairs of atoms. If not supplied, it will be computed as all pairs of atoms that are not bonded.
- angles: mythos.utils.types.Arr_N
- bonded_neighbors: mythos.utils.types.Arr_N
- unbonded_neighbors: mythos.utils.types.Arr_N | None = None
- classmethod from_universe(universe: MDAnalysis.Universe) MartiniTopology[source]
Create a MartiniTopology from a Universe object.
- classmethod from_tpr(tpr_file: pathlib.Path) MartiniTopology[source]
Create a MartiniTopology from a TPR format topology file.
- class mythos.energy.martini.base.MartiniEnergyFunction[source]
Bases:
mythos.energy.base.BaseEnergyFunctionBase class for Martini energy functions.
- angles: mythos.utils.types.Arr_N
- displacement_fn: callable
- classmethod from_topology(topology: MartiniTopology, **kwargs) MartiniEnergyFunction[source]
Create an energy function from a MartiniTopology.
- class mythos.energy.martini.base.MartiniEnergyConfiguration(couplings: dict[str, list[str]] | None = None, **kwargs)[source]
Base class for Martini energy function configurations.
Given the large size and sparse inclusion of parameters in Martini models, this class implements parameters as a dictionary while supporting operations of configuration classes used in EnergyFunction.
This class also supports parameter coupling, where a single proxy parameter controls multiple underlying parameters. Couplings should be provided as a dictionary of lists, where each key is a proxy parameter name and the value is a list of target parameter names that it controls. The params field of this will be populated with the expanded parameters.
Subclasses can override __post_init__ for additional initialization logic. Parameters will be available in self.params after initialization.
- couplings
- reversed_couplings
- params
- init_params() MartiniEnergyConfiguration[source]
Dependent params initialization. Default to no-op.
- __or__(other: MartiniEnergyConfiguration) MartiniEnergyConfiguration[source]
Merge two configurations, with other taking precedence.