sisl.io.tbtrans.tbtncSileTBtrans
- class sisl.io.tbtrans.tbtncSileTBtrans
Bases:
_devncSileTBtrans
TBtrans output file object
Implementation of the TBtrans output
*.TBT.nc
files which contains calculated quantities related to the NEGF code TBtrans.Although the TBtrans code is in fortran and the resulting NetCDF file variables are in fortran indexing (1-based), everything is returned as Python indexing (0-based) when using Python scripts.
The mathematical notation described here will be used throughout.
A word on DOS normalization:
All the device region DOS functions may request a normalization depending on a variety of functions. You are highly encouraged to read the documentation for the
norm
function and to consider the benefit of using thenorm='atom'
normalization to more easily compare various partitions of DOS.Notes
The API for this class are largely equivalent to the arguments of the sdata command-line tool, with the execption that the command-line tool uses Fortran indexing numbers (1-based).
Plotting
Plotting functions for the
tbtncSileTBtrans
class.plot.geometry
(*args[, ...])Calls
read_geometry
and creates aGeometryPlot
from its output.plot.pdos
([geometry, elec, ...])Creates a
PDOSData
object and then plots aPdosPlot
from it.Methods
ADOS
([elec, E, kavg, atoms, orbitals, sum, norm])Spectral density of states (DOS) (1/eV).
Adensity_matrix
(elec, E[, kavg, isc, ...])Spectral function density matrix at energy
E
(1/eV)BDOS
([elec, E, kavg, sum, norm])Bulk density of states (DOS) (1/eV).
DOS
([E, kavg, atoms, orbitals, sum, norm])Green function density of states (DOS) (1/eV).
Eindex
(E[, method])Return the closest energy index corresponding to the energy
E
a2p
(atoms)Return the pivoting orbital indices (0-based) for the atoms, possibly on an electrode
a_down
(elec[, bulk])Down-folding atomic indices for a given electrode
a_elec
(elec)Electrode atomic indices for the full geometry (sorted)
atom_ACOHP
(E[, elec, kavg, isc, orbitals, uc])Atomic COHP curve of the spectral function
atom_ACOOP
(E[, elec, kavg, isc, orbitals, uc])Atomic COOP curve of the spectral function
atom_COHP
(E[, kavg, isc, orbitals, uc])Atomic COHP curve of the Green function
atom_COOP
(E[, kavg, isc, orbitals, uc])Atomic COOP curve of the Green function
atom_current
([elec, elec_other, activity, ...])Atomic current of atoms, a scalar quantity quantifying how much currents flows through an atom
atom_transmission
(E[, elec, activity, kavg, ...])Atomic transmission at energy
E
of atoms, a scalar quantity quantifying how much transmission flows through an atombase_directory
([relative_to])Retrieve the base directory of the file, relative to the path relative_to
bloch
(elec)Bloch-expansion coefficients for an electrode
bond_current
([elec, elec_other, kavg, isc, ...])Bond current between atoms (sum of orbital currents)
bond_transmission
(E[, elec, kavg, isc, ...])Bond transmission between atoms at a specific energy
btd
([elec])Block-sizes for the BTD method in the device/electrode region
chemical_potential
(elec)Return the chemical potential associated with the electrode elec
close
()current
([elec_from, elec_to, kavg])Current from from to to using the k-weights and energy spacings in the file.
current_parameter
(elec_from, mu_from, ...[, ...])Current from from to to using the k-weights and energy spacings in the file.
density_matrix
(E[, kavg, isc, orbitals, ...])Density matrix from the Green function at energy
E
(1/eV)dir_file
([filename, filename_base])File of the current Sile
electron_temperature
(elec)Electron bath temperature [Kelvin]
eta
([elec])The imaginary part used when calculating the self-energies in eV (or for the device
fano
([elec_from, elec_to, kavg, atol])The Fano-factor for the calculation (requires calculated transmission eigenvalues)
info
([elec])Information about the calculated quantities available for extracting in this file
iter
([group, dimension, variable, levels, root])Iterator on all groups, variables and dimensions.
kT
(elec)Electron bath temperature [eV]
kindex
(k)Return the index of the k-point that is closests to the queried k-point (in reduced coordinates)
mu
(elec)Return the chemical potential associated with the electrode elec
n_btd
([elec])Number of blocks in the BTD partioning
na_down
(elec)Number of atoms in the downfolding region (without device downfolded region)
no_down
(elec)Number of orbitals in the downfolding region (plus device downfolded region)
no_e
(elec)Number of orbitals in the downfolded region of the electrode in the device
noise_power
([elec_from, elec_to, kavg])Noise power from to to using the k-weights and energy spacings in the file (temperature dependent)
norm
([atoms, orbitals, norm])Normalization factor depending on the input
o2p
(orbitals[, elec])Return the pivoting indices (0-based) for the orbitals, possibly on an electrode
orbital_ACOHP
(E[, elec, kavg, isc, orbitals])Orbital resolved COHP analysis of the spectral function
orbital_ACOOP
(E[, elec, kavg, isc, orbitals])Orbital COOP analysis of the spectral function
orbital_COHP
(E[, kavg, isc, orbitals])Orbital resolved COHP analysis of the Green function
orbital_COOP
(E[, kavg, isc, orbitals])Orbital COOP analysis of the Green function
orbital_current
([elec, elec_other, kavg, ...])Orbital current originating from elec as a sparse matrix
orbital_transmission
(E[, elec, kavg, isc, ...])Transmission at energy
E
between orbitals originating from elecpivot
([elec, in_device, sort])Return the pivoting indices for a specific electrode (in the device region) or the device
pivot_down
(elec)Pivoting orbitals for the downfolding region of a given electrode
read
(*args, **kwargs)Generic read method which should be overloaded in child-classes
Returns a BrillouinZone object with the k-points associated
read_data
(*args, **kwargs)Read specific type of data.
read_geometry
(*args, **kwargs)Returns Geometry object from this file
Returns Lattice object from this file
reflection
([elec, kavg, from_single])Reflection into electrode elec
shot_noise
([elec_from, elec_to, classical, kavg])Shot-noise term from to to using the k-weights
Reduce an atomic sparse matrix to a vector contribution of each atom
sparse_orbital_to_atom
(Dij[, uc, sum_dup])Reduce a sparse matrix in orbital sparse to a sparse matrix in atomic indices
sparse_orbital_to_scalar
(Dij[, activity])Atomic scalar contribution of atoms for a sparse orbital matrix
sparse_orbital_to_vector
(Dij[, uc, sum_dup])Reduce an orbital sparse matrix to a vector contribution of each atom
transmission
([elec_from, elec_to, kavg])Transmission from elec_from to elec_to.
transmission_bulk
([elec, kavg])Bulk transmission for the elec electrode
transmission_eig
([elec_from, elec_to, kavg])Transmission eigenvalues from elec_from to elec_to.
vector_current
([elec, elec_other, kavg, ...])Vector for each atom being the sum of bond currents times the normalized bond vector between the atoms
vector_transmission
(E[, elec, kavg, isc, ...])Vector for each atom being the sum of bond transmissions times the normalized bond vector between the atoms
write
(*args, **kwargs)Generic write method which should be overloaded in child-classes
write_tbtav
(*args, **kwargs)Convert this to a TBT.AV.nc file, i.e. all k dependent quantites are averaged out.
Attributes
Sampled energy-points in file
Atomic indices (0-based) of device atoms
Atomic indices (0-based) of device atoms (sorted)
File of the current Sile
Unit cell in file
List of electrodes
File of the current Sile
Same as
geometry
, but deprecatedThe associated geometry from this file
Sampled k-points in file
Sampled k-points in file
Last orbital of corresponding atom
Number of energy-points in file
Returns number of atoms in the cell
Number of atoms in the buffer region
Number of atoms in the buffer region
Number of atoms in the device region
Number of atoms in the device region
Returns number of atoms in the cell
Number of energy-points in file
Number of k-points in file
Number of k-points in file
Returns number of orbitals in the cell
Number of orbitals in the device region
Returns number of orbitals in the cell
Orbital indices (0-based) of device orbitals (sorted)
Weights of k-points in file
Weights of k-points in file
Atomic coordinates in file
Atomic coordinates in file
- ADOS(elec=0, E=None, kavg=True, atoms=None, orbitals=None, sum=True, norm='none')[source]
Spectral density of states (DOS) (1/eV).
Extract the spectral DOS from electrode elec on a selected subset of atoms/orbitals in the device region
The normalization constant (
) is defined in the routinenorm
and depends on the arguments.- Parameters:
E (str | float | None) – optionally only return the DOS of atoms at a given energy point
kavg (
bool
,int
, optional) – whether the returned DOS is k-averaged, or an explicit (unweighed) k-point is returnedatoms (
ndarray
ofint
orbool
, optional) – only return for a given set of atoms (default to all). NOT allowed with orbitals keyword. If True it will use all atoms in the device. False is equivalent to None.orbitals (
ndarray
ofint
orbool
, optional) – only return for a given set of orbitals (default to all) NOT allowed with atoms keyword. If True it will use all orbitals in the device. False is equivalent to None.sum (bool) – whether the returned quantities are summed or returned as is, i.e. resolved per atom/orbital.
norm (Literal['none', 'atom', 'orbital', 'all']) – how the normalization of the summed DOS is performed (see
norm
routine).
- Return type:
- Adensity_matrix(elec, E, kavg=True, isc=None, orbitals=None, geometry=None)[source]
Spectral function density matrix at energy
E
(1/eV)The density matrix can be used to calculate the LDOS in real-space.
The
may be calculated using thedensity
routine. Basically the LDOS in real-space may be calculated aswhere
are the orbitals. Note that the broadening used in the TBtrans calculations ensures the broadening of the density, i.e. it should not be necessary to perform energy averages over the density matrices.- Parameters:
E (str | float) – the density matrix corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned density matrix is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned density matrix from unit-cell ([None, None, None]
) to the given supercell, the default is all density matrix elements for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain density matrix elements for a subset of orbitals, all other are set to 0.geometry (Geometry | None) – geometry that will be associated with the density matrix. By default the geometry contained in this file will be used. However, then the atomic species are probably incorrect, nor will the orbitals contain the basis-set information required to generate the required density in real-space.
- Return type:
See also
density_matrix
Green function density matrix
- BDOS(elec=0, E=None, kavg=True, sum=True, norm='none')[source]
Bulk density of states (DOS) (1/eV).
Extract the bulk DOS from electrode elec.
This returns the density of states for the full (Bloch-expanded) electrode. When
norm
is ‘none’, the DOS is the full DOS for all electrode atoms (fully expanded), if you want to get the DOS for the minimal (un-expanded) electrode unit-cell, then divide bynp.prod(tbt.bloch(elec))
. Whennorm
is anything else, it will be normalised to the number of atoms/orbitals in the electrode.- Parameters:
E (str | float | None) – optionally only return the DOS of atoms at a given energy point
kavg (
bool
,int
, optional) – whether the returned DOS is k-averaged, or an explicit (unweighed) k-point is returnedsum (bool) – whether the returned quantities are summed or returned as is, i.e. resolved per atom/orbital.
norm (Literal['none', 'atom', 'orbital', 'all']) – whether the returned quantities are summed over all orbitals or normed by number of orbitals in the electrode. Currently one cannot extract DOS per atom/orbital.
- Return type:
- DOS(E=None, kavg=True, atoms=None, orbitals=None, sum=True, norm='none')[source]
Green function density of states (DOS) (1/eV).
Extract the DOS on a selected subset of atoms/orbitals in the device region
The normalization constant (
) is defined in the routinenorm
and depends on the arguments.- Parameters:
E (str | float | None) – optionally only return the DOS of atoms at a given energy point
kavg (
bool
,int
, optional) – whether the returned DOS is k-averaged, or an explicit (unweighed) k-point is returnedatoms (
ndarray
ofint
orbool
, optional) – only return for a given set of atoms (default to all). NOT allowed with orbitals keyword. If True it will use all atoms in the device. False is equivalent to None.orbitals (
ndarray
ofint
orbool
, optional) – only return for a given set of orbitals (default to all) NOT allowed with atoms keyword. If True it will use all orbitals in the device. False is equivalent to None.sum (bool) – whether the returned quantities are summed or returned as is, i.e. resolved per atom/orbital.
norm (Literal['none', 'atom', 'orbital', 'all']) – how the normalization of the summed DOS is performed (see
norm
routine)
- Return type:
- Eindex(E, method='nearest')
Return the closest energy index corresponding to the energy
E
- Parameters:
E (Etype) – return the energy index which is closest to the energy passed. For a str it will be parsed to a float and treated as such.
method (Literal['nearest', 'above', 'below']) – how non-equal values should be located. * nearest takes the closest value * above takes the closest value above
E
. * below takes the closest value belowE
.
- a2p(atoms)
Return the pivoting orbital indices (0-based) for the atoms, possibly on an electrode
This is equivalent to:
>>> p = self.o2p(self.geometry.a2o(atom, True))
Will warn if an atom requested is not in the device list of atoms.
- a_down(elec, bulk=False)
Down-folding atomic indices for a given electrode
- a_elec(elec)
Electrode atomic indices for the full geometry (sorted)
- atom_ACOHP(E, elec=0, kavg=True, isc=None, orbitals=None, uc=False)[source]
Atomic COHP curve of the spectral function
- Parameters:
E (str | float) – the atomic COHP corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned COHP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COHP from unit-cell ([None, None, None]
) to the given supercell, the default is all COHP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COHP matrix elements for a subset of orbitals, all other are set to 0.uc (bool) – whether the returned COHP are only in the unit-cell. If
True
this will return a sparse matrix ofshape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.
- Return type:
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
atom_COOP
atomic COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
atom_ACOOP
atomic COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
atom_COHP
atomic COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
- atom_ACOOP(E, elec=0, kavg=True, isc=None, orbitals=None, uc=False)[source]
Atomic COOP curve of the spectral function
The atomic COOP are a sum over all orbital COOP:
This is a shorthand for calling
orbital_ACOOP
andsparse_orbital_to_atom
in order.- Parameters:
E (str | float) – the atomic COOP corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned COOP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COOP from unit-cell ([None, None, None]
) to the given supercell, the default is all COOP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COOP matrix elements for a subset of orbitals, all other are set to 0.uc (bool) – whether the returned COOP are only in the unit-cell. If
True
this will return a sparse matrix ofshape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.
- Return type:
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
atom_COOP
atomic COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
atom_COHP
atomic COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
atom_ACOHP
atomic COHP analysis of the spectral function
- atom_COHP(E, kavg=True, isc=None, orbitals=None, uc=False)[source]
Atomic COHP curve of the Green function
The atomic COHP are a sum over all orbital COHP:
- Parameters:
E (str | float) – the atomic COHP corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned COHP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COHP from unit-cell ([None, None, None]
) to the given supercell, the default is all COHP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COHP matrix elements for a subset of orbitals, all other are set to 0.uc (bool) – whether the returned COHP are only in the unit-cell. If
True
this will return a sparse matrix ofshape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.
- Return type:
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
atom_COOP
atomic COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
atom_ACOOP
atomic COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
atom_ACOHP
atomic COHP analysis of the spectral function
- atom_COOP(E, kavg=True, isc=None, orbitals=None, uc=False)[source]
Atomic COOP curve of the Green function
The atomic COOP are a sum over all orbital COOP:
- Parameters:
E (str | float) – the atomic COOP corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned COOP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COOP from unit-cell ([None, None, None]
) to the given supercell, the default is all COOP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COOP matrix elements for a subset of orbitals, all other are set to 0.uc (bool) – whether the returned COOP are only in the unit-cell. If
True
this will return a sparse matrix ofshape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.
- Return type:
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
atom_ACOOP
atomic COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
atom_COHP
atomic COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
atom_ACOHP
atomic COHP analysis of the spectral function
- atom_current(elec=0, elec_other=1, activity=True, kavg=True, isc=None, orbitals=None)[source]
Atomic current of atoms, a scalar quantity quantifying how much currents flows through an atom
The atomic current is a single number specifying a figure of the magnitude current flowing through each atom. It is thus not a quantity that can be related to the physical current flowing in/out of atoms but is merely a number that provides an idea of how much current this atom is redistributing.
The atomic current may have two meanings based on these two equations
If the activity is requested (
activity=True
) is returned.If
activity=False
is returned.For geometries with all atoms only having 1-orbital, they are equivalent.
Generally the activity current is a more rigorous figure of merit for the current flowing through an atom. More so than than the summed absolute atomic current due to the following reasoning. The activity current is a geometric mean of the absolute bond current and the absolute orbital current. This means that if there is an atom with a large orbital current it will have a larger activity current.
- Parameters:
elec_other (str | int) – this electrode determines the other chemical potential. As such the orbital currents does not reflect the current going from elec to elec_other!
activity (bool) –
True
to return the activity current, see explanation abovekavg (
bool
,int
, optional) – whether the returned orbital current is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned bond currents from the unit-cell ([None, None, None]
) to the given supercell, the default is all orbital currents for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain orbital currents for a subset of orbitals.
- Return type:
Examples
>>> Jij = tbt.orbital_current(0, 1, what="all") # orbital current originating from electrode ``0`` >>> Ja = tbt.sparse_orbital_to_scalar(Jij)
Notes
Calculating the current between two electrodes with the same chemical potential will return a matrix filled with 0’s since there is no bias window.
The currents does not reflect the current going from elec_from to elec_other!
See also
orbital_transmission
energy resolved transmission between orbitals
orbital_current
bias window integrated transmissions
bond_transmission
energy resolved transmissions between atoms
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
- atom_transmission(E, elec=0, activity=True, kavg=True, isc=None, orbitals=None)[source]
Atomic transmission at energy
E
of atoms, a scalar quantity quantifying how much transmission flows through an atomThe atomic transmission is a single number specifying a figure of the magnitude transmission flowing through each atom. It is thus not a quantity that can be related to the physical transmission flowing in/out of atoms but is merely a number that provides an idea of how much this atom is redistributing.
The atomic transmission may have two meanings based on these two equations
If the activity is requested (
activity=True
) is returned. If the activity current is requested (activity=True
)If
activity=False
is returned.For geometries with all atoms only having 1-orbital, they are equivalent.
Generally the activity is a more rigorous figure of merit for the transmission flowing through an atom. More so than than the summed absolute atomic transmission due to the following reasoning. The activity transmission is a geometric mean of the absolute bond transmission and the absolute orbital transmission. This means that if there is an atom with a large orbital transmission it will have a larger activity.
- Parameters:
E (str | float) – the atomic transmission corresponding to the energy.
activity (bool) –
True
to return the activity, see explanation abovekavg (
bool
,int
, optional) – whether the returned atomic transmissions are k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned transmissions from the unit-cell ([None, None, None]
) to the given supercell, the default is all orbital transmissions are used for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain orbital currents for a subset of orbitals.
- Return type:
Examples
>>> Jij = tbt.orbital_transmission(-1., what"all") # transmission @ E=-1 eV from electrode ``0`` >>> Ja = tbt.sparse_orbital_to_scalar(Jij)
See also
orbital_transmission
energy resolved transmission between orbitals
orbital_current
bias window integrated transmissions
bond_transmission
energy resolved transmissions between atoms
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- base_directory(relative_to='.')
Retrieve the base directory of the file, relative to the path relative_to
- bloch(elec)
Bloch-expansion coefficients for an electrode
- bond_current(elec=0, elec_other=1, kavg=True, isc=None, what='all', orbitals=None, uc=False)[source]
Bond current between atoms (sum of orbital currents)
Short hand function for calling
orbital_current
andsparse_orbital_to_atom
.The bond currents are a sum over all orbital currents:
- Parameters:
elec_other (str | int) – this electrode determines the other chemical potential. As such the orbital currents does not reflect the current going from elec to elec_other!
kavg (
bool
,int
, optional) – whether the returned bond current is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned bond currents from the unit-cell ([None, None, None]
) (default) to the given supercell. If[None, None, None]
is passed all bond currents are returned.what (
{"all"/"both"/"+-"/"inout", "+"/"out", "-"/"in"}
) – If +/out is supplied only the positive currents are used (going out) for -/in, only the negative currents are used (going in), else return both. Please see discussion inorbital_current
.orbitals (
ndarray
ordict
, optional) – only retain currents for a subset of orbitals before calculating bond current Passed directly toorbital_current
.uc (bool) – whether the returned currents are only in the unit-cell (supercell currents will be folded to their unit-cell equivalents). If True this will return a sparse matrix of
shape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.
- Return type:
Examples
>>> Jij = tbt.orbital_current(0, 1, what="out") # orbital current originating from electrode ``0`` >>> Jab1 = tbt.sparse_orbital_to_atom(Jij) >>> Jab2 = tbt.bond_current(0, 1, what="out") >>> Jab1 == Jab2 True
Notes
Calculating the current between two electrodes with the same chemical potential will return a matrix filled with 0’s since there is no bias window.
The currents does not reflect the current going from elec_from to elec_other!
See also
orbital_transmission
energy resolved transmission between orbitals
orbital_current
bias window integrated transmissions
bond_transmission
energy resolved transmissions between atoms
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- bond_transmission(E, elec=0, kavg=True, isc=None, what='all', orbitals=None, uc=False)[source]
Bond transmission between atoms at a specific energy
Short hand function for calling
orbital_transmission
andsparse_orbital_to_atom
.The bond transmissions are a sum over all orbital transmissions
- Parameters:
E (str | float) – the bond transmission corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned bond transmissions is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned transmissions from the unit-cell ([None, None, None]
) (default) to the given supercell. If[None, None, None]
is passed all transmissions are returned.what (
{"all"/"both"/"+-"/"inout", "+"/"out", "-"/"in"}
) – If +/out is supplied only the positive transmissions are used (going out) for -/in, only the negative transmissions are used (going in), else return both. Please see discussion inorbital_transmission
.orbitals (
ndarray
ordict
, optional) – only retain transmissions for a subset of orbitals before calculating bond transmissions Passed directly toorbital_transmission
.uc (bool) – whether the returned transmissions are only in the unit-cell (supercell bonds will be folded to their unit-cell equivalents). If True this will return a sparse matrix of
shape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.
- Return type:
Examples
>>> Jij = tbt.orbital_transmission(-1.0, what="out") # orbital transmission @ E = -1 eV originating from electrode ``0`` >>> Jab1 = tbt.sparse_orbital_to_atom(Jij)[ >>> Jab2 = tbt.bond_transmission(-1.0, what="out") >>> Jab1 == Jab2 True
See also
orbital_transmission
energy resolved transmission between orbitals
orbital_current
bias window integrated transmissions
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- btd(elec=None)
Block-sizes for the BTD method in the device/electrode region
- chemical_potential(elec)
Return the chemical potential associated with the electrode elec
- close()
- current(elec_from=0, elec_to=1, kavg=True)[source]
Current from from to to using the k-weights and energy spacings in the file.
Calculates the current as:
The chemical potential and the temperature are taken from this object.
- Parameters:
- Return type:
See also
current_parameter
to explicitly set the electronic temperature and chemical potentials
chemical_potential
routine that defines the chemical potential of the queried electrodes
kT
routine that defines the electronic temperature of the queried electrodes
- current_parameter(elec_from, mu_from, kt_from, elec_to, mu_to, kt_to, kavg=True)[source]
Current from from to to using the k-weights and energy spacings in the file.
Calculates the current as:
The chemical potential and the temperature are passed as arguments to this routine.
- Parameters:
mu_from (float) – the chemical potential of the electrode (in eV)
kt_from (float) – the electronic temperature of the electrode (in eV)
elec_to (str | int) – the absorbing electrode (different from elec_from)
mu_to (float) – the chemical potential of the electrode (in eV)
kt_to (float) – the electronic temperature of the electrode (in eV)
kavg (
bool
,int
, optional) – whether the returned current is k-averaged, or an explicit (unweighed) k-point is returned
- Return type:
See also
current
which calculates the current with the chemical potentials and temperatures set in the TBtrans calculation
- density_matrix(E, kavg=True, isc=None, orbitals=None, geometry=None)[source]
Density matrix from the Green function at energy
E
(1/eV)The density matrix can be used to calculate the LDOS in real-space.
The
may be calculated using thedensity
routine. Basically the LDOS in real-space may be calculated aswhere
are the orbitals. Note that the broadening used in the TBtrans calculations ensures the broadening of the density, i.e. it should not be necessary to perform energy averages over the density matrices.- Parameters:
E (str | float) – the density matrix corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned density matrix is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned density matrix from unit-cell ([None, None, None]
) to the given supercell, the default is all density matrix elements for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain density matrix elements for a subset of orbitals, all other are set to 0.geometry (Geometry | None) – geometry that will be associated with the density matrix. By default the geometry contained in this file will be used. However, then the atomic species are probably incorrect, nor will the orbitals contain the basis-set information required to generate the required density in real-space.
- Return type:
See also
Adensity_matrix
spectral function density matrix
- dir_file(filename=None, filename_base='')
File of the current Sile
- eta(elec=None)
The imaginary part used when calculating the self-energies in eV (or for the device
- fano(elec_from=0, elec_to=1, kavg=True, atol=1e-6)[source]
The Fano-factor for the calculation (requires calculated transmission eigenvalues)
Calculate the Fano factor defined as (or through the shot-noise):
Notes
The default zero_T may change in the future. This calculation will only work for non-polarized calculations since the divisor needs to be the spin-sum. The current implementation uses the full transmission as the divisor.
Examples
For a spin-polarized calculation one should calculate the Fano factor as:
>>> up = get_sile('siesta.TBT_UP.nc') >>> down = get_sile('siesta.TBT_DN.nc') >>> fano = up.fano() * up.transmission() + down.fano() * down.transmission() >>> fano /= up.transmission() + down.transmission()
- Parameters:
elec_to (str | int) – the absorbing electrode (different from elec_from)
kavg (
bool
,int
, optional) – whether the returned Fano factor is k-averaged, or an explicit (unweighed) k-point is returned. In any case the divisor will always be the k-averaged transmission.atol (float) – any transmission eigen value lower than this value will be treated as exactly 0.
- Return type:
See also
shot_noise
shot-noise term (zero temperature limit)
noise_power
temperature dependent noise power
- info(elec=None)[source]
Information about the calculated quantities available for extracting in this file
- iter(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:
Group
Dimensions in group
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:
group (
bool
(True)) – whether the iterator yields Group instancesdimension (
bool
(True)) – whether the iterator yields Dimension instancesvariable (
bool
(True)) – whether the iterator yields Variable instanceslevels (
int
(-1)) – number of levels to traverse, with respect toroot
variable, i.e. number of sub-groups this iterator will return.root (
str
(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
- kT(elec)
Electron bath temperature [eV]
See also
electron_temperature
bath temperature in [K]
- kindex(k)
Return the index of the k-point that is closests to the queried k-point (in reduced coordinates)
- mu(elec)
Return the chemical potential associated with the electrode elec
- n_btd(elec=None)
Number of blocks in the BTD partioning
- na_down(elec)
Number of atoms in the downfolding region (without device downfolded region)
- no_down(elec)
Number of orbitals in the downfolding region (plus device downfolded region)
- no_e(elec)
Number of orbitals in the downfolded region of the electrode in the device
- noise_power(elec_from=0, elec_to=1, kavg=True)[source]
Noise power from to to using the k-weights and energy spacings in the file (temperature dependent)
Calculates the noise power as
Where
are the Fermi-Dirac distributions for the electrodes.- Raises:
SislInfo – If all of the calculated
values in the file are above 0.001.- Parameters:
- Return type:
See also
fano
the ratio between the quantum mechanial and the classical shot noise.
shot_noise
shot-noise term (zero temperature limit)
- norm(atoms=None, orbitals=None, norm='none')[source]
Normalization factor depending on the input
The normalization can be performed in one of the below methods. In the following
refers to the normalization constant that is to be used (i.e. the divisor):'none'
'all'
equals the number of orbitals in the total device region.'atom'
equals the total number of orbitals in the selected atoms. If orbitals is an argument a conversion of orbitals to the equivalent unique atoms is performed, and subsequently the total number of orbitals on the atoms is used. This makes it possible to compare the fraction of orbital DOS easier.'orbital'
is the sum of selected orbitals, if atoms is specified, this is equivalent to the ‘atom’ option.
- Parameters:
atoms (
ndarray
ofint
orbool
, optional) – only return for a given set of atoms (default to all). NOT allowed with orbitals keywordorbitals (
ndarray
ofint
orbool
, optional) – only return for a given set of orbitals (default to all) NOT allowed with atoms keywordnorm (Literal['none', 'atom', 'orbital', 'all']) – how the normalization of the summed DOS is performed (see
norm
routine)
- Return type:
- o2p(orbitals, elec=None)
Return the pivoting indices (0-based) for the orbitals, possibly on an electrode
Will warn if an orbital requested is not in the device list of orbitals.
- orbital_ACOHP(E, elec=0, kavg=True, isc=None, orbitals=None)[source]
Orbital resolved COHP analysis of the spectral function
This will return a sparse matrix, see
scipy.sparse.csr_matrix
for details. Each matrix element of the sparse matrix corresponds to the COHP of the underlying geometry.The COHP analysis can be written as:
- Parameters:
kavg (
bool
,int
, optional) – whether the returned COHP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COHP from unit-cell ([None, None, None]
) to the given supercell, the default is all COHP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COHP matrix elements for a subset of orbitals, all other are set to 0.
- Return type:
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
atom_COOP
atomic COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
atom_ACOOP
atomic COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
atom_COHP
atomic COHP analysis of the Green function
atom_ACOHP
atomic COHP analysis of the spectral function
- orbital_ACOOP(E, elec=0, kavg=True, isc=None, orbitals=None)[source]
Orbital COOP analysis of the spectral function
This will return a sparse matrix, see
csr_matrix
for details. Each matrix element of the sparse matrix corresponds to the COOP of the underlying geometry.The COOP analysis can be written as:
The sum of the COOP DOS is equal to the DOS:
One can calculate the (diagonal) balanced COOP analysis, see JPCM 15 (2003), 7751-7761 for details. The DBCOOP is given by:
The BCOOP can be looked up in the reference above.
- Parameters:
E (str | float) – the COOP values corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned COOP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COOP from unit-cell ([None, None, None]
) to the given supercell, the default is all COOP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COOP matrix elements for a subset of orbitals, all other are set to 0.
- Return type:
Examples
>>> ACOOP = tbt.orbital_ACOOP(-1.0) # COOP @ E = -1 eV from ``0`` spectral function >>> ACOOP[10, 11] # COOP value between the 11th and 12th orbital >>> ACOOP.sum(1).A[tbt.o_dev, 0] == tbt.ADOS(0, sum=False)[tbt.Eindex(-1.0)] >>> D = ACOOP.diagonal().sum() >>> ADBCOOP = ACOOP / D
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
atom_COOP
atomic COOP analysis of the Green function
atom_ACOOP
atomic COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
atom_COHP
atomic COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
atom_ACOHP
atomic COHP analysis of the spectral function
- orbital_COHP(E, kavg=True, isc=None, orbitals=None)[source]
Orbital resolved COHP analysis of the Green function
This will return a sparse matrix, see
scipy.sparse.csr_matrix
for details. Each matrix element of the sparse matrix corresponds to the COHP of the underlying geometry.The COHP analysis can be written as:
- Parameters:
kavg (
bool
,int
, optional) – whether the returned COHP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COHP from unit-cell ([None, None, None]
) to the given supercell, the default is all COHP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COHP matrix elements for a subset of orbitals, all other are set to 0.
- Return type:
Examples
>>> COHP = tbt.orbital_COHP(-1.0) # COHP @ E = -1 eV >>> COHP[10, 11] # COHP value between the 11th and 12th orbital
See also
orbital_COOP
orbital resolved COOP analysis of the Green function
atom_COOP
atomic COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
atom_ACOOP
atomic COOP analysis of the spectral function
atom_COHP
atomic COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
atom_ACOHP
atomic COHP analysis of the spectral function
- orbital_COOP(E, kavg=True, isc=None, orbitals=None)[source]
Orbital COOP analysis of the Green function
This will return a sparse matrix, see
scipy.sparse.csr_matrix
for details. Each matrix element of the sparse matrix corresponds to the COOP of the underlying geometry.The COOP analysis can be written as:
The sum of the COOP DOS is equal to the DOS:
One can calculate the (diagonal) balanced COOP analysis, see JPCM 15 (2003), 7751-7761 for details. The DBCOOP is given by:
The BCOOP can be looked up in the reference above.
- Parameters:
kavg (
bool
,int
, optional) – whether the returned COOP is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned COOP from unit-cell ([None, None, None]
) to the given supercell, the default is all COOP for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.orbitals (
ndarray
ordict
, optional) – only retain COOP matrix elements for a subset of orbitals, all other are set to 0.
- Return type:
Examples
>>> COOP = tbt.orbital_COOP(-1.0) # COOP @ E = -1 eV >>> COOP[10, 11] # COOP value between the 11th and 12th orbital >>> COOP.sum(1).A[tbt.o_dev, 0] == tbt.DOS(sum=False)[tbt.Eindex(-1.0)] >>> D = COOP.diagonal().sum() >>> DBCOOP = COOP / D
See also
atom_COOP
atomic COOP analysis of the Green function
orbital_ACOOP
orbital resolved COOP analysis of the spectral function
atom_ACOOP
atomic COOP analysis of the spectral function
orbital_COHP
orbital resolved COHP analysis of the Green function
atom_COHP
atomic COHP analysis of the Green function
orbital_ACOHP
orbital resolved COHP analysis of the spectral function
atom_ACOHP
atomic COHP analysis of the spectral function
- orbital_current(elec=0, elec_other=1, kavg=True, isc=None, what='all', orbitals=None)[source]
Orbital current originating from elec as a sparse matrix
This is the bias window integrated quantity of
orbital_transmission
. As such it represents how the current is flowing at an applied bias from a given electrode.with
being the electronic temperature of the respective reservoir.- Parameters:
elec_other (str | int) – this electrode determines the other chemical potential. As such the orbital currents does not reflect the current going from elec to elec_other!
kavg (
bool
,int
, optional) – whether the returned orbital current is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned bond currents from the unit-cell ([None, None, None]
) to the given supercell, the default is all orbital currents for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.what (
{"all"/"both"/"+-"/"inout", "+"/"out", "-"/"in"}
) – which orbital currents to return, all, positive (outgoing) or negative (incoming). Default to"all"
because it can then be used in the subsequent default arguments forsparse_orbital_to_atom
andsparse_orbital_to_scalar
.orbitals (
ndarray
ordict
, optional) – only retain orbital currents for a subset of orbitals.
- Return type:
Notes
Calculating the current between two electrodes with the same chemical potential will return a matrix filled with 0’s since there is no bias window.
The currents does not reflect the current going from elec_from to elec_other!
See also
orbital_transmission
energy resolved transmission between orbitals
bond_transmission
energy resolved transmissions between atoms
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- orbital_transmission(E, elec=0, kavg=True, isc=None, what='all', orbitals=None)[source]
Transmission at energy
E
between orbitals originating from elecEach matrix element of the sparse matrix corresponds to the orbital indices of the underlying geometry (including buffer and electrode atoms).
When requesting orbital-transmissions it is vital to consider how the data needs to be analysed before extracting the data. For instance, if only local transmission pathways are interesting one should use
what="+"
to retain the positive orbital transmissions. While if one is interested in the transmission between subset of orbitals,what="all"
is the correct method to account for loop transmissions.The orbital transmissions are calculated as described in the TBtrans manual:
It is easy to show that the above matrix obeys
.For inexperienced users it is adviced to try out all three values of
what
to ensure the correct physics is obtained.This becomes even more important when the orbital transmissions are calculated with magnetic fields. With
fields local transmission loops may form and the pathways does not necessarily flow along the transport direction.For correct interpretation of the orbital transmissions it is vital that one integrates the full Brillouin zone without any symmetry operations, see Section 5.4 in [10].
- Parameters:
E (str | float) – the orbital transmission corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned orbital transmission is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned transmissions from the unit-cell ([None, None, None]
) to the given supercell, the default is all transmissions for the supercell. To only get unit cell transmissions, pass[0, 0, 0]
.what (
{"all"/"both"/"+-"/"inout", "+"/"out", "-"/"in"}
) – which transmissions to return, all, positive (outgoing) or negative (incoming).orbitals (
ndarray
ordict
, optional) – only retain transmissions for a subset of orbitals (including their supercell equivalents)
- Returns:
A `scipy.sparse.csr_matrix
containing the supercell transmission pathways`,or
orbital transmissions.
- Return type:
Examples
>>> Jij = tbt.orbital_transmission(-1.0) # orbital current @ E = -1 eV originating from electrode ``0`` >>> Jij[10, 11] # orbital transmission from the 11th to the 12th orbital
>>> Jij = tbt.orbital_transmission(-1.0, ... orbitals={tbt.geometry.atoms[0]: [0, 1]})
only retain transmissions from 1st and 2nd orbitals on first atom type (all atoms of that type in the entire structure.
See also
orbital_current
bias window integrated transmissions
bond_transmission
energy resolved transmissions between atoms
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- pivot(elec=None, in_device=False, sort=False)
Return the pivoting indices for a specific electrode (in the device region) or the device
- Parameters:
elec (int | str | None) – Can be None, to specify the device region pivot indices (default). Otherwise, it corresponds to the pivoting indicies in the downfolding region.
in_device (bool) – If
True
the pivoting table will be translated to the device region orbitals. If sort is also true, this would correspond to the orbitals directly translated to the geometryself.geometry.sub(self.a_dev)
.sort (bool) – Whether the returned indices are sorted. Mostly useful if you want to handle the device in a non-pivoted order.
Examples
>>> se = tbtncSileTBtrans(...) >>> 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]
See also
pivot_down
for the pivot table for electrodes down-folding regions
- pivot_down(elec)
Pivoting orbitals for the downfolding region of a given electrode
- plot.geometry(*args, data_kwargs={}, axes=['x', 'y', 'z'], atoms=None, atoms_style=[], atoms_scale=1.0, atoms_colorscale=None, drawing_mode=None, bind_bonds_to_ats=True, points_per_bond=20, bonds_style={}, bonds_scale=1.0, bonds_colorscale=None, show_atoms=True, show_bonds=True, show_cell='box', cell_style={}, nsc=(1, 1, 1), atoms_ndim_scale=(16, 16, 1), bonds_ndim_scale=(1, 1, 10), dataaxis_1d=None, arrows=(), backend='plotly')
Calls
read_geometry
and creates aGeometryPlot
from its output.- Parameters:
axes (Axes) – The axes to project the geometry to.
atoms (AtomsIndex) – The atoms to plot. If None, all atoms are plotted.
atoms_style (Sequence[AtomsStyleSpec]) – List of style specifications for the atoms. See the showcase notebooks for examples.
atoms_scale (float) – Scaling factor for the size of all atoms.
atoms_colorscale (Optional[Colorscale]) – Colorscale to use for the atoms in case the color attribute is an array of values. If None, the default colorscale is used for each backend.
drawing_mode (Literal['scatter', 'balls', None]) – The method used to draw the atoms.
bind_bonds_to_ats (bool) – Whether to display only bonds between atoms that are being displayed.
points_per_bond (int) – When the points are drawn using points instead of lines (e.g. in some frameworks to draw multicolor bonds), the number of points used per bond.
bonds_style (StyleSpec) – Style specification for the bonds. See the showcase notebooks for examples.
bonds_scale (float) – Scaling factor for the width of all bonds.
bonds_colorscale (Optional[Colorscale]) – Colorscale to use for the bonds in case the color attribute is an array of values. If None, the default colorscale is used for each backend.
show_atoms (bool) – Whether to display the atoms.
show_bonds (bool) – Whether to display the bonds.
show_cell (Literal['box', 'axes', False]) – Mode to display the cell. If False, the cell is not displayed.
cell_style (StyleSpec) – Style specification for the cell. See the showcase notebooks for examples.
nsc (tuple[int, int, int]) – Number of unit cells to display in each direction.
atoms_ndim_scale (tuple[float, float, float]) – Scaling factor for the size of the atoms for different dimensionalities (1D, 2D, 3D).
bonds_ndim_scale (tuple[float, float, float]) – Scaling factor for the width of the bonds for different dimensionalities (1D, 2D, 3D).
dataaxis_1d (Optional[Union[np.ndarray, Callable]]) – Only meaningful for 1D plots. The data to plot on the Y axis.
arrows (Sequence[AtomArrowSpec]) – List of arrow specifications to display. See the showcase notebooks for examples.
backend – The backend to use to generate the figure.
- Return type:
See also
GeometryPlot
The plot class used to generate the plot.
read_geometry
The method called to get the data.
- plot.pdos(geometry=None, elec=None, *, groups=[{'name': 'DOS'}], Erange=(-2, 2), E_axis='x', line_mode='line', line_scale=1.0, backend='plotly')
Creates a
PDOSData
object and then plots aPdosPlot
from it.- Parameters:
geometry (Geometry | None) – Full geometry of the system (including scattering and electrode regions). Right now only used to get the basis of each atom, which is not stored in the TBT.nc file.
elec (int | str | None) – which electrode to get the PDOS from. Can be None for the Green function, otherwise the specified. Otherwise it is the index/name of an electrode so that one gets the ADOS from that electrode.
groups (Sequence[OrbitalStyleQuery]) – List of orbital specifications to filter and accumulate the PDOS. The contribution of each group will be displayed in a different line. See showcase notebook for examples.
E_axis (Literal['x', 'y']) – Axis to project the energies.
line_mode (Literal['line', 'scatter', 'area_line']) – Mode used to draw the PDOS lines.
line_scale (float) – Scaling factor for the width of all lines.
backend (str) – The backend to generate the figure.
- Return type:
See also
PdosPlot
The plot class used to generate the plot.
PDOSData
The class to which data is converted.
- read(*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_brillouinzone()
Returns a BrillouinZone object with the k-points associated
- Return type:
- read_data(*args, **kwargs)[source]
Read specific type of data.
This is a generic routine for reading different parts of the data-file.
- Parameters:
geometry (
bool
, optional) – return the geometryvector_transmission (
bool
, optional) – return the bond transmissions as vectorsvector_current (
bool
, optional) – return the bond currents as vectorsatom_transmission (
bool
, optional) – return the atomic transmission flowing through an atom (the activity current)atom_current (
bool
, optional) – return the atomic current flowing through an atom (the activity current)
- read_geometry(*args, **kwargs)
Returns Geometry object from this file
- reflection(elec=0, kavg=True, from_single=False)[source]
Reflection into electrode elec
The reflection into electrode elec is calculated as:
Another way of calculating the reflection is via:
Both are identical, however, numerically they may be different. Particularly when the bulk transmission is very large compared to the transmission to the other electrodes one should prefer the first equation.
- Parameters:
- Return type:
See also
transmission
the total transmission
transmission_eig
the transmission decomposed in eigenchannels
transmission_bulk
the total transmission in a periodic lead
- shot_noise(elec_from=0, elec_to=1, classical=False, kavg=True)[source]
Shot-noise term from to to using the k-weights
Calculates the shot-noise term according to classical (also known as the Poisson value). If classical is True the shot-noise calculated is:
while for classical False (default) the Fermi-Dirac statistics is taken into account:
- Raises:
SislInfo – If all of the calculated
values in the file are above 0.001.- Parameters:
- Return type:
See also
fano
the ratio between the quantum mechanial and the classical shot noise.
noise_power
temperature dependent noise power
- sparse_atom_to_vector(Dab)[source]
Reduce an atomic sparse matrix to a vector contribution of each atom
Notes
This routine may be moved to a
sisl.utility
at some point since it would be a generic routine usable for other parts ofsisl
.- Parameters:
Dab (
scipy.sparse.csr_matrix
) – the input sparse matrix in atomic indices- Return type:
- sparse_orbital_to_atom(Dij, uc=False, sum_dup=True)[source]
Reduce a sparse matrix in orbital sparse to a sparse matrix in atomic indices
This algorithm may keep the same non-zero entries, but will return a new csr_matrix with duplicate indices.
Notes
This routine may be moved to a
sisl.utility
at some point since it would be a generic routine usable for other parts ofsisl
.- Parameters:
Dij (
scipy.sparse.csr_matrix
) – the input sparse matrix in orbital formatuc (bool) – whether the returned data are only in the unit-cell. If
True
this will return a sparse matrix ofshape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.sum_dup (bool) – duplicates will be summed if this is true, in this case, no duplicates are present in the returned sparse matrix. If false, duplicates may exist for multi-orbital systems.
- Return type:
- sparse_orbital_to_scalar(Dij, activity=True)[source]
Atomic scalar contribution of atoms for a sparse orbital matrix
The atomic contribution is a single number specifying a figure of the magnitude of sparse matrix elements for each atom. It is thus not a quantity that can be related to any physical quantity that the sparse matrix may represent but is merely a number that provides an idea of how much this atom is governing the data in the matrix.
The atomic contribution may have two meanings based on these two equations
If the activity is requested (
activity=True
) is returned.If
activity=False
is returned.For geometries with all atoms only having 1-orbital, they are equivalent.
- Parameters:
Dij (
scipy.sparse.csr_matrix
) – the orbital sparse matrix.activity (bool) –
True
to return the atomic activity, see explanation above
- Return type:
Notes
This routine may be moved to a
sisl.utility
at some point since it would be a generic routine usable for other parts ofsisl
.Examples
>>> Jij = tbt.orbital_current(0, -1.03, what="both") # orbital current @ E = -1 eV originating from electrode ``0`` >>> Ja = tbt.sparse_orbital_to_scalar(Jij)
- sparse_orbital_to_vector(Dij, uc=False, sum_dup=True)[source]
Reduce an orbital sparse matrix to a vector contribution of each atom
Equivalent to calling
sparse_orbital_to_atom
andsparse_atom_to_vector
.Notes
This routine may be moved to a
sisl.utility
at some point since it would be a generic routine usable for other parts ofsisl
.- Parameters:
Dij (
scipy.sparse.csr_matrix
) – the input sparse matrixuc (bool) – whether the returned data are only in the unit-cell. If
True
this will return a sparse matrix ofshape = (self.na, self.na)
, else, it will return a sparse matrix ofshape = (self.na, self.na * self.n_s)
. One may figure out the connections viasc_index
.sum_dup (bool) – duplicates will be summed if this is true, in this case, no duplicates are present in the returned sparse matrix. If false, duplicates may exist for multi-orbital systems.
- Return type:
- transmission(elec_from=0, elec_to=1, kavg=True)[source]
Transmission from elec_from to elec_to.
The transmission between two electrodes may be retrieved from the Sile.
The transmission is calculated as:
where all quantities are energy dependent.
- Parameters:
- Return type:
See also
transmission_eig
the transmission decomposed in eigenchannels
transmission_bulk
the total transmission in a periodic lead
reflection
total reflection back into the electrode
- transmission_bulk(elec=0, kavg=True)[source]
Bulk transmission for the elec electrode
The bulk transmission is equivalent to creating a 2 terminal device with electrode elec tiled 3 times.
- Parameters:
- Return type:
See also
transmission
the total transmission
transmission_eig
the transmission decomposed in eigenchannels
reflection
total reflection back into the electrode
- transmission_eig(elec_from=0, elec_to=1, kavg=True)[source]
Transmission eigenvalues from elec_from to elec_to.
- Parameters:
- Return type:
See also
transmission
the total transmission
transmission_bulk
the total transmission in a periodic lead
- vector_current(elec=0, elec_other=1, kavg=True, isc=None, what='all', orbitals=None)[source]
Vector for each atom being the sum of bond currents times the normalized bond vector between the atoms
The vector current is defined as:
Where
is the bond current between atom and and are the atomic coordinates.- Parameters:
elec_other (str | int) – this electrode determines the other chemical potential. As such the vector currents does not reflect the current going from elec to elec_other!
kavg (
bool
,int
, optional) – whether the returned vector current is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned currents from the unit-cell ([None, None, None]
) to the given supercell, the default is all currents for the supercell. To only get unit cell orbital currents, pass[0, 0, 0]
.what (
{"all"/"both"/"+-"/"inout", "+"/"out", "-"/"in"}
) – The outgoing currents may be retrieved by"out"
. The incoming currents may be retrieved by"in"
, while the average incoming and outgoing direction can be obtained with"both"
. In the last case the vector currents are divided by 2 to ensure the length of the vector is compatible with the other options given a pristine system.orbitals (
ndarray
ordict
, optional) – only retain currents for a subset of orbitals before calculating currents Passed directly toorbital_current
.
- Return type:
Notes
Calculating the current between two electrodes with the same chemical potential will return a matrix filled with 0’s since there is no bias window.
The currents does not reflect the current going from elec_from to elec_other!
- Returns:
array of vectors per atom in the Geometry (only non-zero for device atoms)
- Return type:
- Parameters:
See also
orbital_transmission
energy resolved transmission between orbitals
orbital_current
bias window integrated transmissions
bond_transmission
energy resolved transmissions between atoms
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_transmission
an atomic field transmission for each atom (Cartesian representation of bond-transmissions)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- vector_transmission(E, elec=0, kavg=True, isc=None, what='all', orbitals=None)[source]
Vector for each atom being the sum of bond transmissions times the normalized bond vector between the atoms
The vector transmission is defined as:
Where
is the bond transmission between atom and and are the atomic coordinates.- Parameters:
E (str | float) – the vector transmission corresponding to the energy.
kavg (
bool
,int
, optional) – whether the returned vector transmission is k-averaged, or an explicit (unweighed) k-point is returnedisc (
ndarray
, optional) – the returned vectors from the unit-cell ([None, None, None]
) to the given supercell, the default is all vectors for the supercell. To only get unit cell vectors, pass[0, 0, 0]
.what (
{"all"/"both"/"+-"/"inout", "+"/"out", "-"/"in"}
) – The outgoing vectors may be retrieved by"out"
. The incoming vectors may be retrieved by"in"
, while the average incoming and outgoing direction can be obtained with"both"
. In the last case the vector transmissions are divided by 2 to ensure the length of the vector is compatible with the other options; given a pristine system.orbitals (
ndarray
ordict
, optional) – only retain transmissions for a subset of orbitals before calculating bond transmissions Passed directly toorbital_transmission
.
- Returns:
array of vectors per atom in the Geometry (only non-zero for device atoms)
- Return type:
See also
orbital_transmission
energy resolved transmission between orbitals
orbital_current
bias window integrated transmissions
bond_transmission
energy resolved transmissions between atoms
bond_current
bias window integrated transmissions (orbital current summed over orbitals)
vector_current
an atomic field current for each atom (Cartesian representation of bond-currents)
atom_transmission
energy resolved atomic transmission for each atom (scalar representation of bond-transmissions)
atom_current
the atomic current for each atom (scalar representation of bond-currents)
- write(*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_tbtav(*args, **kwargs)[source]
Convert this to a TBT.AV.nc file, i.e. all k dependent quantites are averaged out.
This command will overwrite any previous file with the ending TBT.AV.nc and thus will not take notice of any older files.
- Parameters:
file (
str
) – output filename
- property a_buf
Atomic indices (0-based) of device atoms
- property a_dev
Atomic indices (0-based) of device atoms (sorted)
- property base_file
File of the current Sile
- property elecs
List of electrodes
- property file
File of the current Sile
- property o_dev
Orbital indices (0-based) of device orbitals (sorted)
See also
pivot
retrieve the device orbitals, non-sorted
- plot
Plotting functions for the
tbtncSileTBtrans
class.