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

# F3/F4 Order Parameters

> PBC-aware three-body and torsional water-order parameters

# F3/F4 Order Parameters

F3 and F4 describe local water ordering. They are order parameters, not cage detectors, and should be interpreted with temperature, water model, cutoff, and sampling conditions.

## F3: Three-Body Oxygen Ordering

For each central oxygen, Clavis forms every unordered pair of oxygen neighbors within the cutoff and evaluates

$\left(\cos\theta\,|\cos\theta| + \frac{1}{9}\right)^2.$

`f3_per_atom` is the mean of the triplet contributions centered on each water. `f3_overall` is the mean over **all contributing triplets**; it is not an unweighted mean of the per-water values. Lower values indicate more tetrahedral local ordering.

## F4: Torsional Ordering

For each neighboring water pair, Clavis selects the hydrogen pair with the largest PBC-aware H–H separation, evaluates the `H–O···O–H` dihedral angle `φ`, and averages

$F_4 = \langle \cos(3\phi) \rangle.$

`f4_per_atom` averages contributing pairs for each water. `f4_overall` averages each unique water pair once and is bounded by `[-1, 1]`.

## Periodic Geometry and Cutoff

* The default O–O neighbor cutoff is **0.35 nm (3.5 Å)**.
* Orthorhombic and triclinic cells use minimum-image distances.
* Coordinates are expected in nanometers after input conversion.

## Running F3/F4

1. Upload a supported structure or trajectory containing waters with oxygen and two hydrogen coordinates.
2. Open **ANALYZE** and run **F3/F4** for the current frame.
3. For normal GRO, large streamed GRO, or mapped LAMMPS data, select a sampled trajectory range to obtain one algorithm-owned result per frame.

Normal GRO, streamed GRO, mapped LAMMPS, and native XTC/TRR sessions support selected F3/F4 ranges. Exported trajectory rows include a one-based display frame, zero-based `frameIndex`, and `algorithm: f3f4` so they cannot be mistaken for cage-analysis results.

## Interpretation

Compare values within a controlled series or against a reference produced with the same water model, temperature, cutoff, and frame selection. Static ideal crystals and finite-temperature trajectories can differ substantially, so Clavis does not apply one universal phase threshold.
