-
Joseph Weston authoredJoseph Weston authored
Discretizing continuous Hamiltonians
Introduction
In ":ref:`tutorial_discretization_schrodinger`" we have learnt that Kwant works with tight-binding Hamiltonians. Often, however, one will start with a continuum model and will subsequently need to discretize it to arrive at a tight-binding model. Although discretizing a Hamiltonian is usually a simple process, it is tedious and repetitive. The situation is further exacerbated when one introduces additional on-site degrees of freedom, and tracking all the necessary terms becomes a chore. The ~kwant.continuum sub-package aims to be a solution to this problem. It is a collection of tools for working with continuum models and for discretizing them into tight-binding models.
Discretizing by hand
As an example, let us consider the following continuum Schrödinger equation for a semiconducting heterostructure (using the effective mass approximation):
\left( k_x \frac{\hbar^2}{2 m(x)} k_x \right) \psi(x) = E \, \psi(x).
Replacing the momenta by their corresponding differential operators
k_\alpha = -i \partial_\alpha,
for \alpha = x, y or z, and discretizing on a regular lattice of points with spacing a, we obtain the tight-binding model
H = - \frac{1}{a^2} \sum_i A\left(x+\frac{a}{2}\right) \big(\ket{i}\bra{i+1} + h.c.\big) + \frac{1}{a^2} \sum_i \left( A\left(x+\frac{a}{2}\right) + A\left(x-\frac{a}{2}\right)\right) \ket{i} \bra{i},
with A(x) = \frac{\hbar^2}{2 m(x)}.
Using ~kwant.continuum.discretize to obtain a template
First we must explicitly import the kwant.continuum package:
The function kwant.continuum.discretize takes a symbolic Hamiltonian and turns it into a ~kwant.builder.Builder instance with appropriate spatial symmetry that serves as a template. (We will see how to use the template to build systems with a particular shape later).
It is worth noting that discretize
treats k_x
and x
as
non-commuting operators, and so their order is preserved during the
discretization process.
Printing the Builder produced by discretize
shows the source code of its onsite and hopping functions (this is a special feature of builders returned by discretize
).
Building a Kwant system from the template
Let us now use the output of discretize
as a template to
build a system and plot some of its energy eigenstate. For this example the
Hamiltonian will be
H = k_x^2 + k_y^2 + V(x, y),
where V(x, y) is some arbitrary potential.
First, use discretize
to obtain a
builder that we will use as a template:
We now use this system with the ~kwant.builder.Builder.fill method of ~kwant.builder.Builder to construct the system we want to investigate:
After finalizing this system, we can plot one of the system's energy eigenstates:
Note in the above that we pass the spatially varying potential function
to our system via a parameter called V
, because the symbol V
was used in the initial, symbolic, definition of the Hamiltonian.
In addition, the function passed as V
expects two input parameters x
and y
, the same as in the initial continuum Hamiltonian.
Models with more structure: Bernevig-Hughes-Zhang
When working with multi-band systems, like the Bernevig-Hughes-Zhang (BHZ)
model [1] [2], one can provide matrix input to ~kwant.continuum.discretize
using identity
and kron
. For example, the definition of the BHZ model can be
written succinctly as:
We can then make a ribbon out of this template system:
and plot its dispersion using kwant.plotter.bands:
In the above we see the edge states of the quantum spin Hall effect, which we can visualize using kwant.plotter.density:
Limitations of discretization
It is important to remember that the discretization of a continuum model is an approximation that is only valid in the low-energy limit. For example, the quadratic continuum Hamiltonian
H_\textrm{continuous}(k_x) = \frac{\hbar^2}{2m}k_x^2
and its discretized approximation
H_\textrm{tight-binding}(k_x) = 2t \big(1 - \cos(k_x a)\big),
where t=\frac{\hbar^2}{2ma^2}, are only valid in the limit E < t. The grid spacing a must be chosen according to how high in energy you need your tight-binding model to be valid.
It is possible to set a through the grid
parameter
to ~kwant.continuum.discretize, as we will illustrate in the following
example. Let us start from the continuum Hamiltonian
H(k) = k_x^2 \mathbb{1}_{2\times2} + \alpha k_x \sigma_y.
We start by defining this model as a string and setting the value of the \alpha parameter:
Now we can use kwant.continuum.lambdify to obtain a function that computes H(k):
We can also construct a discretized approximation using kwant.continuum.discretize, in a similar manner to previous examples:
Below we can see the continuum and tight-binding dispersions for two different values of the discretization grid spacing a:
We clearly see that the smaller grid spacing is, the better we approximate the original continuous dispersion. It is also worth remembering that the Brillouin zone also scales with grid spacing: [-\frac{\pi}{a}, \frac{\pi}{a}].
Advanced topics
The input to kwant.continuum.discretize and kwant.continuum.lambdify can be
not only a string
, as we saw above, but also a sympy
expression or
a sympy
matrix.
This functionality will probably be mostly useful to people who
are already experienced with sympy
.
It is possible to use identity
(for identity matrix), kron
(for Kronecker product), as well as Pauli matrices sigma_0
,
sigma_x
, sigma_y
, sigma_z
in the input to
~kwant.continuum.lambdify and ~kwant.continuum.discretize, in order to simplify
expressions involving matrices. Matrices can also be provided explicitly using
square []
brackets. For example, all following expressions are equivalent:
We can use the locals
keyword parameter to substitute expressions
and numerical values:
Symbolic expressions obtained in this way can be directly passed to all
discretizer
functions.
References
[1] | Science, 314, 1757 (2006). |
[2] | Phys. Rev. B 82, 045122 (2010). |