Week 4 - Implementing the tight-binding model
April 19, 2025
Welcome back to my blog! In the previous two posts, I explained the theoretical framework for finding the Hamiltonian of the Apollonian system, and ultimately how to find its localization properties. In this post, I will be talking about how the creation of the Hamiltonian matrix is implemented, as well as the algorithms behind solving the matrix for its eigenvalues and eigenvectors.
Another thing to note is that from here on out, I will be using the Sierpinski triangle instead of the Apollonian gasket, since the graph of the system I have described is very similar to the Sierpinski graph, and the geometry of the Apollonian circles would make things extremely difficult.
Implementing the Hamiltonian
So as a recap, we have an NxN matrix, where N is the number of nodes in our graph. To make our matrix, we just set the diagonal terms to some onsite energies that we decide. For the other elements, we just see whether two nodes are adjacent, and if they are, we decide some hopping amplitude formula between them. If they are not, we set the element to 0. For now, we will assume the uniform model, meaning that the onsite energies are all zero, and all hopping amplitudes are equal to 1. This just gives us the adjacency matrix. Sounds simple enough to do, so why do we need to write a computer program?
Well, we found before that N(n) = (3+3^(n+1))/2, making the matrix exponentially increase in size. At just n=5, we have a 123×123 matrix, and at n=7 we have a 1095×1095 matrix. Clearly, manually filling out these matrices would be tedious. Instead, I used two separate methods to implement the Hamiltonian and made sure they returned the same set of eigenvalues. This ensures that the matrices represent the system correctly in both cases.
The first method I borrowed from paper [1] (converting the MATLAB code to Python), and it is a recursive algorithm that creates the adjacency matrix for the Sierpinski triangle, but I will leave the details out of this post. The algorithm is difficult to explain without mathematical notation, and is difficult to understand with said notation. The main point is that this method is not flexible at all when it comes to varying the hopping parameters between any pair of nodes (it can only set elements of the matrix to 0 or 1).
Therefore, I made a second algorithm using the help of Networkx, a Python library for studying graphs and networks. Using this library, I was able to write a function that stored both the indices and the coordinates of each node. I was then able to set each element of the Hamiltonian to whatever I wanted.
Finally, I needed to make sure my algorithm was accurate. I set my program to use the uniform model (1 for adjacent nodes, 0 everywhere else), and calculated the eigenvalues for the matrix resulting from the paper’s algorithm as well as mine. Naturally, the matrices themselves are different from each other due to different labeling, but since they returned the same set of eigenvalues, I concluded that my algorithm was accurate.
References
[1] Rajan, Bharati & Rajasingh, Indra & Stephen, Sudeep & Grigorious, Cyriac. (2011). Spectrum of Sierpiński Triangles Using MATLAB.

Leave a Reply
You must be logged in to post a comment.