nanotools.atomcell module

class nanotools.atomcell.AtomCell(fractional_positions=None, positions=None, avec=None, formula: str | None = None, pbc=[True, True, True])[source]

Bases: object

AtomCell class.

The AtomCell class contains information about the positions and types of the atoms, the lattice vectors defining the cell, and flags indicating the periodic boundary conditions.

fractional_positions

Fractional coordinates of each atom. May be an array of row-vectors or the path to an xyz formatted file.

Examples:

atomcell.fractional_positions = [[0,0,0],[0.25,0.25,0.25]]
atomcell.fractional_positions = "left_lead.xyz"
Type:

2D array, str

positions

Cartesian coordinates of each atom. May be an array of row-vectors or the path to an xyz formatted file. By default, the units are in Angstroms. If a tuple is provided, the first element is the array of positions, the second element is the unit of the positions.

Examples:

atomcell.positions = [
    [1.16170546635838, 3.35586034069663, 16.96215117189000],
    [1.16170546635838, 0.67290534069663, 16.96711717189000],
    [3.48511646635838, 7.38012834069663, 16.96215117189000],
    [3.48511646635838, 4.69717334069663, 16.96711717189000]
]
atomcell.positions = "graphene.xyz"
atomcell.positions = ("ni_graphene.xyz", "bohr")
Type:

2D array, str, tuple

avec

Three vectors defining a parallelepipedic domain. By default, the units are in Angstroms. If one wants to use another unit, it is necessary to use the pint library.

Examples:

cell.avec = [[4.64682193271677, 0.0, 0.0], [0.0, 8.04853168139326, 0.0], [0.0, 0.0, 30.27076472739540]]
from nanotools.utils import ureg
cell.avec = [[4.64682193271677, 0.0, 0.0], [0.0, 8.04853168139326, 0.0], [0.0, 0.0, 30.27076472739540]] * ureg.bohr
Type:

2D array

formula

Chemical formula of the system. If atomcell.positions is a path to an xyz file, the formula is automatically read. If atomcell.positions is an array, the formula must be specified.

Examples:

atomcell.formula = "C2H4"
Type:

str

pbc

List of three boolean values indicating the periodic boundary conditions in the x, y, and z directions, respectively. For two-probe system, pbc along the transport direction is automatically set to False. Only needed for the relaxation of general system.

Examples:

atomcell.pbc = [False, True, False]
Type:

list