I am looking for computational tools that can be used to automatize the generation surface slab models of latices of oxides, layered oxides, perovskites etc.

I have found a promising Python package, ASE (Atomic Simulation Environment, https://wiki.fysik.dtu.dk/ase/index.html), however, going through their examples ASE seems to be designed for simple systems, like metal lattices. Maybe I am wrong, but cutting perovskites cells for slabs through given atoms seems to be a difficult task with ase.lattice.


I highly recommend using pymatgen for this.

I coded a surface slab generator for Avogadro and in addition to being slow (since it generates a supercell before carving up the slab) it has a variety of weird hard-to-debug issues.

There's a nice example of cutting $\ce{LiFePO4}$ online from materialsvirtuallab.org

# Import the neccesary tools to generate surfaces
from pymatgen.core.surface import SlabGenerator, generate_all_slabs, Structure, Lattice
# .. [ other parts of the page omitted ]
# Lets try something a little more complicated, say LiFePO4
from pymatgen.util.testing import PymatgenTest
# Get the LiFePO4 structure
LiFePO4 = PymatgenTest.get_structure("LiFePO4") 

# Let's add some oxidation states to LiFePO4, this will be 
# important when we want to take surface polarity into consideration
LiFePO4.add_oxidation_state_by_element({"Fe": 2, "Li": 1, "P": 5, "O": -2})
slabgen = SlabGenerator(LiFePO4, (0,0,1), 10, 10)

I've done a variety of slabs with pymatgen and they look fairly good. The core algorithm was published: "Efficient creation and convergence of surface slabs" Surface Science 617 (2013) 53–59.

The method is fairly widely used, including non-trivial results:


I have used ASE to create slaps of complex, anisotropic materials in the past. However, ase.lattice is not for creating slabs, it's a module containing functions for creating three dimensional Bravais lattices. Some functions you could use are ase.build.surface or ase.build.cut (for lower level control). Examples:

from ase.build import surface
s1 = surface('Au', (2, 1, 1), 9)
s1.center(vacuum=10, axis=2)

Creates a gold (211) slap with 9 layers

import ase
from ase.spacegroup import crystal

a = 4.05
aluminium = crystal('Al', [(0,0,0)], spacegroup=225,
                    cellpar=[a, a, a, 90, 90, 90])

al111 = cut(aluminium, (1,-1,0), (0,1,-1), nlayers=3)

Cut allows for finer control as you are specifying vectors (or atoms indices) that define a triangle in the plane you are cutting.

ASE is great for automization in general as it offers calculator interfaces to programs like VASP and I highly recommend it. I am not too familiar with pymatgen, but it seems to provide many similar features. Either is probably fine.


[1] https://wiki.fysik.dtu.dk/ase/ase/build/surface.html?highlight=cut#ase.build.surface

[2] https://wiki.fysik.dtu.dk/ase/ase/build/tools.html?highlight=cut#ase.build.cut

  • $\begingroup$ Thank you, indeed it looks much more useful than I originally thought. $\endgroup$ – Greg May 20 '20 at 14:48

Also, you can use Atomsk and Nanocut. Both are free.

Atomsk info (from the site): A free, Open Source command-line program dedicated to the creation, manipulation, and conversion of data files for atomic-scale simulations.

"Atomsk: A tool for manipulating and converting atomic data files" Pierre Hirel, Comput. Phys. Comm. 197 (2015) 212-219 doi:10.1016/j.cpc.2015.07.012

Nanocut info (form the site): Nanocut is a program designed to cut out various objects from three dimensional crystal structures. It is aimed to be helpful when creating geometry input for atomistic simulations. Currently it can create following objects: Spherical cluster Polyhedral cluster Cylindrical cluster Spherical wire (1D periodic) Polyhedral wire (1D periodic) Plain slab (2D periodic) Supercells (3D periodic)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.