← Files RowanARCHIVED FILE

skills/computational-chemistry-and-biology/reference/strain.md

2.29 KB · Oct 3, 2026 · 06:14 UTC

↓ Download file

# Strain

## Input

A `rowan.Molecule`. The strain of the given pose is compared against the global-minimum conformer, so to measure the strain of a specific 3D geometry (for example a docked or crystallographic pose), pass that structure via `rowan.Molecule.from_xyz(...)`. A structure from `rowan.Molecule.from_smiles(...)` uses RDKit's autogenerated conformer, which is usually already near a minimum (≈0 strain).

## Example

```python
import rowan

folder = rowan.get_folder("examples")

wf = rowan.submit_strain_workflow(
    initial_molecule=rowan.Molecule.from_xyz_file(
        "pose.xyz"
    ),  # any specific 3D geometry to measure
    folder=folder,
)

result = wf.result()
print(result.strain)  # strain energy in kcal/mol
```

## Settings

- `harmonic_constraint_spring_constant` (default `5.0`): spring constant in kcal/mol/A for the harmonic restraint in the constrained optimization of the input pose. The restraint lets the optimizer relax local artifacts (clashes, bad angles) while holding the pose near its input geometry so it cannot collapse into a different conformer — a larger value stays closer to the input, a smaller value allows more relaxation.
- `constrain_hydrogens` (default `False`): whether to constrain hydrogen positions during the constrained optimization.
- `conf_gen_settings` (default `rowan.OpenConfSettings(max_confs=200)`): conformer generation settings used to find the global-minimum conformer.
- `multistage_opt_settings` (default none): a `MultiStageOptSettings` applied to both sides of the comparison — ranking the conformer ensemble and optimizing the constrained pose — so strain is measured under one consistent level of theory. When omitted, it inherits the stjames default for strain — currently a GFN2-xTB optimization in water (ALPB) with a g-xTB single point in water (CPCMx).

## Result fields

- `strain`: the strain energy in kcal/mol (pose energy minus the lowest ensemble energy).
- `constrained_optimization`: the `Calculation` for the harmonically-restrained optimization of the input pose.
- `conformers` / `conformer_energies` / `conformer_molecules`: the reference conformer ensemble, its energies (Hartree), and its structures.
- `get_boltzmann_weights(temperature=300.0)`: Boltzmann weights for the ensemble.
- `messages`: any messages or warnings from the run.

SHA-256: a3a859f51bf66eafb92362033ed66fcc7c716237219a1bd434d49e99fdd3a15f