We use Python 3 with the following packages:
numpy
matplotlib
jupyter
Condensed matter physics realizes the importance of 2D materials when it comes to the observation of interesting phenomena (ie. optical, magnetic, etc) and topological properties as well as technological applications. Different 2D materials have different underlying lattice structures. Some common ones are the square lattice, the honeycomb lattice, triangular/hexagonal lattice, and the kagome lattice.
These lattices can be described via Hamiltonians encoding how a species could "hop" between adjacent sites (nearest neighbors). A useful way to understand these systems is by diagonalizing the associated Hamiltonians to obtain allowed energies and states, and use these eigenvalues and eigenvectors to compute various parameters. In general, it is useful to plot the eigenvalue spectrum, different eigenvectors, density of states, and the inverse participation ratio. In the case of a magnetic field application perpendicular to the lattice, plotting the Hofstader butterfly is a primary result. Generally, the band structure of these systems is useful to compute, but energy band theory is dependent on the concept of crytal momentum --- a relevant parameter when it comes to describing translational symmetry in the lattice via Bloch's theorem. However, Bloch's theorem does not hold in cases like hyperbolic lattice connectivity. There is also little support for computing Hofstadter butterflies while there exist multiple Python packages referring to band theory calculations. This brings us to what is interesting about our implementation of lattice simulations in this repository:
- We create base cases for the most common, physically realizable lattice types without reliance on crystal momentum to allow for extending this code to cases where Bloch's theorem no longer holds.
- We account for the presence of additional on-site disorder as well as a constant, perpendicular magnetic field. This allows us to simulate Anderson localization and plot Hofstader butterflies with and without disorder. The magnetic field support also sets the stage for further invesitgation into the quantum hall effect.
- The classes creating the hamiltonians for each lattice type can be modified or refactored to support additional parameters or more accurately reflect a particular type of material such as graphene.
Suppose we take an atom. There are orbitals associated with it that describe regions where electrons could exist -- these are eigenfunctions of the Hamiltonian describing our atom. But what if we configure our atom with other atoms in a crystalline configuration? How do we describe the energy of a system where particles are placed in a crystalline configuration? The following tight-binding Hamiltonian describes lattices in the absence of external interactions while accounting for hopping:
where
When we're simulating specific lattice types, it's actually easier to construct a Hamiltonian in terms of a matrix populated by considering the lattice geometry. By this, we mean populating an
The key idea behind Anderson Localization is that certain materials can undergo a phase transition from conductor to insulator if the system passes a disorder threshold. Thus, in systems of sufficiently large disorder (such as defected semiconductors) the electronic wavefunction associated with a now spatially localized state becomes localized. This localization influences the aforementioned phase transition. In other words, spatial localization of the electronic wavefunction causes a change in the conductance of a highly disordered material.
The Anderson tight-binding model allows us to describe this phenomenon more effectively. Here, electrons can tunnel between neighboring lattice sites until high disorder in the lattice causes quantum amplitudes associated with the tunneling paths to cancel amongst each other. A localized wavefunction follows. It will decay exponentially as
Experimentally, electron localization has mostly been observed in a 1D case.
The Anderson Hamiltonian can help us describe the localization in more technical terms. We write it as such
where
The "participation ratio" gives an estimation of the localization length:
What happens when we apply a perpendicular, uniform magnetic field onto a lattice? The general tight-binding hamiltonian will now involve a "Peierls phase" accounting for the magnetic flux through each plaquette as well as relevant changes in the boundary conditions.
An interesting result is that if we plot the energies as a function of magnetic flux ratios (
Hoftsadter butterfly for square lattice as q increases (i.e. magnetic flux decreases)
Hofstadter butterfly for square lattice as hopping parameter, t, increases
The repository contains multiple lattice implementations in lattice_types
via the classes Square_Hamiltonian
, Honeycomb_Hamiltonian
, Triangular_Hamiltonian
, and Kagome_Hamiltonian
in square.py
, honeycomb.py
, triangular.py
, and kagome.py
respectively. Each class implements the tight-binding model with support for Anderson localization (disorder) and magnetic field effects. The plot_hofstadter_butterfly
function exists uniquely for each lattice class since it is dependent on the hamiltonian construction specific to each structure. The plotting.py
file contains a Plotting_Functions
class that takes the relevant parameters from the individual lattice classes so that common plots such as the eigenvalue spectrum, random eigenvector, density of states, and inverse participation ratio can be attained by calling their respective functions. The existence of the Plotting_Functions
class reduces redundancy and improves the clarity of the code by keeping plotting functions independent of the geometric hamiltonian construction separate from the lattice type classes.
Functions relating to butterfly animations with respect to different parameters are located in the utils
folder. The summary.ipynb
notebook contains further usage examples, and the folder test_notebooks
contains a number of notebooks housing scratchwork and additional intermittent tests to ensure the accuracy of the functions and classes eventually implemented in lattice_types
.
Here's a minimal example using the square lattice, without disorder, to generate a Hofstadter butterfly:
from lattice_types.square import Square_Hamiltonian
# Initialize square lattice
lattice = Square_Hamiltonian(
length=10, # 10x10 lattice
t=1.0, # Hopping parameter
W=0.0, # No disorder
phi=0.0, # Initial magnetic flux
q=50 # Maximum denominator for flux values
)
# Plot Hofstadter butterfly
lattice.plot_hofstadter_butterfly()
This is the resulting output:

Adjustable parameters required for each lattice type class are:
length (int)
: Lattice size (L x L)t (float)
: Hopping parameter between adjacent sitesW (float)
: Disorder strengthphi (float)
: Magnetic flux per plaquette (in units of flux quantum)q (int)
: Maximum denominator for flux values in Hofstadter butterfly
Each lattice class provides:
# Construct Hamiltonian and get eigenvalues/vectors
eigenvalues, eigenvectors = lattice.construct_hamiltonian()
# Get system parameters and outputs
outputs = lattice.prepare_outputs() # Returns (L, t, W, phi, q, evals, evecs, lattice_type)
When save=True
is passed to the constructor, plots are automatically saved in:
plots/
└── [LatticeType]/
├── No_Disorder/
│ └── L{length}_t{t}_phi{phi}_q{q}/
└── Disorder/
└── L{length}_t{t}_phi{phi}_q{q}_dis{W}/
Example plots in the repository demonstrate:
- Eigenvalue Spectrum
- Density of States vs. Energy
- Hofstadter butterflies for different lattice geometries
- Effects of disorder on the butterfly pattern
Eigenvalue spectrum:
For Square Lattice:

Eigenvector:
For Square Lattice:

Inverse participation ratio:
For Square Lattice:

Density of states:
For Square Lattice:

Hofstadter Butterfly:
Square butterfly with no disorder:

Honeycomb butterfly with no disorder:

An interesting result discussed in the literature is that the presence of disorder kills the butterfly structure (but in the high-disorder limit, some butterfly-like structure may still persist).
Square butterfly with increasing disorder (butterfly-like pattern persists up to ~ W = 1.40):

Disorder effects on other common lattice types:


Many other example plots can be found in the "plots" folder.
The code in this repository simulates some basic tight-binding hamiltonians specific to common 2D lattice types found in materials with the option to introduce on-site disorder or a uniform magnetic field. Modifications would need to be made in order to simulate specific 2D materials or account for more complicated/specific defects, a non-uniform magnetic field, or other complex systems. A non-exhaustive list of possible applications of this code is as follows:
- Simulating graphene (twisted-bilayer graphene)
- Hyperbolic Circuit QED
- Realizing the quantum hall effect in various moiré materials
Here are some papers we referenced or loosely recreated the results of. You may also find them interesting or useful to read.
- Tight Binding Method and the Electronic Energy Band Structure
- The Quantum Hall Effect
David Tong's comprehensive notes on QHE - Anderson Localization and Its Ramifications
Fundamental theory and applications - Low-field electron localization in a magnetic field
Kaveh & Mott's seminal paper on electron localization
- Universal properties of the two-dimensional Anderson model in a magnetic field
Computer simulation study of Anderson localization with detailed analysis of scaling properties - Quantum localization on the square lattice
Comprehensive analysis of localization properties including numerical methods
- Energy spectrum of a honeycomb lattice under nonuniform magnetic fields
Analysis of nonuniform field effects on honeycomb lattices
- Energy Spectrum of a Triangular Lattice in a Uniform Magnetic Field
Effects of next-nearest-neighbor hopping and magnetic field interactions
- Floquet Hofstadter butterfly on the kagome and triangular lattices
Figure 2 was used to verify our results for the kagome lattice - Hofstadter Butterfly and Many-Body Effects in the Kagome Lattice
Detailed analysis of magnetic field effects and band structure - Electronic Structure of the Kagome Lattice
Comprehensive band structure analysis and topological properties
Some possible modifications to this code could involve:
- Support for hyperbolic cases
- Support for open boundary conditions
- Extensions regarding parameters useful to understanding the quantum hall effect on such systems as well as topological properties (ie. hall conductance, thouless conductance, chern number)
This started as a project for PHY 329 (Computational Physics) at UT Austin (class website). The presentation we gave in-class on this repository is in the "presentations" folder. Special thanks to Dr. William Gilpin ([email protected]) for being a great instructor all semester!