class openfe.Transformation(stateA: ChemicalSystem, stateB: ChemicalSystem, protocol: Protocol, mapping: dict[str, gufe.mapping.componentmapping.ComponentMapping] | None = None, name: str | None = None)#

An edge of an alchemical network.

Connects two ChemicalSystem objects, with directionality.

property stateA: ChemicalSystem#

The starting ChemicalSystem for the transformation.

property stateB: ChemicalSystem#

The ending ChemicalSystem for the transformation.

property protocol: Protocol#

The protocol used to perform the transformation.

This protocol derives free energy differences between stateA and stateB ChemicalSystem objects. It includes all details needed to perform required simulations/calculations and encodes the alchemical pathway used. May also correspond to an experimental result.

property mapping: dict[str, gufe.mapping.componentmapping.ComponentMapping] | None#

Mapping of e.g. atoms between stateA and stateB.

property name: str | None#

Optional identifier for the transformation; used as part of its hash.

Set this to a unique value if adding multiple, otherwise identical transformations to the same AlchemicalNetwork to avoid deduplication.

create(*, extends: ProtocolDAGResult | None = None, name: str | None = None) ProtocolDAG#

Returns a ProtocolDAG executing this Transformation.protocol.

gather(protocol_dag_results: Iterable[ProtocolDAGResult]) ProtocolResult#

Gather multiple ProtocolDAGResult into a single ProtocolResult.


protocol_dag_results (Iterable[ProtocolDAGResult]) – The ProtocolDAGResult objects to assemble aggregate quantities from.


Aggregated results from many ProtocolDAGResult objects, all from a given Protocol.

Return type:



Dump this Transformation to a JSON file.

Note that this is not space-efficient: for example, any Component which is used in both ChemicalSystem objects will be represented twice in the JSON output.


file (Union[PathLike, FileLike]) – a pathlike of filelike to save this transformation to.

classmethod load(file)#

Create a Transformation from a JSON file.


file (Union[PathLike, FileLike]) – a pathlike or filelike to read this transformation from