DFT¶
Module to handle ab initio electrostatic potentials from the DFT code GPAW.
-
class
abtem.dft.
GPAWPotential
(calculator, gpts=None, sampling=None, slice_thickness=0.5, core_size=0.005, storage='cpu', precalculate=True)[source]¶ GPAW DFT potential object
The GPAW potential object is used to calculate electrostatic potential of a converged GPAW calculator object.
- Parameters
calculator (GPAW object) – A converged GPAW calculator.
origin (two float, optional) – xy-origin of the electrostatic potential relative to the xy-origin of the Atoms object [Å].
gpts (one or two int) – Number of grid points describing each slice of the potential.
sampling (one or two float) – Lateral sampling of the potential [1 / Å].
slice_thickness (float) – Thickness of the potential slices in Å for calculating the number of slices used by the multislice algorithm. Default is 0.5 Å.
core_size (float) – The standard deviation of the Gaussian function representing the atomic core.
-
build
(first_slice=0, last_slice=None, energy=None, max_batch=None, pbar=False)¶ Precalcaulate the potential as a potential array.
- Parameters
first_slice (int) – First potential slice to generate.
last_slice (int, optional) – Last potential slice generate.
energy (float) – Electron energy [eV]. If given, the transmission functions will be returned.
max_batch (int) – Maximum number of potential slices calculated in parallel.
pbar (bool) – If true, show progress bar.
- Returns
- Return type
PotentialArray object
-
check_slice_idx
(i)¶ Raises an error if i is greater than the number of slices.
-
copy
()¶ Make a copy.
-
property
extent
¶ Grid extent in each dimension [Å].
-
generate_slices
(first_slice=0, last_slice=None, max_batch=1)[source]¶ Generate the potential slices.
- Parameters
first_slice (int) – First potential slice to generate.
last_slice (int, optional) – Last potential slice generate.
max_batch (int) – Maximum number of potential slices calculated in parallel.
- Returns
- Return type
generator of PotentialArray objects
-
generate_transmission_functions
(energy, first_slice=0, last_slice=None, max_batch=1)¶ Generate the transmission functions one slice at a time.
- Parameters
energy (float) – Electron energy [eV].
first_slice (int) – First potential slice to generate.
last_slice (int, optional) – Last potential slice generate.
max_batch (int) – Maximum number of potential slices calculated in parallel.
- Returns
- Return type
generator of PotentialArray objects
-
property
gpts
¶ Number of grid points in each dimension.
-
property
num_slices
¶ The number of projected potential slices.
-
property
sampling
¶ Grid sampling in each dimension [1 / Å].
-
abtem.dft.
get_paw_corrections
(atom_index, calculator, rcgauss=0.005)[source]¶ PAW corrections function
Function to calculate the projector-augmented wave corrections to the electrostatic potential, needed to calculate the all-electron potential from a converged calculation. This is implemented independently in abTEM to enable dealing with non-orthogonal cells, and to allow working with slices of large potentials.
- Parameters
atom_index (int) – Index of the atom for which the corrections are calculated.
calculator (GPAW object) – Converged GPAW calculation.
rcgauss (float) – Radius of the Gaussian smearing of the nuclear potentials [Å]. Default value is 0.005 Å.
- Returns
The evaluation points and values of the core contribution to the electronstatic potential.
- Return type
two 1d arrays
-
abtem.dft.
interpolate_rectangle
(array, cell, extent, gpts, origin=None)[source]¶ Interpolation to rectangle function
A function to interpolate an array to a given rectangle, here used to convert electrostatic potentials from non-orthogonal cells to rectangular ones for use in abTEM multislice simulations.
- Parameters
array (
ndarray
) – Electrostatic potential array to be interpolated.cell (
ndarray
) – ASE atoms simulation cell.extent (
Sequence
[float
]) – Extent of the rectangle [Å].gpts (
Sequence
[int
]) – Number of interpolation grid points.origin (
Optional
[Sequence
[float
]]) – Origin of the rectangle. Default is (0,0).