nanotools.system module

This module defines the System class.

class nanotools.system.System(atoms, cell, hamiltonian=NOTHING, kpoint=NOTHING, pop=NOTHING, xc=NOTHING)[source]

Bases: Base

The System class contains the physical description of an atomic system.

Examples:

from nanotools import Atoms, Cell, System
a = 2.818 # lattice constant (ang)
cell = Cell(avec=[[0.,a,a],[a,0.,a],[a,a,0.]], resolution=0.12)
fxyz = [[0.00,0.00,0.00],[0.25,0.25,0.25]]
atoms = Atoms(fractional_positions=fxyz, formula="GaAs")
sys = System(cell=cell, atoms=atoms)
sys.kpoint.set_grid([5,5,5])
atoms

Contains the atomic configuration description (coordinates, species, etc.)

Type:

Atoms

cell

Contains cell related parameters.

Type:

Cell

hamiltonian

Contains Hamiltonian parameters.

Type:

Hamiltonian

kpoint

Contains k-point related parameters.

Type:

Kpoint

pop

Contains population (occupancy) related parameters.

Type:

Pop

xc

Contains the DFT functional parameters.

Type:

Xc

add_dielectric(region, epsilon=1.0)[source]

Add a dielectric object to the system.

Parameters:
  • region (Region) – object specifying a rectangular/parallelepipedic region in the 3d simulation box.

  • epsilon (float) – dielectric constant (relative to vacuum)

add_gate(region, work_func=<Quantity(0.0, 'electron_volt')>, Vgs=<Quantity(0.0, 'electron_volt')>)[source]

Add a gate object to the system.

Parameters:
  • region (Region) – object specifying a rectangular/parallelepipedic region in the 3d simulation box.

  • work_func (float) – metal work function of the gate, eg. 5.28 (eV) for gold.

  • Vgs (float) – gate - source voltage

  • units (string) – energy unit

classmethod from_ase_atoms(ase_atoms)[source]

Returns a system object given an ASE-atoms object.

get_number_of_atoms()[source]

Returns the number of atoms.

get_species_labels()[source]

Returns a list of the species labels.

set_cell(cell)[source]

Rescale avec to a specific volume.

set_fractional_positions(fractional_positions)[source]

Sets the atomic fractional positions.

set_kpoint_path(special_points=None, grid=None)[source]

Compute k-point coordinates along the line specified in Kpoint object.

Parameters:
  • special_points (list) – List of high symmetry points coordinates or label that create

  • sampling. (the Brillouin zone)

  • grid (int) – Total number of grid points. They will be evenly distributed as possible.

set_occ(bands, occ, num_bands=None)[source]

Set the occupancies in the pop object.

Parameters:
  • bands (list) – Two-element list giving the index range of fixed occupancies. The bands below the range are considered fully occupied and those above fully unoccupied.

  • occ (3D array) – Occupancies in the index range given by bands.

  • num_bands (int) – Total number of bands in the calculation.

set_open_boundary(dir)[source]

Set the boundary condition to be the Neumann type on the surface normal to the given direction.

Parameters:

dir (List[string]) – directions along which the Neumann boundary condition is to be set, eg. [“-x”,”+y”,”-z”]

set_positions(positions)[source]

Sets the atomic positions.

set_soc(soc)[source]

Sets hamiltonian.soc.

This function automatically updates the SO pseudopotential which is not read and stored by default.

set_valence_charge(charge, relative=False)[source]

Sets the valence change to a new value.

Update dependent attributes like the number of bands.

set_volume(v)[source]

Rescale avec to a specific volume.

supercell(T)[source]

Create a supercell System object from a System object.

Parameters:

T (NDArray) – A (3x3) linear transformation.

Returns:

to_ase_atoms()[source]

Returns a an ASE-atoms object corresponding to a system object.

vacate(site, keep_aob=True)[source]

Replaces an atom of a System with a vacuum atom.

Parameters:
  • Site (int) – site of the site to be vacated (0-based).

  • keep_aob (bool) – If True, a vacuum atom with the same atomic orbital basis is created and introduced in place of the vacated atom; the atom is simply vacated otherwise.

Returns:

write_format(filename='structure.xyz')[source]

examples: etot.system.write_format(“structure.xyz”) examples: etot.system.write_format(“structure.cif”)

nanotools.system.plot_isosurfaces(system, field, vals=None)[source]
plot isosurface of selected wavefunction at given contour-values
Args:

system (system) field (3d-array) vals (list of float): contour values