Metadata-Version: 2.4
Name: popcornn
Version: 0.4.0
Summary: Path Optimization with a Continuous Representation Neural Network (popcornn) optimizes molecular reaction paths along analytic and MLIP potentials.
Author-email: Kareem Hegazy <khegazy@berkeley.edu>, "Eric C.-Y. Yuan" <ericyuan@berkeley.edu>, Anup Kumar <anukumar94663@gmail.com>, Dmitriy Morozov <dmitriy@mrzv.org>, Michael Mahoney <mmahoney@stat.berkeley.edu>, Teresa Head-Gordon <thg@berkeley.edu>, "Samuel M. Blau" <smblau@lbl.gov>
License: CC-BY 4.0
Project-URL: repository, https://github.com/khegazy/popcornn
Project-URL: documentation, https://khegazy.github.io/popcornn/
Project-URL: changelog, https://github.com/khegazy/popcornn/blob/main/CHANGELOG.md
Keywords: Chemistry,Transition State,Reaction path,Minimum Energy Path,Geodesic
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: numpy
Requires-Dist: torch
Requires-Dist: torch_geometric
Requires-Dist: matplotlib
Requires-Dist: ase
Requires-Dist: pytest
Requires-Dist: pytest-cov
Requires-Dist: PyYAML
Requires-Dist: padaquad<3,>=2.0.0
Requires-Dist: fairchem-core>=2.4.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
Requires-Dist: ruff>=0.0.285; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.4.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.22.0; extra == "docs"
Requires-Dist: mkdocs-gen-files>=0.5.0; extra == "docs"
Requires-Dist: mkdocs-literate-nav>=0.6.0; extra == "docs"
Requires-Dist: pillow>=10.0.0; extra == "docs"
Requires-Dist: cairosvg>=2.7.1; extra == "docs"
Dynamic: license-file

# Popcornn

**Pop**cornn is a tool for finding how a chemical reaction gets from a
starting structure (the **reactant**) to an ending structure (the
**product**). Given those two structures, popcornn fits a smooth path
between them and then bends that path until it crosses the lowest-energy
barrier the chosen energy model can find.

The energy model can be a simple analytic toy (Wolfe, Müller–Brown), a
classical force field, or a modern machine-learned interatomic potential
(MACE, Orb, UMA, …). The path itself is represented by a small neural
network, so the whole thing is differentiable and trains by gradient
descent.

If "lowest-energy barrier" sounds unfamiliar, that's fine — see
[`docs/concepts.md`](docs/concepts.md) for a one-page background.

## Installation

```bash
conda create --name popcornn python=3.12
conda activate popcornn

git clone https://github.com/khegazy/popcornn.git
pip install -e ./popcornn
```

The `pip install` step takes about 2.5 min: 153 s and 158 s in two runs
on a NERSC Perlmutter node (2026-11-25), each in a fresh Python 3.12
environment with pip's cache off. It downloads 137 packages, mostly
PyTorch with its CUDA libraries and `fairchem-core`, and the
environment then takes 6.1 GB. On a slower network it takes longer.

That gets you everything you need for the analytic potentials. Each
machine-learned potential (MACE, Orb, UMA, …) has its own install steps —
see [`docs/potentials.md`](docs/potentials.md).

## Examples

The shipped configs in `examples/configs/` go from analytic 2D toys
to a published organic-chemistry benchmark. Run any of them from the
`examples/` directory with

```bash
python run.py --config configs/<name>.yaml
```

| Config | What it is | Needs | Runtime* |
| --- | --- | --- | --- |
| `wolfe.yaml` | 2D Wolfe–Schlegel analytic surface | nothing beyond the base install | 21 s (opt. 3.5 s, 108 iterations) |
| `muller_brown.yaml` | 2D Müller–Brown analytic surface | nothing beyond the base install | 18 s (opt. 7.2 s, 192 iterations) |
| `loss_example.yaml` | Wolfe–Schlegel with the `pvre` and `vre` integrands combined | nothing beyond the base install | 26 s (opt. 9.9 s, 186 iterations) |
| `lj13.yaml` | 13-atom Lennard–Jones cluster rearrangement | nothing beyond the base install | 24 s (opt. 11.2 s, 171 iterations) |
| `gg3.yaml` | a Grambow–Green organic reaction (3rd entry of the GG benchmark set) | GPU + the UMA model installed (see [`docs/potentials.md`](docs/potentials.md)) | 12.6 min† (opt. 3.4 s repel stage, 49 iterations; 12.0 min UMA stage, 142 iterations) |

\*Wall time of `python run.py --config configs/<name>.yaml` on one
NVIDIA A100-SXM4-80GB (NERSC Perlmutter GPU node), popcornn 0.4.0 with
padaquad 2.0.0, measured 2026-11-26. About 11–18 s of each run is spent
outside the optimization stages (start-up such as imports and CUDA
initialization, and writing the output). "opt."
is the optimization time of the stages and the number of iterations
until the convergence threshold was met. Every run stopped at its
threshold, so the iteration counts, and the times,
depend on the seed and the machine: over seeds 0–9 on a CPU,
Müller–Brown took 48 to 504 iterations to the same barrier (see
"Known issues" under 0.4.0 in the [CHANGELOG](CHANGELOG.md)). †Timed without imports or writing
the output (the `Popcornn` constructor and `optimize_path` only).

Each run writes the optimized path and predicted transition state to
`popcornn_path.xyz` / `popcornn_ts.xyz`. To swap in your own reaction,
point `images:` in the config at an `xyz` or `traj` file with at least
the reactant and product structures. The
[Getting Started guide](docs/getting-started.md) walks through this
from scratch.

## Where to go next

- [Getting Started](docs/getting-started.md) — install through first
  custom run.
- [Concepts](docs/concepts.md) — what a reaction path is, what the
  transition state is, why a neural network represents the path.
- [Configuration reference](docs/configuration.md) — every key in the
  YAML config.
- [Potentials](docs/potentials.md) — what's built in and how to install
  the MLIPs.
- [Convergence](docs/convergence.md) — picking `threshold` and
  `patience` for your system.
- [Memory & OOM](docs/memory-and-oom.md) — what to do if you run out of
  GPU memory.
- [Advanced](docs/advanced.md) — multi-stage optimization, schedulers,
  transition-state losses.

## Citing

If you use popcornn in your research, please cite this repository. A
citable release is on the way; until then, link to the GitHub repo.

## Support and contributing

Popcornn is under active development. Open a
[GitHub issue](https://github.com/khegazy/popcornn/issues) for bugs or
questions, and pull requests are welcome.

Before your first commit, install the development tools and the git hook
that lints and formats your changes with ruff on every commit:

```bash
pip install -e "./popcornn[dev]"
cd popcornn && pre-commit install
git config blame.ignoreRevsFile .git-blame-ignore-revs  # git blame skips formatting-only commits
```

To check the whole repository by hand, run `pre-commit run --all-files`.
