Codes for constructing matrix of Hamiltonion of 2D square Tight-bonding model

In summary, the conversation is about constructing and diagonalizing the matrix of Hamiltonion for a 2D square Tight-bonding model. The program for diagonalization is shown using Fortran and the necessary steps and codes are provided. The output of the program includes the eigenvalues corresponding to each eigenvector.
  • #1
Sheldon Coope
2
0
Hello,
Does anyone know how to write codes for constructing the matrix of Hamiltonion of 2D square Tight-bonding model. Then diagonalize it.
Any language is OK. (Fortran is best)
 
Physics news on Phys.org
  • #2
Hello,

This program shows the principle of diagonalizing a
matrix in fortran, using a 2D geometry. To compile, write
gfortran -llapack 2D.f90
then write ./a.out to run the program
Or ifort -llapack 2D.f90


Code:
module shared !every function and routine which
implicit none !includes the module shared can use its 
real*8, allocatable :: Hdiag(:,:),eigenvalues(:)  !variables
end module shared

program diag
use shared !now the program diag knows about Hdiag and eigenvalues
implicit none !this makes sure one has do define everything explicitly
integer :: nsize !size of the matrix to be diagonalized
integer :: i,j,icount,jcount,norb
integer :: i1,i2,j1,j2
real*8 :: v

norb = 5 !size of system

nsize = norb*norb !size of hamiltonian

allocate(Hdiag(nsize,nsize)) !This is the matrix to be diagonalized
allocate(eigenvalues(nsize)) !after diagonalization, this vector 
!contains the eigenvalues 

v = -1.0 !this is the hopping parameter

!Now we construct the hamiltonian, and we do that by first looping over
!j, and then i. This are non-periodic boundary conditions.
icount = 0
jcount = 0
do i1=1,norb
do j1=1,norb
   jcount = 0
   icount = icount + 1
   do i2=1,norb
   do j2=1,norb
      jcount = jcount + 1
      if (abs(i1-i2) + abs(j1-j2) == 1)Hdiag(icount,jcount) = v !if distance == 1, put hopping parameter = v
      write(11,*)'hop(',icount,jcount,')=',Hdiag(icount,jcount) !this prints the hamiltonian to disc 
   end do                                 
   end do
end do
end do

call diagonalize(nsize) !now Hdiag will be diagonalized.
!After diagonalization, Hdiag(:,:) will contain the eigenvectors,
!Where Hdiag(:,1) is the first eigenvector, Hdiag(:,2) the second and so on
!and eigenvalues(1) will contain the eigenvalue corresponding to 
!eigenvector 1, and so on.

do i=1,nsize
write(*,*)'eigenvalue:',i,eigenvalues(i) !writing eigenvalues to screen
end do
end program diag !program is finished



subroutine diagonalize(ndiag) !Diagonalizes the matrix Hdiag
use shared
implicit none
real*8,  allocatable :: work(:)
integer, allocatable :: iwork(:)
character job, uplo
external dsyevd
integer nmax, lda, lwork, liwork, info,ndiag
nmax=ndiag
lda=nmax
lwork=4*nmax*nmax+100
liwork=10*nmax
allocate(work(lwork),iwork(liwork))
job='v'
uplo='l'
call dsyevd(job,uplo,ndiag,Hdiag,lda,eigenvalues,work,lwork,iwork,liwork,info)
if (info > 0) then
   write (*,*) 'failure to converge.'
   stop
endif
deallocate(work,iwork)
return
end
 

1. What is a 2D square Tight-binding model?

A 2D square Tight-binding model is a mathematical model used to describe the electronic structure of a 2D crystal lattice. It is commonly used in solid state physics to study the behavior of electrons in materials such as graphene or transition metal dichalcogenides.

2. What is the Hamiltonian of a 2D square Tight-binding model?

The Hamiltonian of a 2D square Tight-binding model is a mathematical operator that represents the total energy of the system. It takes into account the kinetic energy of the electrons as well as the interactions between them, which are described by the crystal lattice structure.

3. How do you construct a matrix for the Hamiltonian of a 2D square Tight-binding model?

The matrix for the Hamiltonian of a 2D square Tight-binding model can be constructed by considering the basis functions of the crystal lattice, which are usually chosen to be the atomic orbitals of the constituent atoms. The elements of the matrix correspond to the hopping integrals between these orbitals, which represent the strength of the electron interactions at different lattice sites.

4. What is the purpose of constructing a matrix for the Hamiltonian of a 2D square Tight-binding model?

The matrix for the Hamiltonian of a 2D square Tight-binding model allows us to solve for the energy levels and wavefunctions of the electrons in the system. This information is crucial in understanding the electronic properties and behavior of the material, such as its conductivity and band structure.

5. Are there any simplifications or approximations involved in constructing the matrix for the Hamiltonian of a 2D square Tight-binding model?

Yes, there are several simplifications and approximations involved in constructing the matrix for the Hamiltonian of a 2D square Tight-binding model. These include assuming a small number of nearest neighbor interactions, neglecting higher order interactions, and using a finite basis set to represent the wavefunctions of the electrons. These approximations are necessary to reduce the complexity of the problem and make it solvable using computational methods.

Similar threads

  • Atomic and Condensed Matter
Replies
1
Views
3K
  • Programming and Computer Science
Replies
14
Views
1K
  • Atomic and Condensed Matter
Replies
1
Views
1K
  • Atomic and Condensed Matter
Replies
1
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
0
Views
458
  • Atomic and Condensed Matter
Replies
8
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
14
Views
2K
  • Quantum Interpretations and Foundations
Replies
15
Views
2K
Replies
0
Views
617
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
Back
Top