thermo
#
Train against thermodynamic properties.
Classes:
-
DataEntry–Represents a single experimental data point.
-
SimulationKey–A key used to identify a simulation.
-
SimulationConfig–Configuration for a simulation to run.
Functions:
-
create_dataset–Create a dataset from a list of existing data points.
-
extract_smiles–Return a list of unique SMILES strings in the dataset.
-
default_config–Return a default simulation configuration for the specified phase.
-
predict–Predict the properties in a dataset using molecular simulation, or by reweighting
DataEntry
#
Bases: TypedDict
Represents a single experimental data point.
Attributes:
-
type(DataType) –The type of data point.
-
smiles_a(str) –The SMILES definition of the first component.
-
x_a(float | None) –The mole fraction of the first component. This must be set to 1.0 if the data
-
smiles_b(str | None) –The SMILES definition of the second component if present.
-
x_b(float | None) –The mole fraction of the second component if present.
-
temperature(float) –The temperature at which the data point was measured.
-
pressure(float) –The pressure at which the data point was measured.
-
value(float) –The value of the data point.
-
std(float | None) –The standard deviation of the data point if available.
-
units(str) –The units of the data point.
-
source(str) –The source of the data point.
SimulationKey
#
Bases: NamedTuple
A key used to identify a simulation.
Attributes:
-
smiles(tuple[str, ...]) –The SMILES definitions of the components present in the system.
-
counts(tuple[int, ...]) –The number of copies of each component present in the system.
-
temperature(float) –The temperature [K] at which the simulation was run.
-
pressure(float | None) –The pressure [atm] at which the simulation was run.
smiles
instance-attribute
#
The SMILES definitions of the components present in the system.
counts
instance-attribute
#
The number of copies of each component present in the system.
temperature
instance-attribute
#
The temperature [K] at which the simulation was run.
pressure
instance-attribute
#
The pressure [atm] at which the simulation was run.
SimulationConfig
pydantic-model
#
Bases: BaseModel
Configuration for a simulation to run.
Fields:
-
max_mols(int) -
gen_coords(GenerateCoordsConfig) -
apply_hmr(bool) -
equilibrate(list[MinimizationConfig | SimulationConfig]) -
production(SimulationConfig) -
production_frequency(int)
gen_coords
pydantic-field
#
Configuration for generating initial coordinates.
equilibrate
pydantic-field
#
Configuration for equilibration simulations.
production
pydantic-field
#
Configuration for the production simulation.
production_frequency
pydantic-field
#
The frequency at which to write frames during production.
create_dataset
#
create_dataset(*rows: DataEntry) -> Dataset
Create a dataset from a list of existing data points.
Parameters:
-
rows(DataEntry, default:()) –The data points to create the dataset from.
Returns:
-
Dataset–The created dataset.
Source code in descent/targets/thermo.py
extract_smiles
#
Return a list of unique SMILES strings in the dataset.
Parameters:
-
dataset(Dataset) –The dataset to extract the SMILES strings from.
Returns:
-
list[str]–The unique SMILES strings with full atom mapping.
Source code in descent/targets/thermo.py
default_config
#
default_config(
phase: Phase, temperature: float, pressure: float | None
) -> SimulationConfig
Return a default simulation configuration for the specified phase.
Parameters:
-
phase(Phase) –The phase to return the default configuration for.
-
temperature(float) –The temperature [K] at which to run the simulation.
-
pressure(float | None) –The pressure [atm] at which to run the simulation.
Returns:
-
SimulationConfig–The default simulation configuration.
Source code in descent/targets/thermo.py
predict
#
predict(
dataset: Dataset,
force_field: TensorForceField,
topologies: dict[str, TensorTopology],
output_dir: Path,
cached_dir: Path | None = None,
per_type_scales: dict[DataType, float] | None = None,
) -> tuple[Tensor, Tensor, Tensor, Tensor]
Predict the properties in a dataset using molecular simulation, or by reweighting previous simulation data.
Parameters:
-
dataset(Dataset) –The dataset to predict the properties of.
-
force_field(TensorForceField) –The force field to use.
-
topologies(dict[str, TensorTopology]) –The topologies of the molecules present in the dataset, with keys of mapped SMILES patterns.
-
output_dir(Path) –The directory to write the simulation trajectories to.
-
cached_dir(Path | None, default:None) –The (optional) directory to read cached simulation trajectories from.
-
per_type_scales(dict[DataType, float] | None, default:None) –The scale factor to apply to each data type. A default of 1.0 will be used for any data type not specified.