Skip to main content

Definition

The chemical potential energy penalizes deviations from a target number of residues. Echem=μNtotalNtargetpE_{\mathrm{chem}} = \mu \left| N_{\mathrm{total}} - N_{\mathrm{target}} \right|^{p}
  • μ\mu is the chemical potential
  • NtotalN_{\mathrm{total}} is the current total number of residues across all chains
  • NtargetN_{\mathrm{target}} is the target residue count
  • pp is the exponent (default 1)

Parameters

oracle
Oracle
required
The oracle to use for the energy term.
power
float
default:"1.0"
The power to raise the number of residues to.
target_size
int
default:"0"
The target size of the system.
chemical_potential
float
default:"1.0"
The chemical potential of the system.
weight
float
default:"1.0"
The weight of the energy term.
name
str | None
default:"None"
Optional name to append to the energy term name.

Methods

compute

Parameters
oracles_result
OraclesResultDict
required

Example

import bagel as bg

# Create any oracle (ChemicalPotentialEnergy only depends on residue count)
esmfold = bg.oracles.ESMFold()

# Penalize deviations from a target chain length of 50 residues
chem_potential = bg.energies.ChemicalPotentialEnergy(
    oracle=esmfold,
    target_size=50,
    chemical_potential=1.0,
    weight=1.0,
)

# Add to a state (typically combined with GrandCanonical mutation)
state = bg.State(
    chains=[chain],
    energy_terms=[chem_potential],
    name="my_state",
)