openmaterials.ai / codes / ASE

ASE: Python objects and a common calculator interface for atomistic simulation

A Python library whose Atoms object and calculator interface let one script drive many electronic structure and force field codes with the same optimizers, dynamics and analysis.

What it is and how it works

One interface, many codes

A calculator takes atomic numbers and positions and returns energy, forces and stress. About 30 codes, from Abinit and VASP to EMT and Lennard-Jones, plug in by files, pipes or in-process Python (Hjorth Larsen 2017).

Atoms object

Positions, cell, periodic flags, velocities and moments in NumPy arrays, units eV and Angstrom. Structures from ase.build, ase.spacegroup or ase.io (Hjorth Larsen 2017).

Optimizers and dynamics

BFGS, L-BFGS, FIRE and MDMin relax structures. Velocity Verlet, Berendsen, Langevin and Nose-Hoover integrators run MD. Filters relax the cell too (Hjorth Larsen 2017).

Saddle points and global search

Nudged elastic band with climbing image and AutoNEB, the dimer method, basin hopping, minima hopping and a genetic algorithm in ase.ga (Hjorth Larsen 2017).

Vibrations and thermochemistry

ase.vibrations and ase.phonons build the Hessian by finite differences, 6N + 1 force calls. Thermo classes turn the modes into U, S, F and G (Hjorth Larsen 2017).

Database and parallelism

ase.db stores Atoms rows with key-value pairs in JSON, SQLite3 or PostgreSQL. Calculators run in parallel as subprocesses or under mpiexec (Hjorth Larsen 2017).

What people do with it

Negative thermal expansion of ScF3

Self-consistent phonon free energies F(V,T) fit to the Birch-Murnaghan equation of state in ASE. The thermal expansion changes sign at 400 to 500 K (SCP) or 600 to 800 K (ISC). Oba 2019

SSCHA driven through ASE calculators

The stochastic self-consistent harmonic approximation code runs in a local automatic mode where ASE supplies energies, forces and stresses from Quantum ESPRESSO, VASP, SIESTA or LAMMPS. Monacelli 2021

How it is used

  1. Build the structure

    ase.build.bulk, surface or molecule, ase.spacegroup.crystal, or read() from a file.

  2. Attach a calculator

    atoms.calc = NWChem(xc='PBE') or any other code. get_potential_energy() runs it.

  3. Relax or propagate

    BFGS(atoms).run() relaxes, ase.md integrators propagate, a Trajectory records frames.

  4. Analyse

    Vibrations, Phonons, thermochemistry classes, equation of state fits, band structures.

  5. Store

    write() to traj or another format, or ase.db rows queried with the ase db tool.