sisl.io.tbtrans.tbtsencSileTBtrans
- class sisl.io.tbtrans.tbtsencSileTBtrans
Bases:
_devncSileTBtransTBtrans self-energy file object with downfolded self-energies to the device region
The \(\boldsymbol\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 >>> Hfull1[pvt_unsorted, pvt_unsorted.T] -= se_unsorted[:, :] >>> Hfull2[pvt_sorted, pvt_sorted.T] -= se_sorted[:, :] >>> np.allclose(Hfull1, Hfull2) True >>> # Query the indices in the device Hamiltonian >>> dev_pvt = se.pivot('Left', in_device=True).reshape(-1, 1) >>> dev_unpvt = se.pivot('Left', in_device=True, sort=True).reshape(-1, 1) >>> Hdev_pvt[dev_pvt, dev_pvt.T] -= se_unsorted[:, :] >>> Hdev[dpvt_sorted, dpvt_sorted.T] -= se_sorted[:, :] >>> pvt_dev = se.pivot(in_device=True).reshape(-1, 1) >>> np.allclose(Hdev_pvt, Hdev[pvt_dev, pvt_dev.T]) True
Plotting
Plotting functions for the
tbtsencSileTBtransclass.plot.geometry(*args[, ...])Calls
read_geometryand creates aGeometryPlotfrom its output.Methods
Eindex(E[, method])Return the closest energy index corresponding to the energy
Ea2p(atoms)Return the pivoting orbital indices (0-based) for the atoms, possibly on an electrode
a_down(elec)Down-folding atomic indices for a given electrode
a_elec(elec)Electrode atomic indices for the full geometry (sorted)
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
broadening_matrix(elec, E[, k, sort])Return the broadening matrix from the electrode elec
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()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
info([elec])Information about the self-energy file 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 the electrode occupies in the downfolded device region
no_down(elec)Number of orbitals in the downfolding region (including device downfolded region)
no_e(elec)Number of orbitals the electrode occupies in the downfolded device region
o2p(orbitals[, elec])Return the pivoting indices (0-based) for the orbitals, possibly on an electrode
pivot([elec, in_device, sort])Return the pivoting indices for a specific electrode (in the device region) or the device
pivot_down(elec[, in_down])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_geometry(*args, **kwargs)Returns Geometry object from this file
Returns Lattice object from this file
self_energy(elec, E[, k, sort])Return the self-energy from the electrode elec
self_energy_average(elec, E[, sort])Return the k-averaged average self-energy from the electrode elec
write(*args, **kwargs)Generic write method which should be overloaded in child-classes
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
The 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
- 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, all=True))
Will warn if an atom requested is not in the device list of atoms.
- a_down(elec)
Down-folding atomic indices for a given electrode
- a_elec(elec)
Electrode atomic indices for the full geometry (sorted)
- 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
- broadening_matrix(elec, E, k=0, sort=False)[source]
Return the broadening matrix from the electrode elec
The broadening matrix is calculated as:
\[\boldsymbol \Gamma(E) = i [\boldsymbol\Sigma(E) - \boldsymbol\Sigma^\dagger(E)]\]- Parameters:
elec (
strorint) – the corresponding electrode to return the broadening matrix fromE (float) – energy to retrieve the self-energy at. The closest energy point will be chosen.
k (int | Sequence[float]) – k-point to retrieve, if an integer it is the k-index in the file
sort (bool) – if
Truethe returned broadening matrix will be sorted according to the order of the orbitals in the non-pivoted geometry, otherwise the broadening matrix will be returned according to the pivoted orbitals in the device region.
- Return type:
- 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()
- 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
- info(elec=None)[source]
Information about the self-energy file 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
DatasetThe 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 torootvariable, 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_temperaturebath 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 the electrode occupies in the downfolded device region
- no_down(elec)
Number of orbitals in the downfolding region (including device downfolded region)
- no_e(elec)
Number of orbitals the electrode occupies in the downfolded device region
- 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.
- 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
Truethe 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_downfor the pivot table for electrodes down-folding regions
- pivot_down(elec, in_down=False)
Pivoting orbitals for the downfolding region of a given electrode
This pivoting table includes the electrode + the downfolding region + the resulting orbitals in the device region.
Essentially this is equivalent to (but not in the same order): >>> pvt = tbt.geometry.a2o(tbt.a_down(elec), all=True) >>> pvt_down = np.append(pvt, tbt.pivot(elec))
- Parameters:
Notes
This does not correspond to the atoms of the downfolding region from the atomic indices:
>>> tbt.pivot_down("Left") != tbt.geometry.a2o(tbt.a_down("Left"), all=True)
The point for this is that
pivot_downis not guaranteed to fully encapsulate all orbitals of the atoms in the device region.
- 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_geometryand creates aGeometryPlotfrom 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
GeometryPlotThe plot class used to generate the plot.
read_geometryThe method called to get the data.
- 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**kwargsas arguments.
- read_brillouinzone()
Returns a BrillouinZone object with the k-points associated
- Return type:
- read_geometry(*args, **kwargs)
Returns Geometry object from this file
- self_energy(elec, E, k=0, sort=False)[source]
Return the self-energy from the electrode elec
- Parameters:
elec (
strorint) – the corresponding electrode to return the self-energy fromE (float) – energy to retrieve the self-energy at. The closest energy point will be chosen.
k (int | Sequence[float]) – k-point to retrieve, if an integer it is the k-index in the file
sort (bool) – if
Truethe returned self-energy will be sorted according to the order of the orbitals in the non-pivoted geometry, otherwise the self-energy will be returned according to the pivoted orbitals in the device region.
- Return type:
- self_energy_average(elec, E, sort=False)[source]
Return the k-averaged average self-energy from the electrode elec
- Parameters:
elec (
strorint) – the corresponding electrode to return the self-energy fromE (float) – energy to retrieve the self-energy at. The closest energy point will be chosen.
sort (bool) – if
Truethe returned self-energy will be sorted according to the order of the orbitals in the non-pivoted geometry, otherwise the self-energy will be returned according to the pivoted orbitals in the device region.
- 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
**kwargsas arguments.
- 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
pivotretrieve the device orbitals, non-sorted
- plot
Plotting functions for the
tbtsencSileTBtransclass.