- #1
MahdiI84
- 22
- 1
Hi everyone. Using the Green function, I want to obtain the density of states of a one-dimensional (linear) lattice. Depending on the problem conditions, we will have an iterative loop with 4,000 data for the energy component and a iteration loop with 2,000 data for the wave number component. In the coding of that program, it must select a data from the energy loop, and in the next line of the program, it must enter the loop of the wave number, and in return a value that belongs to the energy loop must have 2,000 data for the wave number. The wave number obtained from the loop enters the relation (ek). After this step, the obtained data enters the relation of the Green function and then we separate the imaginary part from the output of the Green function and put it in the relation related to the density of states.The coding I did is as follows:
PROGRAM DensityOfState
IMPLICIT NONE
INTEGER :: omega=1 , t0=1 , a0=1
REAL :: eta=0.0015 , w , ek ,kx ,X
REAL,PARAMETER :: pi=3.14
COMPLEX , PARAMETER ::i=(0,1)
COMPLEX :: Energy
COMPLEX :: Density
COMPLEX :: GreenFunc
COMPLEX :: Y
DO w=-2,+2,0.001 ! Energy loop
OPEN(1,FILE='ENERGY.txt')
Energy=w+i*eta !Energy=(w,eta)
X=REAL(Energy)
Y=IMAG(ENERGY)
WRITE(1,*) Energy , X, Y
CLOSE(1)
DO kx=-1000,1000 ! WaveVector loop
OPEN(2,FILE='EPSILONK.txt')
ek= 2*t0*COS(kx)*a0
WRITE(2,*) ek
CLOSE(2)
OPEN(3,FILE='GREENF')
GreenFunc=( X+Y )- ek ! I'm not sure that is correct in terms of mathematical logic.
WRITE(3,*) GreenFunc
CLOSE(3)
END DO
END DO
OPEN(4,FILE='ImGrnFun')
WRITE(4,*) IMAG(GreenFunc)
CLOSE(4)
OPEN(5,FILE='Density')
Density= (1.0/pi*omega)*IMAG(GreenFunc)
WRITE(5,*) Density
CLOSE(5)
END PROGRAM DensityOfState
PROGRAM DensityOfState
IMPLICIT NONE
INTEGER :: omega=1 , t0=1 , a0=1
REAL :: eta=0.0015 , w , ek ,kx ,X
REAL,PARAMETER :: pi=3.14
COMPLEX , PARAMETER ::i=(0,1)
COMPLEX :: Energy
COMPLEX :: Density
COMPLEX :: GreenFunc
COMPLEX :: Y
DO w=-2,+2,0.001 ! Energy loop
OPEN(1,FILE='ENERGY.txt')
Energy=w+i*eta !Energy=(w,eta)
X=REAL(Energy)
Y=IMAG(ENERGY)
WRITE(1,*) Energy , X, Y
CLOSE(1)
DO kx=-1000,1000 ! WaveVector loop
OPEN(2,FILE='EPSILONK.txt')
ek= 2*t0*COS(kx)*a0
WRITE(2,*) ek
CLOSE(2)
OPEN(3,FILE='GREENF')
GreenFunc=( X+Y )- ek ! I'm not sure that is correct in terms of mathematical logic.
WRITE(3,*) GreenFunc
CLOSE(3)
END DO
END DO
OPEN(4,FILE='ImGrnFun')
WRITE(4,*) IMAG(GreenFunc)
CLOSE(4)
OPEN(5,FILE='Density')
Density= (1.0/pi*omega)*IMAG(GreenFunc)
WRITE(5,*) Density
CLOSE(5)
END PROGRAM DensityOfState