tbtsencSileTBtrans

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

TBtrans self-energy file object with downfolded self-energies to the device region

The \(\Sigma\) object contains all self-energies on the specified k- and energy grid projected into the device region.

This is mainly an output file object from TBtrans and can be used as a post-processing utility for testing various things in Python.

Note that anything returned from this object are the self-energies in eV.

Examples

>>> H = Hamiltonian(device)
>>> se = tbtsencSileTBtrans(...)
>>> # Return the self-energy for the left electrode (unsorted)
>>> se_unsorted = se.self_energy('Left', 0.1, [0, 0, 0])
>>> # Return the self-energy for the left electrode (sorted)
>>> se_sorted = se.self_energy('Left', 0.1, [0, 0, 0], sort=True)
>>> #
>>> # Query the indices in the full Hamiltonian
>>> pvt_unsorted = se.pivot('Left').reshape(-1, 1)
>>> pvt_sorted = se.pivot('Left', sort=True).reshape(-1, 1)
>>> # The following two lines are equivalent
>>> Hfull[pvt_unsorted, pvt_unsorted.T] -= se_unsorted[:, :]
>>> Hfull[pvt_sorted, pvt_sorted.T] -= se_sorted[:, :]
>>> # Query the indices in the device Hamiltonian
>>> dpvt_unsorted = se.pivot('Left', in_device=True).reshape(-1, 1)
>>> dpvt_sorted = se.pivot('Left', in_device=True, sort=True).reshape(-1, 1)
>>> # Following inserts are equivalent
>>> Hdev[dpvt_unsorted, dpvt_unsorted.T] -= se_unsorted[:, :]
>>> Hdev[dpvt_sorted, dpvt_sorted.T] -= se_sorted[:, :]

Attributes

E

Sampled energy-points in file

a_buf

Atomic indices (0-based) of device atoms

a_dev

Atomic indices (0-based) of device atoms

base_file

File of the current Sile

cell

Unit cell in file

elecs

List of electrodes

file

File of the current Sile

geom

The associated geometry from this file

geometry

The associated geometry from this file

k

Sampled k-points in file

kpt

Sampled k-points in file

lasto

Last orbital of corresponding atom

nE

Number of energy-points in file

na

Returns number of atoms in the cell

na_b

Number of atoms in the buffer region

na_buffer

Number of atoms in the buffer region

na_d

Number of atoms in the device region

na_dev

Number of atoms in the device region

na_u

Returns number of atoms in the cell

ne

Number of energy-points in file

nk

Number of k-points in file

nkpt

Number of k-points in file

no

Returns number of orbitals in the cell

no_d

Number of orbitals in the device region

no_u

Returns number of orbitals in the cell

o_dev

Orbital indices (0-based) of device orbitals

wk

Weights of k-points in file

wkpt

Weights of k-points in file

xa

Atomic coordinates in file

xyz

Atomic coordinates in file

Methods

Eindex(self, E)

Return the closest energy index corresponding to the energy E

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

Initialize self.

a2p(self, atom[, elec])

Return the pivoting orbital indices (0-based) for the atoms, possibly on an electrode

btd(self)

Block-sizes for the BTD method in the device region

chemical_potential(self, elec)

Return the chemical potential associated with the electrode elec

close(self)

dir_file(self[, filename])

File of the current Sile

eta(self, elec)

The imaginary part used when calculating the self-energies in eV

exist(self)

Query whether the file exists

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

Iterator on all groups, variables and dimensions.

kindex(self, k)

Return the index of the k-point that is closests to the queried k-point (in reduced coordinates)

mu(self, elec)

Return the chemical potential associated with the electrode elec

n_btd(self)

Number of blocks in the BTD partioning in the device region

o2p(self, orbital[, elec])

Return the pivoting indices (0-based) for the orbitals, possibly on an electrode

pivot(self[, elec, in_device, sort])

Return the pivoting indices for a specific electrode

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

Generic read method which should be overloaded in child-classes

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

Returns Geometry object from this file

read_supercell(self)

Returns SuperCell object from this file

scattering_matrix(self, elec, E[, k, sort])

Return the scattering matrix from the electrode elec

self_energy(self, elec, E[, k, sort])

Return the self-energy from the electrode elec

self_energy_average(self, elec, E[, sort])

Return the k-averaged average self-energy from the electrode elec

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

Generic write method which should be overloaded in child-classes

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

This is not meant to be used

property E

Sampled energy-points in file

Eindex(self, E)

Return the closest energy index corresponding to the energy E

Parameters
Efloat or int

if int, return it-self, else return the energy index which is closests to the energy.

a2p(self, atom, elec=None)[source]

Return the pivoting orbital indices (0-based) for the atoms, possibly on an electrode

This is equivalent to:

>>> p = self.o2p(self.geom.a2o(atom, True))
Parameters
atomarray_like or int

atomic indices (0-based)

elecstr or int or None

electrode to return pivoting indices of (if None it is the device pivoting indices).

property a_buf

Atomic indices (0-based) of device atoms

property a_dev

Atomic indices (0-based) of device atoms

property base_file

File of the current Sile

btd(self)

Block-sizes for the BTD method in the device region

property cell

Unit cell in file

chemical_potential(self, elec)[source]

Return the chemical potential associated with the electrode elec

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

File of the current Sile

property elecs

List of electrodes

eta(self, elec)[source]

The imaginary part used when calculating the self-energies in eV

exist(self)

Query whether the file exists

property file

File of the current Sile

property geom

The associated geometry from this file

property geometry

The associated geometry from this file

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
property k

Sampled k-points in file

kindex(self, k)

Return the index of the k-point that is closests to the queried k-point (in reduced coordinates)

Parameters
karray_like of float

the queried k-point in reduced coordinates \(]-0.5;0.5]\).

property kpt

Sampled k-points in file

property lasto

Last orbital of corresponding atom

mu(self, elec)

Return the chemical potential associated with the electrode elec

property nE

Number of energy-points in file

n_btd(self)

Number of blocks in the BTD partioning in the device region

property na

Returns number of atoms in the cell

property na_b

Number of atoms in the buffer region

property na_buffer

Number of atoms in the buffer region

property na_d

Number of atoms in the device region

property na_dev

Number of atoms in the device region

property na_u

Returns number of atoms in the cell

property ne

Number of energy-points in file

property nk

Number of k-points in file

property nkpt

Number of k-points in file

property no

Returns number of orbitals in the cell

property no_d

Number of orbitals in the device region

property no_u

Returns number of orbitals in the cell

o2p(self, orbital, elec=None)[source]

Return the pivoting indices (0-based) for the orbitals, possibly on an electrode

Parameters
orbitalarray_like or int

orbital indices (0-based)

elecstr or int or None

electrode to return pivoting indices of (if None it is the device pivoting indices).

property o_dev

Orbital indices (0-based) of device orbitals

pivot(self, elec=None, in_device=False, sort=False)[source]

Return the pivoting indices for a specific electrode

Parameters
elecstr or int

the corresponding electrode to return the self-energy from

in_devicebool, optional

If True the pivoting table will be translated to the device region orbitals

sortbool, optional

Whether the returned indices are sorted. Mostly useful if the self-energies are returned sorted as well.

Examples

>>> se = tbtsencSileTBtrans(...)
>>> se.pivot()
[3, 4, 6, 5, 2]
>>> se.pivot(sort=True)
[2, 3, 4, 5, 6]
>>> se.pivot(0)
[2, 3]
>>> se.pivot(0, in_device=True)
[4, 0]
>>> se.pivot(0, in_device=True, sort=True)
[0, 1]
>>> se.pivot(0, sort=True)
[2, 3]
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_geometry(self, *args, **kwargs)

Returns Geometry object from this file

read_supercell(self)

Returns SuperCell object from this file

scattering_matrix(self, elec, E, k=0, sort=False)[source]

Return the scattering matrix from the electrode elec

The scattering matrix is calculated as:

\[\Gamma(E) = i [\Sigma(E) - \Sigma^\dagger(E)]\]
Parameters
elecstr or int

the corresponding electrode to return the scattering matrix from

Efloat or int

energy to retrieve the scattering matrix at, if a floating point the closest energy value will be found and returned, if an integer it will correspond to the exact index

karray_like or int

k-point to retrieve, if an integer it is the k-index in the file

sortbool, optional

if True the returned scattering matrix will be sorted (equivalent to pivoting the scattering matrix)

self_energy(self, elec, E, k=0, sort=False)[source]

Return the self-energy from the electrode elec

Parameters
elecstr or int

the corresponding electrode to return the self-energy from

Efloat or int

energy to retrieve the self-energy at, if a floating point the closest energy value will be found and returned, if an integer it will correspond to the exact index

karray_like or int

k-point to retrieve, if an integer it is the k-index in the file

sortbool, optional

if True the returned self-energy will be sorted (equivalent to pivoting the self-energy)

self_energy_average(self, elec, E, sort=False)[source]

Return the k-averaged average self-energy from the electrode elec

Parameters
elecstr or int

the corresponding electrode to return the self-energy from

Efloat or int

energy to retrieve the self-energy at, if a floating point the closest energy value will be found and returned, if an integer it will correspond to the exact index

sortbool, optional

if True the returned self-energy will be sorted but not necessarily consecutive in the device region.

property wk

Weights of k-points in file

property wkpt

Weights of k-points in 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_geometry(self, *args, **kwargs)

This is not meant to be used

property xa

Atomic coordinates in file

property xyz

Atomic coordinates in file