deltancSileTBtrans

class sisl.io.tbtrans.deltancSileTBtrans(filename, mode='r', lvl=0, access=1, *args, **kwargs)[source]

TBtrans \(\delta\) file object

The \(\delta\) file object is an extension enabled in TBtrans which allows changing the Hamiltonian in transport problems.

\[\mathbf H'(\mathbf k) = \mathbf H(\mathbf k) + \delta\mathbf H(E, \mathbf k) + \delta\mathbf\Sigma(E, \mathbf k)\]

This file may either be used directly as the \(\delta\mathbf H\) or the \(\delta\mathbf\Sigma\).

When writing \(\delta\) terms using write_delta one may add k or E arguments to make the \(\delta\) dependent on k and/or E.

Refer to the TBtrans manual on how to use this feature.

Examples

>>> H = Hamiltonian(geom.graphene(), dtype=np.complex128)
>>> H[0, 0] = 1j
>>> dH = get_sile('deltaH.dH.nc', 'w')
>>> dH.write_delta(H)
>>> H[1, 1] = 1.
>>> dH.write_delta(H, k=[0, 0, 0]) # Gamma only
>>> H[0, 0] += 1.
>>> dH.write_delta(H, E=1.) # only at 1 eV
>>> H[1, 1] += 1.j
>>> dH.write_delta(H, E=1., k=[0, 0, 0]) # only at 1 eV and Gamma-point

Attributes

base_file

File of the current Sile

file

File of the current Sile

Methods

__init__(self, filename[, mode, lvl, access])

Initialize self.

close(self)

dir_file(self[, filename])

File of the current Sile

exist(self)

Query whether the file exists

iter(self[, group, dimension, variable, …])

Iterator on all groups, variables and dimensions.

read(self, \*args, \*\*kwargs)

Generic read method which should be overloaded in child-classes

read_delta(self, \*\*kwargs)

Reads a delta model from the file

read_geometry(self, \*args, \*\*kwargs)

Returns the Geometry object from this file

read_supercell(self)

Returns the SuperCell object from this file

write(self, \*args, \*\*kwargs)

Generic write method which should be overloaded in child-classes

write_delta(self, delta, \*\*kwargs)

Writes a \(\delta\) Hamiltonian to the file

write_geometry(self, geometry)

Creates the NetCDF file and writes the geometry information

write_supercell(self, sc)

Creates the NetCDF file and writes the supercell information

property base_file

File of the current Sile

close(self)
dir_file(self, filename=None)

File of the current Sile

exist(self)

Query whether the file exists

property file

File of the current Sile

iter(self, group=True, dimension=True, variable=True, levels=-1, root=None)

Iterator on all groups, variables and dimensions.

This iterator iterates through all groups, variables and dimensions in the Dataset

The generator sequence will _always_ be:

  1. Group

  2. Dimensions in group

  3. Variables in group

As the dimensions are generated before the variables it is possible to copy groups, dimensions, and then variables such that one always ensures correct dependencies in the generation of a new SileCDF.

Parameters
groupbool (True)

whether the iterator yields Group instances

dimensionbool (True)

whether the iterator yields Dimension instances

variablebool (True)

whether the iterator yields Variable instances

levelsint (-1)

number of levels to traverse, with respect to root variable, i.e. number of sub-groups this iterator will return.

rootstr (None)

the base root to start iterating from.

Examples

Script for looping and checking each instance.

>>> for gv in self.iter():
...     if self.isGroup(gv):
...         # is group
...     elif self.isDimension(gv):
...         # is dimension
...     elif self.isVariable(gv):
...         # is variable
read(self, *args, **kwargs)

Generic read method which should be overloaded in child-classes

Parameters
kwargs :

keyword arguments will try and search for the attribute read_<> and call it with the remaining **kwargs as arguments.

read_delta(self, **kwargs)[source]

Reads a delta model from the file

read_geometry(self, *args, **kwargs)[source]

Returns the Geometry object from this file

read_supercell(self)[source]

Returns the SuperCell object from this file

write(self, *args, **kwargs)

Generic write method which should be overloaded in child-classes

Parameters
**kwargs :

keyword arguments will try and search for the attribute write_ and call it with the remaining **kwargs as arguments.

write_delta(self, delta, **kwargs)[source]

Writes a \(\delta\) Hamiltonian to the file

This term may be of

  • level-1: no E or k dependence

  • level-2: k-dependent

  • level-3: E-dependent

  • level-4: k- and E-dependent

Parameters
deltaSparseOrbitalBZSpin

the model to be saved in the NC file

karray_like, optional

a specific k-point \(\delta\) term. I.e. only save the \(\delta\) term for the given k-point. May be combined with E for a specific k and energy point.

Efloat, optional

an energy dependent \(\delta\) term. I.e. only save the \(\delta\) term for the given energy. May be combined with k for a specific k and energy point.

write_geometry(self, geometry)[source]

Creates the NetCDF file and writes the geometry information

write_supercell(self, sc)[source]

Creates the NetCDF file and writes the supercell information