Atomic Simulation Environment (ASE)

3.28.0 · active · verified Sun Apr 12

The Atomic Simulation Environment (ASE) is a comprehensive Python library designed for setting up, manipulating, running, visualizing, and analyzing atomistic simulations. It offers a flexible framework that integrates with various external simulation codes through its Calculator interface, supporting methods ranging from Density Functional Theory (DFT) to semi-empirical and classical interatomic potentials. ASE is actively maintained with frequent feature and bugfix releases; the current stable version is 3.28.0.

Warnings

Install

Imports

Quickstart

This example demonstrates how to create an `Atoms` object, attach a simple `EMT` calculator, perform a geometry optimization using `BFGS`, and save the final structure and energy. ASE defaults to eV and Å for units.

from ase import Atoms
from ase.calculators.emt import EMT
from ase.optimize import BFGS
from ase.io import write

# Create a molecule (H2)
h2 = Atoms('H2', positions=[[0, 0, 0], [0, 0, 0.7]])

# Attach a calculator (Empirical Potential)
h2.calc = EMT()

# Optimize the geometry
optimizer = BFGS(h2, trajectory='h2.traj')
optimizer.run(fmax=0.02)

# Print final energy and write structure
print(f'Final potential energy: {h2.get_potential_energy():.3f} eV')
write('H2.xyz', h2)

view raw JSON →