For exact diagonalization (ED) studies, the foundational approach involves delving into several fundamental models for beginners. Examples include the lattice fermion Hubbard Model and quantum spin models such as the Ising Model and the XXZ Model (Heisenberg Model).
Our emphasis here is to introduce how to construct the Hamiltonian, commencing with the Heisenberg standard model and extending towards the XXZ model. The Ising Model assumes a more simplified form due to its absence of off-diagonal interaction terms.
1D Heisenberg chain
the Hamiltonian gives:
According to the relationships:
By expressing the Hamiltonian in terms of the :
Given the presence of two sites representing spins, the size of the Hilbert space is determined by
,
Consequently, the Hamiltonian matrix for the system is a 4x4 matrix. Describing the two sites is straightforward, and we typically represent the Hamiltonian solely in operator form. From a matrix perspective, the interactions between operators are connected through tensor products to link matrices.
The fundamental idea behind Exact Diagonalization (ED) is as follows: After obtaining the matrix representation of the Hamiltonian, numerical diagonalization is performed on the Hamiltonian matrix. In theory, this process allows us to obtain all the eigenvalues and eigenvectors associated with the Hamiltonian, providing a comprehensive description of the system.
The method we are about to introduce below is the simplest and most foundational, relying on intuitive understanding, without involving the treatment of larger system sizes.
Hamiltonian
Since we understand that the Hamiltonian matrix is in the form of the tensor product of operators, for a small number of sites, such as a 2-site matrix being 4x4, a 3-site matrix being 8x8, and a 4-site matrix being 16x16, the matrix elements can be manually calculated. Therefore, we can cross-verify the manually calculated matrix form with the matrix form provided by the code.
The manually calculated matrix form of the Hamiltonian is very easy to obtain and we will now focus on explaining the code implementation.
Firstly, we pre-store the matrix forms of the operators that constitute the Hamiltonian:
1 | sz = 0.5*[1.0,0;0,-1.0]; |
1 | sz = |
1 | sp = |
1 | id = |
We do not redundantly store the operator , as it is evident that its matrix form is merely the transpose of . In MATLAB, adding a ‘ to a matrix, such as A’, denotes the transpose of the matrix A.
Before we construct the Hamiltonian matrix, it is crucial to create(the matrix) and initialize:
1 | H = zeros(2,2) |
1 | H = |
Notice that we have additionally prepared operator matrices Sp0, Sp1, Sz0, Sz1, Id
(MATLAB is case-sensitive, hence Id
and id
are distinct variables). These matrices have been initialized, and the form of the initialization is provided by the results.
With all the preparatory work completed, we can now proceed to the main loop for constructing the Hamiltonian.
Evidently, the core of this loop is:
1 | for site=1:L-1 |
The variable site
, representing the site point coordinates, concludes the loop at L-1
instead of L
. This is because, in practice, when dealing with site = i, then . If the loop were to end at L
, the value of j would exceed the length.
Now, we can contemplate how to create the code for our first 4x4 Hamiltonian matrix. It is:
We can denote as h. In MATLAB, the tensor product of two matrices can be represented using the kron(A,B)
function. Therefore, . Similarly, it is evident that .
1 | h = 0.5*kron(Sp1, sp'); |
Here, both Sp1 = sp
and Sz1 = sz
are 2x2 matrices. After the tensor product, they become 4x4 matrices, i.e., kron(H, id)
, h
, h'
, and kron(Sz1, sz)
are all 4x4 matrices. Matrix addition relies on having the same dimensions. The first term in the Hamiltonian matrix serves the purpose of expanding the initialized Hamiltonian matrix H from 2x2 to 4x4, maintaining consistency with the dimensions of the subsequent terms.
2-spin system
If we consider only 2-spin system, it is unsurprising that the Hamiltonian is immediately fully constructed, here we print the result:
1 | H = |
Consistent with our manual derivation. The matrices below are four times the previous ones, which can be interpreted as factoring out J/4.
3-spin system
For 3-spin system, to maintain consistency in the dimensions of the Hamiltonian matrix, it should be:
We call it Eq.7. It is not difficult to comprehend. The first row signifies the action of the interaction operators on lattice points where i=1 and j=2. However, to maintain dimensional consistency, it is as if the identity operator acts on the third lattice point and contributes to the matrix. (One can contemplate the consequences if we express H solely as
There would arise significant issues.) The Hamiltonian matrix is fundamentally expressed based on the chosen basis, and therefore, the order of the basis for each row and column has implications.)
It is noteworthy that the last row indicates the action of two-body interactions on points i=3 and j=1, suggesting the adoption of periodic boundary conditions in this scenario.
Now, let’s delve into each row specifically:
we realize that the Hamiltonian in the first row, factoring out , is essentially equivalent to the Hamiltonian for two sites that we previously calculated, denoted as . Consequently, in the code:
1 | % when site=1 for 2-spin |
We have implemented the first row of the total Hamiltonian(Eq.7).
Now, the second row of Hamiltonian(Eq.7):
1 | Sp1 = kron(Id, sp); |
Still remember that our Sp1
and Sz1
were initialized as sp
and sz
2x2 matrices? After the operation Sp1 = kron(Id, sp)
, it represents: . Similarly, Sz1 = kron(Id, sz)
represents . Considering them as a whole, the term h = 0.5*kron(Sp1, sp')
now represents , and h'
represents . Finally, the term kron(Sz1,sz)
represents . This way, we have completed the construction of the second row of the Hamiltonian.
For the third row of Hamiltonian(Eq.7) , we handle the last point, where i = 3:
1 | Sp0 = kron(Sp0, id); |
Here, Sp0 = kron(Sp0, id)
with the initialization Sp0 = sp
represents . Therefore, h = 0.5*kron(Sp0, sp')
corresponds to . Similarly, represents the treatment for the last point i=3. This completes the construction of the three components of the Hamiltonian for the 3-spin system under periodic boundary conditions.
Below is the complete code, composed of the snippets above, with some logical changes for functionality linkage. With the presence of comments, it should be comprehensible for readers:
1 | % 3-spin example: |
Finally, let’s output the Hamiltonian matrix and compare it with the manually derived form.
1 | H = |
The code demonstrated above is also applicable for L = 4, L = 5, L = 6, … since the implementation logic remains the same and covers cases with different numbers of lattice sites. I won’t go into excessive details here. Instead, let’s just print out the Hamiltonian matrix for a 4-spin system. Readers can compare it with the manually derived form:
Hamiltonian matrix of standard Heisenberg Model:
1 | H = J/4 x |
Appendix A: tensor products rules
For more details, please refer to Wikipedia.
Tensor product does not require matrices to have the same dimensions. Suppose there is a 2x2 matrix A and a 2x2 matrix B for this demonstration.
Appendix B: Pauli matrices
Pauli matrix:
The relationship between operators and Pauli matrices is as follows:
We typically assume , and given the relationship between the spin operator with and the Pauli matrices, it is possible to derive the matrix forms of the raising and lowering spin operators based on these relationships.
Clearly,
Appendix C: external field
1D Longitudinal field
1 | sh = zeros(2,2); |
1D Transverse field
1 | sx = [0,1.0;1.0,0];%notice here is Pauli Matrix |