title | numbering | label | ||
---|---|---|---|---|
Simulation Inputs |
|
sim_inputs_page |
(specimen-models)=
This chapter introduces the Atomic Simulation Environment (ASE) for creating specimen models for use in TEM image simulation.
ASE is a set of tools and Python modules for setting up, manipulating and visualizing atomic structures, which is used in conjunction with a large number of atomistic simulation codes, for example GPAW for running DFT simulations. In this notebook, ASE is introduced in the context of running electron microscopy image simulations with abTEM.
The Atoms
object defines a collection of atoms. To define Atoms
from scratch, we need to specify at least three things:
- atomic positions,
- atomic numbers (or chemical symbols),
- a periodic cell.
For example, to create a basic model of the N2 molecule, we could define:
atoms = ase.Atoms("N2", positions=[(0.0, 0.0, 0.0), (1.0, 0.0, 0.0)], cell=[6, 6, 6])
All these attributes of the Atoms
object are stored in underlying NumPy arrays, which can be directly modified if desired. Convenient arithmetic operations also directly work for the Atoms
object, so structures can be easily combined to create more complex specimens.
ASE can import all common atomic-structure formats (full list here). Below we import a .cif
-file defining a unit cell of strontium titanate (SrTiO3) that we provide with this text and will use in further examples.
srtio3 = ase.io.read("srtio3.cif")
abTEM always assumes that the imaging electrons propagate along the
ASE has many tools for manipulating structures, but one particularly useful one is the surface
function, which can be used for creating a periodic surface (aligned with the
In the widget below, we have oriented the strontium titanate structure along the (110)-direction, and interactively create supercells out of it, with 2 Å of vacuum added at the top and bottom surfaces.
:name: fig_sto_supercell
:placeholder: ./static/sto_supercell.png
**Interactive widget showing supercell construction for the STO(110) supercell**:
Since the positions and atomic numbers are just NumPy
arrays, they can be modified in-place. Below, we create an SrTiO3/LaTiO3 interface by changing the atomic numbers of the Sr atoms with a
sto_lto = repeated_srtio3.copy()
mask = sto_lto.symbols == "Sr"
mask = mask * (sto_lto.positions[:, 1] < 7.5)
sto_lto.numbers[mask] = 57