atomlib.make
Functions to create structures and cells.
fcc
fcc(
elem: ElemLike,
a: Num,
*,
cell: CellType = "conv",
additional: Optional[IntoAtoms] = None
) -> AtomCell
Make a FCC lattice of the specified element, with the given cell.
If cell='conv' (the default), return the conventional cell, four atoms with cubic cell symmetry.
If cell='prim', return the primitive cell, a single atom with rhombohedral cell symmetry.
If cell='ortho', return an orthogonal cell, two atoms in a cell of size [a/sqrt(2), a/sqrt(2), a].
If additional is specified, those atoms will be added to the lattice (in fractional coordinates).
| PARAMETER | DESCRIPTION |
|---|---|
elem |
Element to add (e.g.
TYPE:
|
a |
Lattice parameter (Angstrom)
TYPE:
|
cell |
Cell type to return ('conv', 'prim', or 'ortho')
TYPE:
|
additional |
Additional atoms to add to the structure. |
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic FCC unit cell |
Source code in atomlib/make/__init__.py
wurtzite
wurtzite(
elems: ElemsLike,
a: Num,
c: Optional[Num] = None,
d: Optional[Num] = None,
*,
cell: CellType = "conv"
) -> AtomCell
Create a wurzite lattice of the specified two elements, with the given cell.
a and c are the hexagonal cell parameters. d is the fractional distance
between the two sublattices.
If cell='prim' or cell='conv' (the default), return a hexagonal unit cell.
If cell='ortho', return an orthogonal unit cell constructed from the hexagonal unit cell as
\(\hat{\mathbf{a}} = \mathbf{a}\), \(\hat{\mathbf{b}} = \mathbf{a} + 2 \mathbf{b}\), \(\hat{\mathbf{c}} = \mathbf{c}\).
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
a |
Lattice parameter (Angstrom)
TYPE:
|
c |
Vertical lattice parameter (Angstrom) |
d |
Vertical distance between the two sublattices (fractional) |
cell |
Cell type to return ('conv', 'prim', or 'ortho')
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic wurtzite unit cell |
Source code in atomlib/make/__init__.py
graphite
graphite(
elem: Union[str, ElemLike, None] = None,
a: Optional[Num] = None,
c: Optional[Num] = None,
*,
cell: CellType = "conv"
)
Source code in atomlib/make/__init__.py
rocksalt
Create a rock salt FCC structure AB. Returns the same cell types as fcc.
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
a |
Lattice parameter (Angstrom)
TYPE:
|
cell |
Cell type to return ('conv', 'prim', or 'ortho'). Returns
the same cell types as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic rocksalt unit cell |
Source code in atomlib/make/__init__.py
zincblende
Create a zinc-blende FCC structure AB.
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
a |
Lattice parameter (Angstrom)
TYPE:
|
cell |
Cell type to return ('conv', 'prim', or 'ortho'). Returns
the same cell types as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic zinc-blende unit cell |
Source code in atomlib/make/__init__.py
diamond
diamond(
elem: Optional[ElemLike] = None,
a: Optional[Num] = None,
*,
cell: CellType = "conv"
) -> AtomCell
Create a diamond cubic FCC structure. elem and a can be left
unspecified to return a diamond structure. Otherwise, both
must be specified.
| PARAMETER | DESCRIPTION |
|---|---|
elem |
Element to add (e.g. |
a |
Lattice parameter (Angstrom) |
cell |
Cell type to return ('conv', 'prim', or 'ortho'). Returns
the same cell types as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic diamond cubic unit cell |
Source code in atomlib/make/__init__.py
fluorite
Create a fluorite FCC structure \(\mathrm{AB_2}\). Returns the same cell types as fcc.
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
a |
Lattice parameter (Angstrom)
TYPE:
|
cell |
Cell type to return ('conv', 'prim', or 'ortho'). Returns
the same cell types as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic fluorite unit cell |
Source code in atomlib/make/__init__.py
cesium_chloride
cesium_chloride(
elems: ElemsLike = "CsCl",
a: Optional[Num] = None,
*,
d: Optional[Num] = None,
cell: CellType = "conv"
) -> AtomCell
Create a cesium chloride structure \(\mathrm{AB}\). CsCl is simple cubic, so all cell types are the same.
Only one of a (lattice parameter) or d (bond distance) needs to be specified.
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
a |
Lattice parameter (Angstrom) |
d |
Nearest-neighbor bond distance (Angstrom) |
cell |
Cell type to return ('conv', 'prim', or 'ortho'). All are identical for this structure
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic cesium chloride unit cell |
Source code in atomlib/make/__init__.py
perovskite
Create a perovskite structure \(\mathrm{ABX_3}\).
A is placed at the origin and B is placed at the cell center.
cell_size determines whether a cubic, tetragonal, or orthorhombic
structure is created. For instance, cell_size=3. returns a cubic
structure, while cell_size=[3., 5.] returns a tetragonal structure
a=3, c=5.
All cell types are the same for perovskite, so the cell parameter
has no effect.
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
cell_size |
Lattice parameters (e.g.
TYPE:
|
cell |
Cell type to return ('conv', 'prim', or 'ortho'). All are identical for this structure
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
Periodic perovskite unit cell. |
Source code in atomlib/make/__init__.py
random
random(
cell: Union[Cell, VecLike],
elems: ElemsLike,
density: float,
seed: Optional[object] = None,
**extra_cols: Any
) -> AtomCell
Make a random arrangement of atoms inside cell
(Cell or cell_size vector).
| PARAMETER | DESCRIPTION |
|---|---|
elems |
Elements to add (e.g.
TYPE:
|
density |
Mean mass density to target (g/cm^3)
TYPE:
|
seed |
Deterministic random seed to add (any object) |
extra_cols |
Extra parameters to add to each atom
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
A random arrangement of atoms |
Source code in atomlib/make/__init__.py
slab
slab(
atoms: HasAtomCellT,
zone: VecLike = (0.0, 0.0, 1.0),
horz: VecLike = (1.0, 0.0, 0.0),
*,
max_n: int = 50,
tol: float = 0.001
) -> HasAtomCellT
Create an periodic orthogonal slab of the periodic cell atoms.
zone in the original crystal will point along the +z-axis,
and horz (minus the zone component) wil point along the +x-axis.
Finds a periodic orthogonal slab with less than tol amount of strain,
and no more than max_n cells on one side.
| PARAMETER | DESCRIPTION |
|---|---|
atoms |
Input structure
TYPE:
|
zone |
Zone to align with the +z-axis
TYPE:
|
horz |
Zone to align with the +x-axis
TYPE:
|
max_n |
Maximum number of unit cells to search
TYPE:
|
tol |
Maximum strain tolerance
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
HasAtomCellT
|
A periodic, orthogonal cell |
Source code in atomlib/make/__init__.py
stacking_sequence
stacking_sequence(
layer: AtomCell,
sequence: str,
shift_vector: VecLike = (1, 0, 0),
*,
n_layers: int = 3
) -> AtomCell
Create an arbitrary stacking sequence from a single layer layer.
| PARAMETER | DESCRIPTION |
|---|---|
layer |
Layer to stack into a stacking sequence. Will be stacked along the c axis.
TYPE:
|
sequence |
Stacking sequence. Each layer should be "A", "B", or "C" (in the common case
where there are three layers). Example:
TYPE:
|
shift_vector |
Shift to apply, in fractional coordinates. The shift between each layer
will be
TYPE:
|
n_layers |
Number of layers which corresponds to a shift of a complete lattice vector.
Defaults to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AtomCell
|
An |