Hide code cell source

import abtem
import ase
import matplotlib.pyplot as plt
import numpy as np
from ase.build import bulk

CBED quickstart#

This notebook demonstrates a basic CBED simulation of silicon in the \((111)\) zone axis.

Configuration#

We start by (optionally) setting our configuration. See documentation for details.

abtem.config.set(
    {
        "device": "cpu",
        "fft": "numpy",
        "diagnostics.task_progress": False,
        "diagnostics.progress_bar": False,
    }
);

Atomic model#

We create the atomic model. See our walkthough or our tutorial on atomic models.

We create an atomic model of silicon using the bulk function from ASE.

silicon = bulk("Si", crystalstructure="diamond")

abtem.show_atoms(silicon, plane="xy");
../../../_images/c0e983c3f9d1d9ac155d0e9e5fcf880b9ddc863797817e04501abd529cd5c2a9.png

We can choose the \((111)\) zone axis to be a propagation direction using the surface function.

silicon_111 = ase.build.surface(
    silicon, (1, 1, 1), layers=3, periodic=True
)  # create surface structure in the (111) direction

silicon_111_orthogonal = abtem.orthogonalize_cell(silicon_111)  # make cell orthogonal

abtem.show_atoms(silicon_111_orthogonal);
../../../_images/b2de76abaecd70245bdecc24e044dc073f44c5824bf9706fa6307b358aadfdac.png

Finally we repeat the structure in \(x\) and \(y\), this will improve the reciprocal space resolution. We also repeat the structure in \(z\), thus simulating a thicker sample.

atoms = silicon_111_orthogonal * (13, 8, 60)

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 6))
abtem.show_atoms(atoms, ax=ax1, title="Beam view")
abtem.show_atoms(atoms, ax=ax2, plane="xz", title="Side view", linewidth=0.0);
../../../_images/0ed3e91c5e23acd6d1fa11417e964ea8dfe060bf74f50cd4b3b479bbdb9b4e28.png

Potential#

We create an ensemble of potentials using the frozen phonon. See our walkthrough on frozen phonons.

frozen_phonons = abtem.FrozenPhonons(atoms, 8, {"Si": 0.078})

We create a potential from the frozen phonons model, see walkthrough on potentials.

potential = abtem.Potential(
    frozen_phonons,
    sampling=0.1,
    projection="infinite",
    slice_thickness=2,
    exit_planes=60,
)
wave = abtem.Probe(energy=100e3, semiangle_cutoff=9.4)
wave.grid.match(potential)
wave.profiles().show();
../../../_images/b3f2a9c4d8d701dfed6d4b2c3efa6bfed995fb8986dc9c3d51be329080bcc37b.png

Multislice#

We run the multislice algorithm and calculate the diffraction patterns, see our walkthrough on multislice.

measurements = wave.multislice(potential).diffraction_patterns(max_angle=30)

We take the mean across the frozen phonons axis, and compute the result.

measurement = measurements.mean(0)

measurement.compute();

Visualize results#

We show the thickness series as an exploded plot.

visualization = measurement.show(
    explode=True,
    figsize=(12, 5),
)
../../../_images/9e048974f014ea82490c84b4c8ef87437ef0ea0b4678bf96448430026e985396.png