Metadata-Version: 2.4
Name: scgo
Version: 0.9.5
Summary: Global optimization of atomic clusters using ASE with Basin Hopping and Genetic Algorithms, MLIP calculators (MACE, UMA, UPET), surface/adsorbate workflows, and NEB transition-state search.
Author-email: "R. Laplaza" <ruben.laplaza@iiq.csic.es>
License: MIT
Project-URL: Homepage, https://github.com/rlaplaza-lab/scgo
Project-URL: Documentation, https://scgo.readthedocs.io/
Project-URL: Repository, https://github.com/rlaplaza-lab/scgo
Project-URL: Issues, https://github.com/rlaplaza-lab/scgo/issues
Keywords: computational-chemistry,structure-optimization,atomic-clusters,basin-hopping,genetic-algorithm,ase,mace,uma,upet,fairchem,metatomic
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ase>=3.22.0
Requires-Dist: ase-ga>=0.1.0
Requires-Dist: libmolsymm>=3.0.0
Requires-Dist: numpy<2.5,>=2.2
Requires-Dist: scipy<3,>=1.14
Requires-Dist: tqdm>=4.60.0
Provides-Extra: mace
Requires-Dist: e3nn==0.4.4; extra == "mace"
Requires-Dist: mace-torch==0.3.17; extra == "mace"
Requires-Dist: nvalchemi-toolkit-ops[torch]==0.4.1; extra == "mace"
Requires-Dist: nvidia-nccl-cu12>=2.28; extra == "mace"
Requires-Dist: torch>=2.5.0; extra == "mace"
Requires-Dist: torch-sim-atomistic[mace]==0.6.2; extra == "mace"
Provides-Extra: uma
Requires-Dist: fairchem-core>=2.25.0; extra == "uma"
Requires-Dist: torch-sim-atomistic[fairchem]==0.6.2; extra == "uma"
Provides-Extra: upet
Requires-Dist: upet>=0.3.1; extra == "upet"
Requires-Dist: metatomic-torchsim>=0.1.3; extra == "upet"
Requires-Dist: torch-sim-atomistic==0.6.2; extra == "upet"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.3.0; extra == "dev"
Requires-Dist: ruff==0.14.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Dynamic: license-file

# SCGO: Simple Cluster Global Optimization

[![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org/downloads/) [![PyPI](https://img.shields.io/pypi/v/scgo.svg)](https://pypi.org/project/scgo/) [![Docs](https://img.shields.io/readthedocs/scgo.svg)](https://scgo.readthedocs.io/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

![SCGO Logo](docs/source/_static/scgo_logo.svg)

SCGO searches for low-energy arrangements of atoms. That can be a metal cluster, a molecule on a cluster, a cluster on a surface, or the top layers of a slab. The search uses basin hopping or a genetic algorithm. Transition states use nudged elastic band. MACE, UMA, and UPET are optional and run through ASE and TorchSim.

**Documentation:** [Read the Docs](https://scgo.readthedocs.io/)

## Install

The example below needs only the base package. It uses ASE's EMT potential:

```bash
pip install scgo
```

For a machine-learning potential, install one extra. Do not mix `[mace]`, `[uma]`, and `[upet]` in the same environment:

```bash
pip install "scgo[mace]"   # or [uma] / [upet]
```

**UPET only.** After `pip install "scgo[upet]"`, install this neighbor-list package as well:

```bash
pip install 'vesin==0.6.0' --force-reinstall --no-deps
```

Python 3.12+, with SQLite JSON1. Details: [installation guide](https://scgo.readthedocs.io/en/latest/installation.html).

## Quick start

```python
from scgo import run_go
from scgo.param_presets import get_testing_params

results = run_go(
    ["Pt"] * 4,
    params=get_testing_params(),
    seed=42,
    system_type="gas_cluster",
)

for energy, atoms in results:
    print(f"{energy:.3f} eV  {atoms.get_chemical_formula()}")
```

`results` is a list of `(energy, Atoms)` pairs, lowest energy first. The energies are EMT, and the preset is a small search (2 generations, population 5). Files are written to `Pt4_searches/` in the current directory.

`system_type` is required. SCGO picks the algorithm from the number of moving atoms. One or two atoms in vacuum are relaxed. Three atoms and no molecule use basin hopping, in vacuum or on a slab. Every other search uses a genetic algorithm. The other system types are in the [quickstart](https://scgo.readthedocs.io/en/latest/quickstart.html).

## Next

- [A real MACE potential](https://scgo.readthedocs.io/en/latest/quickstart.html#quickstart-mace)
- [A cluster on graphite](https://scgo.readthedocs.io/en/latest/quickstart.html#quickstart-surface)
- [A molecule on the cluster](https://scgo.readthedocs.io/en/latest/quickstart.html#quickstart-molecule)
- [The top layers of a slab](https://scgo.readthedocs.io/en/latest/quickstart.html#quickstart-slab)
- [Transition states](https://scgo.readthedocs.io/en/latest/quickstart.html#quickstart-ts)
- [Many compositions at once](https://scgo.readthedocs.io/en/latest/quickstart.html#quickstart-campaign)

## Examples

[`examples/`](examples/) has short scripts for all six system types. See [`examples/README.md`](examples/README.md).

## Development

```bash
pip install -e ".[mace,dev]"   # or [uma,dev] / [upet,dev]
pre-commit install
pytest tests/ -m "not slow and not integration and not requires_cuda and not requires_upet and not requires_uma"
```

Longer MLIP runs are in [`benchmark/`](benchmark/).

---

MIT License. See [`LICENSE`](LICENSE).
