> ## Documentation Index
> Fetch the complete documentation index at: https://bagel.softnanolab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SurfaceAreaEnergy

> Energy term proportional to the amount of exposed surface area. This is measured by dividing the mean SASA (Solvent Accessible Surface Area) of the relevant atoms by the maximum possible SASA.

## Definition

The SASA energy is the mean solvent-accessible surface area of atoms in the group, normalized by a maximum SASA value.

$$
E_{\mathrm{SASA}} = \frac{1}{N_{\mathrm{atoms},G}} \sum_{a \in G} \frac{\mathrm{SASA}_a}{\mathrm{SASA}_{\max}}
$$

* $\mathrm{SASA}_a$ is the solvent-accessible surface area of atom $a$
* $\mathrm{SASA}_{\max}$ is a normalization constant (by default, the full surface area of a sulfur atom)
* $N_{\mathrm{atoms},G}$ is the number of atoms in the group $G$

## Parameters

<ResponseField name="oracle" type="FoldingOracle" required>
  The oracle to use for the energy term.
</ResponseField>

<ResponseField name="inheritable" type="bool" default="True">
  If a new residue is added next to a residue included in this energy term, this dictates whether that new residue could then be added to this energy term.
</ResponseField>

<ResponseField name="residues" type="list[Residue] | None" default="None">
  Which residues to include in the calculation. Considers all residues by default.
</ResponseField>

<ResponseField name="probe_radius" type="float | None" default="None">
  The VdW-radius of the solvent molecules used in the SASA calculation. Default is the water VdW-radius.
</ResponseField>

<ResponseField name="max_sasa" type="float | None" default="None">
  The maximum SASA value used if normalization is enabled. Default is the full surface area of a Sulfur atom.
</ResponseField>

<ResponseField name="weight" type="float" default="1.0" />

<ResponseField name="name" type="str | None" default="None">
  Optional name to append to the energy term name.
</ResponseField>

## Methods

### compute

**Parameters**

<ResponseField name="oracles_result" type="OraclesResultDict" required />

## Example

```python theme={null}
import bagel as bg

# Create the folding oracle
esmfold = bg.oracles.ESMFold()

# Minimize exposed surface area for a specific group of residues
surface_energy = bg.energies.SurfaceAreaEnergy(
    oracle=esmfold,
    residues=residues,
    weight=1.0,
)

# Add to a state
state = bg.State(
    chains=[chain],
    energy_terms=[surface_energy],
    name="my_state",
)
```
