schrodinger.application.mlff.inference module¶
- schrodinger.application.mlff.inference.create_jaguar_mlff_model(model_name: str, solvent: Solvent | None = None, solv_model: SolventModel | None = None, execution_device: MlffDeviceType = 0, precision: MlffPrecision = 1, do_force: bool = True, do_virial: bool = False, energy_unit: MlffEnergyUnit = 0, use_base_energies: bool = True) MlffModel¶
Create a MLFF model from a given model name. This is a wrapper around the create_mlff function from the energy module. The default settings are chosen to mirror how MLFF models are run through Jaguar.
- Parameters:
model_name – Model name
solvent – Solvent enum. Will fail if the solvent is not Solvent.NONE or None and the model does not support solvent (i.e. isn’t a TB model).
solv_model – Solvent model enum value or None. If
solventis set, will default to SolventModel.ALPB. Otherwise, defaults to None.execution_device – Device (CPU or CUDA) on which the model should be executed
precision – Floating point precision to use for model inference
do_force – Whether the model should compute forces on each atom
do_virial – Whether the model should compute the virial tensor. Used in computing the stress tensor.
energy_unit – Unit for energy predictions
use_base_energies – Toggle inclusion of base atomic energies in the model’s energy predictions. Only some models (e.g. MPNICE) support toggling the inclusion of atomic energies. If unsupported, this keyword will have no effect.
- Returns:
MLFF model
- Raises:
ValueError – If solvent is not Solvent.NONE/None and the model does not support solvent.
- schrodinger.application.mlff.inference.compute_mlff_single_points_structures(sts: list[schrodinger.structure._structure.Structure], predictor: energy.QRNNPredictor | energy.MlffModel, return_failed: bool = True, logger=<built-in function print>) list[Structure]¶
Compute single-point energies for a list of structures using a given QRNNPredictor or MlffModel. The input structures are modified in place with output from the model evaluation
The order of precedence for determining the charge of each structure is: 1. Structure charge from PROPERTY_KEY_CHARGE 2. Total charge of the structure determined from formal charges
The order of precedence for determining the multiplicity of each structure is: 1. Structure multiplicity from PROPERTY_KEY_MULT 2. Parity of the number of electrons, taking into account the total charge
- Parameters:
sts – list of structures
predictor – QRNNPredictor or MlffModel instance
return_failed – If True, return all structures, even those that failed to compute the MLFF energy.
logger – Callable to process any RuntimeErrors encountered
- Returns:
list of output structures, with properties added from model output