Waveprop is a python package to calculate the transmission properties of a one-dimensional kronig-penney-system. The model consists of a scattering region between two leads. The leads and scattering region are built up of unitcells. Currently only rectangular potential-barriers are implemented.
______________________________________________
| |
e --> Lead | Sample | Lead -->
______________|________________|______________
Download package and use pip to install:
pip install -e <folder path>
Use the main folder of "waveprop". Only tested with Python 3.6.
The package consists of four main parts:
Contains all objects to model the System:
- The unitcell to build the leads and samples:
Cell
- The Kronig-Penney-Modell for describing the leads:
KronigPenney
- An object to calculate the bandstrukture of the Kronig-Penney-Model:
BandFinder
- The models of the sample region:
Sample
,OrderedSample
andDisorderedSample
- The main model-object:
Model
This package contains an object holding all used constants constants
, some helper methodsa for the calculation and
an implementation of the Transfermatrix method: TransferMatrix
.
The plotting-package contains a two-dimensional (Plot
) and three-dimensional (Plot3D
) wrapperclass for the
matplotlib-libary. In Addition, a Error-Plot class is included (ErrorPlot
).
All other helper-methods and -objects are contained in the utils package. This includes:
- A module for displaying the calculation-progress in one console-line:
console
- A custom cuvre object for holding plotting data:
Curve
- Some methods for converting output to latex syntax:
latex
To initialize the model, use the Model
object. This will create the two leads from the given Cell
object or
parameters:
from waveprop import Cell, Model
v = 10 # Barrier Potential-strength of leads in hartree
a, d = 1.0, 0.8 # lattice constant and barrier width in bohr-radius
lead_cell = Cell(v, a, d)
model = Model(lead_cell)
#or:
model = Model.from_lead_params(v, a, d)
To add an arbitrary scattering region to the model, use the methods of the model and pass the list of unitcells in the sample region:
sample_cells = [Cell(10, a, d), Cell(12, a, d), Cell(14, a, d)]
model.set_sample(sample_cells)
The ordered sample consists of n identical unit cells. To add this sample, use:
sample_cell = Cell(12, a, d)
model.set_ordered_sample(n=10, cell=sample_cell)
For the disordered sample, the strength of the disorder w has to be given additionaly:
model.set_disordered_sample(w=0.4, n=10, cell=lead_cell)
This will generate a disordered sample, consisting of 10 unitcells with a deviation of 40% of the potential strength.
To calculate the transmission properties of the model, first the energy of the considered wave or particle has to be set. After that, all values are accessable. For example:
e = 7 # energy of particle in hartree
model.set_energy(e)
t = model.t # transmission-koefficient of model for current energy
k = model.k # bloch-vector of model for current energy
The model also has a method for calculating the transmission-curve in a given energy-range:
energy_range = 0, 20 # calculate the transmission curve for this range of values (hartree)
steps = 1000 # number of transmission values to calculate
e_values, t_values = model.transmission_curve(energy_range, steps=steps)
The data can be plotted quickly using the Plot-object:
from waveprop import Plot
plt = Plot()
plt.plot_transmission((e_values, t_values), col="black")
plt.show()
To show the model and the transmission curve, use the package as shown in test_script.py:
from waveprop import Model, Plot, color_gaps
"""
Create model with default leads (v=10, a=1.0, d=0.8).
"""
model = Model()
"""
Creates disordered sample and uses lead-unitcell as prototype.
The disorder stregth is 0.1, so the potential range is v=9-11.
"""
disorder_strength = 0.1 # disorder strength
n_sample_cells = 10 # number of unit-cells in scattering region
model.set_disordered_sample(w=disorder_strength, n=n_sample_cells)
"""
Show the model using included matplotlib-wrapper
"""
plt = model.show() # plot generated model
plt.show(tight_layout=True)
"""
Plot the transmission curve of the disordered scattering region
"""
energy_range = 0, 30 # energy range to plot the transmission
data = model.transmission_curve(energy_range) # get transmission data
plt = Plot()
color_gaps(plt, model) # color band-gaps
plt.plot_transmission(data) # plot transmission data
plt.show(tight_layout=True)
This will produce the following output:
-Generated model:
-Corresponding transmission curve:
- Unit Test coverage
- More forms of potential barriers