> ## 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.

# PTMEnergy

> Predicted Template Modelling score energy. This is a measure of how confident the folding model is in its overall structure prediction.

## Definition

The pTM energy is the negated predicted Template Modelling score, so that minimizing energy corresponds to maximizing structural confidence.

$$
E_{\mathrm{pTM}} = -\mathrm{pTM}
$$

* $\mathrm{pTM}$ is the predicted Template Modelling score returned by the folding oracle (range 0 to 1)

## Parameters

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

<ResponseField name="weight" type="float" default="1.0">
  The weight of the energy term.
</ResponseField>

<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()

# Create the energy term
ptm_energy = bg.energies.PTMEnergy(
    oracle=esmfold,
    weight=1.0,
)

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