Skip to content

Extrema Finder Utility

1D extrema detection utilities.

This module provides helper functions for identifying extrema in one-dimensional data series commonly produced by ReaxFF simulations, such as energy profiles, bond-order trajectories, dipole signals, polarization loops, or field-response curves.

Typical use cases include:

  • locating global or local energy minima and maxima
  • identifying peak responses in field-driven simulations
  • detecting switching or transition points in time-series data

get_extrema_points(y_series, x_series, mode='max', chunk_size=None)

Identify extrema points in a 1D data series.

This function extracts global or local extrema by locating maximum and/or minimum values of a y-series with respect to a corresponding x-series. Optionally, the x-axis may be partitioned into windows to detect local extrema within each segment.

Parameters:

Name Type Description Default
y_series Series or array - like

Dependent variable values (e.g., energy, polarization, bond order).

required
x_series Series or array - like

Independent variable values (e.g., iteration index or time).

required
mode (max, min, minmax)

Type of extrema to extract: - 'max': maxima only - 'min': minima only - 'minmax': both minima and maxima

'max'
chunk_size float or int

Size of the x-axis window used to find local extrema. If not provided, only global extrema are returned.

None

Returns:

Type Description
list of tuple[float, float]

List of (x, y) pairs corresponding to detected extrema points.

Examples:

>>> get_extrema_points(energy, iters, mode="min")
>>> get_extrema_points(signal, time, mode="minmax", chunk_size=50)