SKILL.md--- name: ase description: Atomic Simulation Environment - a set of tools for setting up, manipulating, running, visualizing, and analyzing atomistic simulations. Acts as a universal interface between Python and numerous quantum chemical and molecular dynamics codes. Use for building atomic structures, geometry optimization, molecular dynamics simulations, transition state searches (NEB), file format conversion (CIF, XYZ, POSCAR, PDB), electronic property calculations (DOS, band structures), and automating simulation workflows with DFT/MD codes like VASP, GPAW, Quantum ESPRESSO, LAMMPS. version: 3.23 license: LGPL-2.1 --- # ASE - Atomic Simulation Environment ASE is built around the Atoms object, which represents a collection of atoms with positions, atomic numbers, and a unit cell. It provides a common interface for interacting with various "Calculators" (external codes that compute energies and forces). ## When to Use - Building complex atomic structures: molecules, crystals, surfaces, and nanoparticles. - Running geometry optimizations (finding the minimum energy structure). - Performing Molecular Dynamics (MD) simulations in various ensembles. - Calculating Potential Energy Surfaces (PES) and transition states (NEB method). - Converting between atomic file formats (CIF, XYZ, POSCAR, PDB, etc.). - Calculating electronic properties like Density of States (DOS) and Band Structures. - Automating simulation workflows involving multiple software packages. ## Reference Documentation **Official docs**: https://wiki.fysik.dtu.dk/ase/ **List of Calculators**: https://wiki.fysik.dtu.dk/ase/ase/calculators/calculators.html **Search patterns**: `ase.Atoms`, `ase.build`, `ase.optimize`, `ase.io.read`, `ase.calculators` ## Core Principles ### The Atoms Object The heart of ASE. It stores: - **positions**: Cartesian coordinates in Angstroms (Nx3 array). - **symbols**: Chemical elements (e.g., 'H', 'Fe'). - **cell**: Unit cell vectors (3x3 matrix or 3/6 lengths/angles). - **pbc**: Periodic Boundary Conditions (boolean for each axis). ### Calculators ASE does not calculate energy itself. You attach a Calculator (e.g., GPAW, VASP, EMT, Lennard-Jones) to the Atoms object. When you call `atoms.get_potential_energy()`, ASE asks the calculator to perform the computation. ### Units **Crucial Rule**: ASE uses eV (electron-volts) for energy and Angstroms for distance. Time is in ASE units (often converted to fs). ## Quick Reference ### Installation ```bash pip install ase ``` ### Standard Imports ```python from ase import Atoms from ase.build import molecule, bulk, surface from ase.io import read, write from ase.optimize import BFGS from ase.visualize import view ``` ### Basic Pattern - Creating and Optimizing a Molecule ```python from ase.build import molecule from ase.optimize import BFGS from ase.calculators.emt import EMT # Simple effective medium theory calculator #