nanotools.energy module

This module defines the Energy class.

class nanotools.energy.Energy(esr=None, ebg=None, ebs=None, edh=None, exc=None, evxc=None, etot=None, efermi=None, eigenvalues=None, efree=None, entropy=None, forces=None, forces_return=False, stress=None, stress_return=False, frc_t=None, frc_s=None, frc_vnl=None, frc_veff=None, frc_sr=None, frc_vna=None, frc_vdh=None, frc_rpc=None, edftd3=None, frc_dftd3=None, stress_dftd3=None, include_dftd3=False, dftd3_kwargs: dict = NOTHING)[source]

Bases: Base

Energy class.

The Energy class stores energy data. It is typically empty before a calculation. It gets overwritten during a calculation.

esr

esr is the short-range energy. Example:

esr = energy.esr
Type:

pint.registry.Quantity

ebs

ebs is the band structure energy. Example:

ebs = energy.ebs
Type:

pint.registry.Quantity

edh

edh is the delta Hartree energy. Example:

edh = energy.edh
Type:

pint.registry.Quantity

efermi

efermi is the Fermi energy. Example:

efermi = energy.efermi
Type:

pint.registry.Quantity

etot

etot is the total energy. Example:

etot = energy.etot
Type:

pint.registry.Quantity

evxc

evxc is the exchange-correlation potential energy. Example:

evxc = energy.evxc
Type:

pint.registry.Quantity

exc

exc is the exchange-correlation energy. Example:

exc = energy.exc
Type:

pint.registry.Quantity

eigenvalues

eigenvalues is a three-dimensional array containing the Kohn-Sham energies (the eigenvalues of the Kohn-Sham equation). The dimensions are the following: bands, k-point, spin. Example:

eigenvalues = energy.eigenvalues
Type:

pint.registry.Quantity

forces

forces is a two-dimensional array containing the atomic forces (as calculated by the Hellman-Feynman theorem). Example:

forces = energy.forces
Type:

pint.registry.Quantity

forces_return

If True, the forces are computed and written to energy.forces. They are not computed otherwise. Example:

energy.forces_return = True
Type:

bool

stress

stress is a two-dimensional array containing the stress tensor (as calculated by the Hellman-Feynman theorem). Example:

stress = energy.stress
Type:

pint.registry.Quantity

stress_return

If True, the stress tensor is computed and written to energy.stress. It is not computed otherwise. Example:

energy.stress_return = True
Type:

bool

edftd3

Grimme’s DFT-D3 energy. It is evaluated with ASE’s DFTD3 calculator. For additional details on the methods, please visit the Mulliken Center’s website.

Type:

pint.registry.Quantity

frc_dftd3

Grimme’s DFT-D3 forces.

Type:

pint.registry.Quantity

stress_dftd3

Grimme’s DFT-D3 stress.

Type:

pint.registry.Quantity

include_dftd3

Grimme’s DFT-D3 switch. If True, include D3 dispersion corrections in energy, forces and stress. Do nothing otherwise.

Type:

bool

get_cbm()[source]

Returns the conduction band maximum.

If partially occupied bands are detected, as in metals, then the function returns None.

Returns:

conduction band maximum

Return type:

float

get_free_energy()[source]

Returns the free energy.

get_total_energy()[source]

Returns the total energy.

get_vbm()[source]

Returns the valence band maximum.

If partially occupied bands are detected, as in metals, then the function returns None.

Returns:

valence band maximum

Return type:

float

ismetal()[source]

Determines whether the band structure is metallic.

The band structure is metallic if some bands are partially filled at zero temperature. The function determines band occupancy based on the Fermi level. Note that the Fermi level may cut the VBM or CBM of semiconductors or insulators depending on the occupation scheme and k-sampling mesh.

Returns:

True if metallic, False otherwise

Return type:

bool

set_stress_return(stress_return)[source]

Sets stress_return attribute.

If stress_return is True, then forces_return is also set to True.

Parameters:

stress_return (bool) – stress_return value