ASE

ASE

Overview

The  Atomic Simulation Environment (ASE)  is a Python library for running DFT calculations through a common interface regardless of the DFT package used. ASE is at the heart of our group and is great for both conventional and high-throughput calculations.
The easiest way to learn how to use ASE is to go through the  Getting Started  guide and the various  ASE modules . You may also wish to refer to the " Open Science with ASE: Core Tutorials " guide.

Basic Usage

The ASE homepage has many useful tutorials for how to use the program. A few minimal examples are shown below.
The main object in ASE is the Atoms object, which is a representation of a given material that you plan to manipulate or run a DFT calculation on. Given a CIF representation of a material (e.g. MOF5.cif), you can read in the file as an Atoms object as follows:
from ase.io import read

atoms = read('MOF5.cif')

MOF5.cif
5KB, Uploaded 3 years ago
It is also possible to write out the Atoms object into a new file:
from ase.io import write

atoms = read('MOF5.cif')
write('POSCAR', atoms)
To view a given Atoms object via the GUI, you can use the following:
from ase.visualize import view

atoms = read('MOF5.cif')
view(atoms) # use view(atoms, viewer='x3d') for Jupyter Notebooks
Alternatively, you can use ase gui MOF5.cif to view the CIF directly from the command line.

Tips and Tricks

The ASE and VASP conventions for stress are very different. When in doubt, parse everything using ASE! The unit of stress in ASE is eV/A^3 where positive stresses denote tension. VASP returns stresses in kbar and with the opposite sign convention, as well as a 3x3 matrix rather than Voigt notation. To convert between the two
  \sigma_{\mathrm{ASE}} [\mathrm{eV/\AA^3}]   = -\sigma_{\mathrm{VASP}}[\mathrm{kbar}]   \times 0.0006241509
 σASE[eV/A˚3]  =σVASP[kbar] ×0.0006241509   \sigma_{\mathrm{ASE}} [\mathrm{eV/\AA^3}]   = -\sigma_{\mathrm{VASP}}[\mathrm{kbar}]   \times 0.0006241509
A useful code snippet to convert between the two:
from ase.units import GPa

stress_ase = -0.1 * GPa * stress_vasp[[0, 1, 2, 4, 5, 3]]
However, you are better off just doing everything with ASE directly as:
from ase.io import read

atoms = read("OUTCAR")
atoms.get_stress()