ASFESolventSimUnit#

class pontibus.protocols.solvation.ASFESolventSimUnit(*, name: str | None = None, **inputs)#

Protocol Unit for running the solvent phase multistate simulation of an absolute solvation free energy transformation.

Create an instance of a ProtocolUnit.

Parameters:
  • name (str) – Custom name to give this

  • **inputs – Keyword arguments, which can include other ProtocolUnit`s on which this `ProtocolUnit is dependent. Should be either gufe objects or JSON-serializables.

Attributes

property dependencies: list[ProtocolUnit]#

All units that this unit is dependent on (parents)

execute(*, context: Context, raise_error: bool = False, **inputs) ProtocolUnitResult | ProtocolUnitFailure#

Given ProtocolUnitResult s from dependencies, execute this ProtocolUnit.

Parameters:
  • context (Context) – Execution context for this ProtocolUnit; includes e.g. shared and scratch Path s.

  • raise_error (bool) – If True, raise any errors instead of catching and returning a ProtocolUnitFailure default False

  • **inputs – Keyword arguments giving the named inputs to _execute. These can include ProtocolUnitResult objects from ProtocolUnit objects this unit is dependent on.

property inputs: dict[str, Any]#

Inputs to the ProtocolUnit.

Includes any ProtocolUnit instances this ProtocolUnit depends on.

property name: str | None#

Optional name for the ProtocolUnit.

run(*, system: System, positions: Quantity, box_vectors: Quantity, selection_indices: ndarray[tuple[Any, ...], dtype[_ScalarT]], alchemical_restraints: bool, dry: bool = False, verbose: bool = True, scratch_basepath: Path | None = None, shared_basepath: Path | None = None) dict[str, Any]#

Run the free energy calculation using a multistate sampler.

Parameters:
  • system (openmm.System) – The System to simulate.

  • positions (openmm.unit.Quantity) – The positions of the System.

  • box_vectors (openff.units.Quantity) – The box vectors of the System.

  • selection_indices (npt.NDArray) – Indices of the System particles to write to file.

  • alchemical_restraints (bool,) – Whether or not the system has alchemical restraints.

  • dry (bool) – Do a dry run of the calculation, creating all the necessary components, but without running the simulation.

  • verbose (bool) – Verbose output of the simulation progress. Output is provided at the INFO logging level.

  • scratch_basepath (pathlib.Path | None) – Where to store temporary files, defaults to the current working directory if None.

  • shared_basepath (pathlib.Path | None) – Where to store calculation outputs, defaults to the current working directory if None.

Returns:

Outputs created by the unit, including the debug objects (i.e. sampler) if dry==True

Return type:

dict

simtype: str = 'solvent'#