Skip to content

Strain

Strain workflow - calculate molecular strain energy.

StrainResult dataclass

StrainResult(
    workflow_data: dict[str, Any],
    workflow_type: str,
    workflow_uuid: str,
    complete: bool = True,
)

Bases: WorkflowResult

Result from a strain workflow.

strain property

strain: float | None

Computed strain energy (kcal/mol).

conformer_uuids property

conformer_uuids: list[str | None]

UUIDs of conformer calculations.

constrained_optimization_uuid property

constrained_optimization_uuid: str | None

UUID of the constrained optimization calculation.

messages property

messages: list[Message]

Any messages or warnings from the workflow.

constrained_optimization property

constrained_optimization: Calculation | None

The constrained optimization calculation.

conformers property

conformers: list[Calculation]

All conformer calculations.

.. note:: Makes one API call per conformer on first access. Results are cached. Call clear_cache() to refresh.

conformer_energies property

conformer_energies: list[float | None]

Energies for all conformers (Hartree).

conformer_molecules property

conformer_molecules: list[Molecule]

Molecule objects for all conformers.

get_boltzmann_weights

get_boltzmann_weights(temperature: float = 300.0) -> list[float]

Compute Boltzmann weights for conformers.

Parameters:

Name Type Description Default
temperature float

Temperature in Kelvin (default: 300K).

300.0

Returns:

Type Description
list[float]

List of weights (sum to 1.0), excluding failed conformers.

submit_strain_workflow

submit_strain_workflow(
    initial_molecule: StructureInput,
    harmonic_constraint_spring_constant: float = 5.0,
    constrain_hydrogens: bool = False,
    conf_gen_settings: ConformerGenSettingsUnion | None = None,
    multistage_opt_settings: MultiStageOptSettings | None = None,
    name: str = "Strain Workflow",
    folder_uuid: str | None = None,
    folder: Folder | None = None,
    max_credits: int | None = None,
    webhook_url: str | None = None,
    is_draft: bool = False,
) -> Workflow

Submits a strain workflow to the API.

Parameters:

Name Type Description Default
initial_molecule StructureInput

Molecule to calculate strain for.

required
harmonic_constraint_spring_constant float

Spring constant for harmonic constraints (kcal/mol/A). Default 5.0.

5.0
constrain_hydrogens bool

Whether to constrain hydrogen positions. Default False.

False
conf_gen_settings ConformerGenSettingsUnion | None

Conformer generation settings. Defaults to OpenConf with max 200 conformers.

None
multistage_opt_settings MultiStageOptSettings | None

Optimization settings for conformer ranking. Defaults to GFN2-xTB optimization in water (ALPB) with a g-xTB singlepoint in water (CPCMx).

None
name str

Name of the workflow.

'Strain Workflow'
folder_uuid str | None

UUID of the folder to store the workflow in.

None
folder Folder | None

Folder object to store the workflow in.

None
max_credits int | None

Maximum number of credits to use for the workflow.

None
webhook_url str | None

URL that Rowan will POST to when the workflow completes.

None
is_draft bool

If True, submit the workflow as a draft without starting execution.

False

Returns:

Type Description
Workflow

Workflow object representing the submitted workflow.

Raises:

Type Description
requests.HTTPError

If the request to the API fails.