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

# LISEnergy

> Energy representing the Local Interaction Score (LIS), a function of the PAE matrix. For each pair of residues with a PAE below a cutoff, the LIS contribution is (cutoff - PAE) / cutoff. The total score is either averaged over all qualifying pairs (intensive) or summed (extensive).

## Definition

The Local Interaction Score (LIS) counts the fraction of inter-group residue pairs with PAE below a cutoff threshold, measuring how confidently the model predicts the spatial relationship between residue groups. For each qualifying pair, the contribution is `(cutoff - PAE) / cutoff`, producing a score between 0 and 1. The result is negated so that lower energy corresponds to stronger predicted interactions. When `intensive=True`, the score is averaged over qualifying pairs; when `intensive=False`, it is summed (extensive mode).

## Parameters

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

<ResponseField name="residues" type="list[list[Residue]]" required>
  Which residues to include in the first and second group.
</ResponseField>

<ResponseField name="pae_cutoff" type="float" default="12.0">
  The cutoff value for the PAE, in Angstroms, below which the interaction is considered "local".
</ResponseField>

<ResponseField name="intensive" type="bool" default="True">
  If True, the LIS is averaged over the number of residue pairs, otherwise it's an extensive sum.
</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="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()

# Define two groups of residues (e.g. hotspot and binder)
hotspot_residues = [residues_target[i] for i in range(10, 20)]
binder_residues = residues_binder

# Score local interactions between two groups using PAE-based LIS
lis_energy = bg.energies.LISEnergy(
    oracle=esmfold,
    residues=[hotspot_residues, binder_residues],
    pae_cutoff=12.0,
    weight=1.0,
)

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