Package: tinie
Transport In a Non-Interacting Equilibrium simulation framework (TINIE)OverviewWe present to you a code that calculates conductance and electric
current running through 2D cavities, quantum dots or potential wells
with arbitrarily placed reservoirs in a perpendicular and constant
magnetic field. The code can be used in a wide range of calculations
involving 2D electron transport. The main difference between this code
and its competitors is the fact that TINIE does not need to be provided
with free parameters. The code is parallelized withmpi4py, allowing
for computational tasks distribution across multiple processors.InstallationThe code is a Python package (written using Python 3.6). In non-parallel
simulations,tiniecan function without MPI-support in theHDF5-library, but parallel simulations require theHDF5library
and its Python-wrapperh5pyto be built with MPI support (seeParallel HDF5 – h5py
documentationfor
installation instructions).tiniecan be installed withpip:$pipinstalltinietinieinstalls a command line interface toolset, and you can test
the functionality with the following commands:$tinie_prepare$tinieThorough test suite for the package has been implemented and can be
launched viapython3 setup.py testfrom the root of the git
repository.Package FunctionalityThis package contains tools that could be used to calculate coupling of
a specific system that contains a central region (2DEG) and some leads.
After the coupling is calculated one could proceed to calculate
transmission coefficients and partial currents in the leads. All the
calculations are performed in Hartee atomic units. After installing the
package, a simple test run can be launched as follows:$tinie_prepare$tiniePackage StructureThe code is written using object-oriented programming, and its
functionality can be shortly described in the following way: first,Lead, andCenterobjects are created and passed as inputs for
theCouplingobject and then all of them are passed into aSystemDumpobject, which calculates all the couplings and
Hamiltonians and dumps the data into an hdf5 file.SystemFetchis
then used to read the data from that hdf5 file. That data is passed into
theCalculatorinterface, whereSelfEnergyinterface calculates
the self-energiesand rate operatorsusing theCouplingand the
eigenenergies of theLead.After that,SelfEnergyfor all the leads and the eigenenergies of
theCenterare passed into theGreenFunctioninterface that
evaluates the advanced () and retarded
() Green’s functions, finalizing the
initialization of theCalculator. From there the code is able to
compute the transmission matrixand the partial currentsin the lead, whereis the Fermi-Dirac energy
distribution. Furthermore, it is then possible to compute other
transport properties, such as conductance at a specific temperature.
Additionally, we include the possibility of computing density of states
and local density of states.Modular structure of the code allows for the implementation of your own
custom type of conducting channel (“lead”), quantum dot (“central
region”) and coupling via implementation of a class that inherits fromLead,CenterorCoupling. The details of how exactly the
classes should be implemented will be explained in the sections to
follow.Example: Usage of TINIE with ITP2DTo better demonstrate how TINIE is used, we will show it by means of an
example problem. We will compute transport properties of a quantum-dot
system with two leads in a magnetic field. Specifically, we shall
procure the information about the central region from ITP2D, a
Schrödinger equation eigensolver that interfaces with TINIE. The
following workflow is typical for most transport problems solved with
TINIE:Step 0:computation of the Hamiltonian and wavefunctions of the
central region. We may obtain this information from any eigensolver of
our choosing, provided that it is TINIE-compatible. Quantum dot may be
modeled by a radial harmonic potential of form. Solving the first
25 states of this model with magnetic field strengthis
done in ITP2D as follows:$itp2d-v-n20-l12-s100-p"harmonic(1)"-B1.0-oITP2D_FILE_PATHHere the central region occupies aregion in both x-and y-directions
and is centered at the origin. More information about
usage of ITP2D can be found on itsbitbucket
page.Step 1:the transport system preparation step. In this step, the
coupling matrices for the leads are computed. Suppose we wish to compute
overlap coupling between the central region and the leads and we want to
vary the probe energy within each lead in rangewith
energy spacing of. In this case, the first 5
states of the central region are sufficient for the calculation. Our
leads are such that:Lead 0 is confined to regionin x-direction,in y-direction and connects to the lead from the left;Lead 1 is confined to regionin x-direction,in y-direction
and connects to the lead from the right.Both leads in this case have harmonic potential of strengthin y-direction, and particle-in-a-box
potential in x-direction. This information is sufficient for
us to commence the system preparation. For that,tinie_preparescript is used as follows:$tinie_prepare-dE1e-3-B1.0-ctr"itp2d(ITP2D_FILE_PATH,(0,4))"-l2-ld"finharm(left,1.0,dir)""finharm(right,1.0,dir)"-xlim"[-10.0,-4.0]""[4.0,10.0]"-ylim"[-5.0,5.0]""[-5.0,5.0]"-Elim"[0.0,2.0]""[0.0,2.0]"-cpl"overlap()""overlap()"-oTINIE_PREPARE_FILE_PATHThis produces the PREPTINIEFile that contains the information about the
coupling of the transport system which can be reused for different
transport calculations of the next step.Step 2:the transport calculation step. This is where the real fun
begins, the steps before are in a sense just a preparation. To compute
various transport properties of the system, such as transmission,
conductance and current, we fix temperature of the system, chemical potentialand fix bias
voltages in the leads to bein Lead 0 and. Moreover, we adjust the energy spacing of probe
electrons toand set the Green’s function
boundary parameter to. With this information we can
usetiniescript as follows:$tinie-iTINIE_PREPARE_FILE_PATH-dw1e-2-eta1e-1-T1.0-mu1.0-V0.51.5-oTINIE_FILE_PATHThis produces the TINIEFile that contains all the above mentioned
transport quantities and more, with detailed description of its contents
outlined in the sections below.In addition to the transport properties, we can compute local and
standard density of states (LDOS/DOS) of the system via thetinie_dosscript. To that end, in addition to the parameters
specified above, user would want to specify the energies at which LDOS
should be evaluated, as well as the location of the file with the
central region wavefunctions. We then use the script as follows:$tinie_dos-iTINIE_PREPARE_FILE_PATH-psiITP2D_FILE_PATH--wf-range04-w1.02.03.0-dw1e-2-eta1e-1-T1.0-mu1.0-V0.51.5-oTINIE_DOS_FILE_PATHHere, we evaluated LDOS at probe energies. Results of this calculation are
stored in TINIEDOSFile, with details about its contents available in
sections below.Step 3:visualizing the results. To that end, one can use thetinie_drawscript. Suppose we want to plot transmission,
conductance, total current and DOS of the system in the energy range, as well as LDOS at probe energy. We then use the following command:$tinie_draw-iTINIE_FILE_PATH-idosTINIE_DOS_FILE_PATH-E0.05.0--ldos-E1.0--transmission--conductance--total-currents--dos--ldos-oFIGURE_PATHThis will produce beautiful LaTeX-rendered plots of the aforementioned
quantities. Below we show the example plots of conductance, DOS and LDOS
produced by the script:ConductanceDOSLDOSQuantum transport calculations in two-dimensional systems have never been this easy!Currently Implemented System ClassesAs of now, the following system classes are implemented:Centerobjects, located intransport_calculator/systems/central_regionItp2dCenter: itp2d-compatible interface.CustomCenter: container for a custom predefined central region Hamiltonian.Leadobjects, located intransport_calculator/systems/leads. Note that wavefunction normalization has been omitted for the sake of compactness of the expression. Wavefunctions in the code are all normalized.FiniteHarmonicLead: lead described by a wavefunction, whereis the the Hermite polynomial of order l,,,withbeing the frequency of quantum harmonic oscillator andbeing magnetic field strength. The formula is provided in Hartee atomic units. x and y coordinate wavefunctions are interchangeable depending on the lead alignment.BoxLead: particle in a box lead describe by wavefunctionwhereandare the length and width of the box correspondingly and.CustomLead: container for a custom predefined lead region HamiltonianCouplingobjects, located intransport_calculator/systems/couplingsOverlapCoupling: strong coupling of the type, whereis the ith eigenfunction of the lead ands the  jth eigenfunction of the central region andis the overlap region of the lead and the quantum-dot.TightBindingCoupling: weak coupling between non-overlapping lead and central regions of the typewhere,is the lead region to be coupled andis the central region to be coupled.OneLayerCoupling: weak coupling between the boundaries of a non-overlapping lead and central regions of the type.CustomCoupling: container for custom predefined coupling matrix. Compatible only withCustomCenterandCustomLeadobjects.The implementational details of these elements can be checked in the source code, which is rich with insightful and
helpful comments.Adding Your Own Custom System ClassesAs it has been mentioned before, the code has been designed in such a
way as to allow as much freedom in expansion as possible. In particular,
you can introduce additional types of central regions, lead regions and
coupling methods. All you have to do is to create your own class file in
the corresponding folder intinie/systemsand make sure that the
class you are creating inherits from one of the basic abstract classes
(Center,LeadorCoupling). Below you can find a list of
functions you would have to implement (correctly) in order for your
custom class to be fully integrated into the transport scheme:Centerregion:__init__(*attrs): initializerget_type_specific_parameters(): retrieves child-specific extra
parametersget_energies(): retrieves central region Hamiltonianget_potential(): retrieves potential energy values in the
central regionget_state(n): retrieves nth wavefunctionget_states(): retrieves all wavefunctions on the gridget_number_of_states(): retrieves the number of states in the
central regionget_sliced_state(n, width, side): retrieves nth
wavefunction on a grid sliceget_sliced_states(width, side): retrieves all wavefunctions on
a grid sliceget_boundary_state(n, side): retrieves nth wavefunction
evaluated on some boundaryget_coordinate_ranges(): retrieves x and y coordinate rangesget_coordinates(): retrieves the coordinate meshesget_slice_coordinates(width, side): retrieves the sliced
coordinate meshesget_boundary_coordinates(side): retrieves the boundary
coordinate rangeLeadregion:__init__(*attrs): initializerset_magnetic_field_strength(B): sets magnetic field strengthset_energy_spacing(delta_E): sets lead energy spacingget_type_specific_parameters(): retrieves child-specific extra
parametersget_energies(): retrieves lead region Hamiltonianget_state_point(x, y, n): evaluates the nth state
wavefunction at a single pointget_state(x_points, y_points, n, mode): retrieves the nth state wavefunction on a custom/discretized gridget_number_of_states(): retrieves the number of states in the
lead regionget_boundary_state(n, num_boundary_points): retrieves
nth wavefunction evaluated on the lead boundaryget_boundary(num_boundary_points): retrieves the boundary grid
with specified discretizationCouplingregion:__init__(Center_object, Lead_object, *attrs): initializer,
sets the center and lead objects ready for the coupling matrix
calculationsget_coupling_matrix_element(i, j): retrieves coupling matrix
element, that is, the coupling between
ith lead state and jth central stateget_coupling_matrix(): retrieves the coupling matrixDetails about the input/output parameter types can be found in the
source code. Upon implementing all of these functions correctly for the
corresponding custom object and extending the parser interface
accordingly, the code extension will be fully consistent with the
original code!Scripts Included in the Packagetinie includes a few scripts that should ease the usage of the software:tinie_prepareThis script prepares the coupling system and saves it in atinie_preparehdf5 file, which contains the following attributes and datasets:AttributeDescriptiontypeFile type, must be “PREPTINIEFile”center/typeType of the central regioncenter/num_statesNumber of states in the central
regioncenter/parametersType-dependent parameters of the
central regionleads/num_leadsNumber of leadsleads/lead_n/typeType of the lead nleads/lead_n/num_statesNumber of states in lead nleads/lead_n/energy_spacingEnergy spacing in lead nleads/lead_n/parametersType-dependent parameters of lead ncouplings/num_couplingsNumber of couplingscouplings/coupling_n/typeType of coupling between lead
n and the central regionDatasetDescriptioncenter/hamiltonianHamiltonian of the central regioncenter/potentialPotential energy values in the central regionleads/lead_n/hamiltonianHamiltonian of the lead region nleads/lead_n/x_axis_limitsx-axis limits of lead nleads/lead_n/y_axis_limitsy-axis limits of lead nleads/lead_n/energy_limitsEnergy limits of lead ncouplings/coupling_n/coupling_matrixCoupling matrix between lead n and the central regionSome of these datasets are stored in chunked/compressed format for more
data-intensive simulations. All the simulation parameters are adjusted
via a parser user interface, which takes the following arguments (typetinie_prepare--helpif you ever feel lost!):ArgumentDescription-dE,--delta-ELead energy spacing-BMagnetic field strength-xlim,--x-axis-limitsx-axis limits of each lead, typed in form[x_min_0, x_max_0] [x_min_1, x_max_1] ...-ylim`--y-axis-limitsy-axis limits of each lead, typed in form[y_min_0, y_max_0] [y_min_1, y_max_1] ...-Elim--energy-limitsEnergy limits of each lead, typed in form[E_min_0, E_max_0] [E_min_1, E_max_1] ...-ctr--center-typeCentral region type, typed in as"ctr_type(*ctr_params)"-l--lead-numberNumber of leads-ld--lead-typesLead region types, typed in form"ld0_type(*ld0_params)""ld1_type(*ld1_params)"...-cpl```--coupling-typesCoupling region types, typed in form"cpl0_type(*cpl0_params)""cpl1_type(*cpl1_params)"...-o,--output-filePath, where preptinie file is savedtinieThis script reads the preptinie hdf5 file, performs the transport
calculation and saves the results in a tinie hdf5 with the following
attributes and datasets:AttributeDescriptiontypeFile type, must be “TINIEfile”evaluated_chemical_potentialChemical potentialof the systemevaluated_bias_voltageBias voltage in the leads of the systemevaluated_temperatureTemperature of the systemomega_spacingProbe energy spacinglead_energy_spacingLead energy spacingetaSmall numberused in the Green’s functionnumber_of_couplingsNumber of couplings in the systemDatasetDescriptionpartial_currentsMatrix of partial currents between each leadtotal_currentsTotal currents in each leadomega_dependent_partial_currentsEnergy profile of the partial current matrixomega_ldos_dependent_total_currentsEnergy profile of the total currentstransmissionTransmission matrix as a function of the probe energytransmission_errorImaginary component of transmissionconductanceSystem conductance matrixSome of these datasets are stored in chunked/compressed format for more
data-intensive simulations. All the transport calculation parameters are
adjusted via a parser user interface, which takes the following
arguments (typetinie--helpif you ever feel lost!):ArgumentDescription-dw`,``--delta-omegaProbe energy spacing-etaSmall imaginary constant used in calculating Green’s function--mu,--chem-potChemical potential at which the system is evaluated-V,--lead-biasLead biases, at which the system is evaluated, typed in formV_0 V_1 ...-T,--temperatureTemperature at which the system is evaluated-i,--input-filePath to thetinie_prepare’s output file-o,--output-filePath for the output file--wide-band,--no-wide-bandBoolean flags user can specify if they wish to use the wide band approximation methods (or not)-S,--self-energyPath from which an array of custom self energies is read-G,--rate-operatorPath from which an array of custom rate operators is readNote that if you wish to use the wide band approximation approach you
must specify either self energies or rate operators or both!tinie_dosThis scripts reads the preptinie hdf5 file and the file containing the
eigenfunctions of the central region, computes DOS/LDOS and saves the
results in dostinie hdf5 file with the following attributes and
datasets:AttributeDescriptiontypeFile type, must be “TINIEDOSFile”DatasetDescriptiondosDensity of states valuesldosLocal density of states valuesxx-axis values of the system central regionyy-axis values of the system central regionomega_dosEnergies at which DOS was evaluatedomega_ldosEnergies at which LDOS was evaluatedSome of these datasets are stored in chunked/compressed format for more
data-intensive simulations. All the DOS/LDOS calculation parameters are
adjusted via a parser user interface, which takes the following
arguments (typetinie_dos--helpif you ever feel lost!):ArgumentDescription-w,--omega-ldosProbe energies at which the LDOS should be avaluated-dw,--delta-omegaProbe energy spacing-etaSmall imaginary constant used in the calculation of the Green’s function--mu,--chem-potChemical potential at which the system is evaluated-V,--lead-biasLead biases at which the system is evaluated, typed in asV_0 V_1 ...-T,--temperatureTemperature at which the system is evaluated-i,--input-filePath to thetinie_prepare’s output file--psi,--wf-filePath from which central region wavefunctions are read-o,--output-filePath where thetinie_dos`file is saved--dos,--no-dosBoolean, decides if DOS is computed--ldos,--no-ldosBoolean, decides if LDOS is computedtinie_drawThis script reads data from the tinie hdf file, makes pretty
transmission/backsacttering/current/density of states plots and saves
them. This script has a parser user interface, where you can specify the
following plot arguments:ArgumentDescription-i,--input-filePath to thetinie-file-idos,--input-dos-filePath to thetinie_dos-file-o,--output-fileBasepath for plots-E,--energy-rangsRange of energies over which to draw the figures--transmission,--no-transmissionBoolean, decides if transmission is plotted--backscattering,--no-backscatteringBoolean, decides if backscattering is plotted--partial-currents,--no-partial-currentsBoolean, decides if partial currents are plotted--total-currents,--no-total-currentsBoolean, decides if total currents are plotted--dos,--no-dosBoolean, decides if DOS is plotted--ldos,--no-ldosBoolean, decides if LDOS is plotted--norm-ldos,--no-norm-ldosBoolean, decides if the LDOS will be normalized to 1--ldos-EEvaluate LDOS at an index corresponding to a probe energy--stability,--no-stabilityBoolean, decides if the numerical stability tests are plottedmake_system_filesThis script generates custom Hamiltonians or coupling matrices and saves
them in a .npy file to be passed on as arguments forCustomCenter/CustomLead/CustomCouplingobjects. They can
also be used to generate custom self-energy/rate operators for the
wide-band approximation. Run the script, follow the instructions and the
rest is history.Naturally, these scripts provide only some of the basic functionality
extensions. Additional scripts/code modifications may be added based on
the user’s end goals.