Definition
The chemical potential energy penalizes deviations from a target number of residues.
Echem=μ∣Ntotal−Ntarget∣p
- μ is the chemical potential
- Ntotal is the current total number of residues across all chains
- Ntarget is the target residue count
- p is the exponent (default 1)
Parameters
The oracle to use for the energy term.
The power to raise the number of residues to.
The target size of the system.
The chemical potential of the system.
The weight of the energy term.
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",
)