Obtain the Density of State using the Green function

In summary, the Green function is used to calculate the density of states in a one-dimensional linear lattice. The code uses an iterative loop with 4,000 data for the energy component and a iteration loop with 2,000 data for the wave number component. 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.
  • #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
 
Physics news on Phys.org
  • #2
But this coding does not seem to be logically correct. Because by running the program, I have only one output value for energy and also for (ek), and the program has no output value for the Green function and density of state. Now I want to know if anyone can guide me in this.thanks a lot
 
  • #3
Can you link to a reference that demonstrates this method ?
Code:
OPEN (,) ! You must open the files before you enter the loop that reads sequential data from the file.
DO
    READ( , ) var ! You must read a value from the file and store it in a variable.

    ! Process the variable, and rest of file

END DO ! You must loop through the process.
CLOSE ! You must not close the file until it has all been read.
 
  • Like
Likes MahdiI84
  • #4
Thank you for your guidance. Unfortunately, I did not find a reference. This issue (density of states in different types of crystal lattices) is an important topic in solid state physics. But I did not find any coding references for them. So based on my own analysis of the problem, I got some mathematical relations (such as the relations of the outer ring for energy, the inner ring for the wave number, the relation ek, the relation of the Green function and the relation of the density of states). And I did the coding based on that relationship.
 
  • #5
I modified the coding according to the pattern you suggested. I just do not know what variable to enter in front of Read command. I entered W and KX but the program reported the following error:

A do-variable within a DO body shall not appear in a variable definition context. [W]
 
  • #6
MahdiI84 said:
But I did not find any coding references for them.
There is insufficient code to guess what you are trying to do. I need a reference to the mathematical process you are using. Can you please find a reference, or write out the mathematics for each step of the process.

What variable is read from the file 'ENERGY.txt'
What variable is read from the file 'EPSILONK.txt'

Please use a code box </> for your code.
You are new to FORTRAN programming.
Maybe you should study programming before taking on such a project.
 
  • Like
Likes MahdiI84
  • #7
Thank you very much for your help. Yes, I'm still a beginner in Fortran. I read a book about it and watched several hours of instructional videos, but it seems like not enough.
 
  • #8
I do not want the variable of the file 'ENERGY.txt' and the file 'EPSILONK.txt' to be read. In fact, I want to import data from the energy loop and the wave number loop into these two files.
 
  • #9
Again, thank you for your time to help me out.
 
  • #10
Consider this code fragment...
Code:
DO w = -2, +2, 0.001        ! Energy loop
    Energy = w + i * eta    ! Energy = ( w, eta )  i = Sqrt( -1 )
    X = REAL( Energy ) 
    Y = IMAG( Energy )
    WRITE( 1, * ) Energy, X, Y
w, eta are REAL,
i is COMPLEX = ( 0, 1)
i * eta will be COMPLEX
So you get;
X = w ! will vary from -2 to +2 in steps of 0.001
Y = eta ! is constant

We need the mathematics before we write the code.
 
  • Like
Likes MahdiI84
  • #11
My purpose in introducing the X and Y variables is to separate the real and imaginary parts of the energy component.If you pay attention to the coding, after the two loops, (energy and ek), the relation related to the Green function is given, which consists of the difference between the data obtained from the energy loop and the ek loop.
 
  • #12
Of course, the question for me is whether the Green function relation is mathematically correct or not? Because as I said, this relationship is the difference between complex data (energy) and real data (ek).
 
  • #13
The Green function is a function of the wave vector, and because of the effect (Tr) on the Green function, we see the sum operation on all values (k). The Green function is inside the loop of k.
20210125_000706.jpg
20210125_000641.jpg
20210125_000613.jpg
 

1. What is the Green function method used for?

The Green function method is used to calculate the density of states (DOS) in a system. It is a mathematical tool that relates the energy levels of a system to its DOS, which is a measure of the number of available states at each energy level.

2. How does the Green function method work?

The Green function method involves solving the Schrödinger equation for a given system and then using the solution to calculate the DOS. This is done by taking the Fourier transform of the Green function, which is a function that describes the propagation of a particle in the system.

3. What information can be obtained from the density of states?

The density of states provides information about the energy levels and allowed states in a system. It can also be used to calculate other properties, such as the specific heat and magnetic susceptibility, which are important in understanding the behavior of materials.

4. What are the advantages of using the Green function method?

The Green function method is a powerful tool for calculating the DOS because it can be applied to a wide range of systems, including complex and disordered systems. It also allows for the inclusion of interactions between particles, making it useful for studying many-body systems.

5. Are there any limitations to using the Green function method?

One limitation of the Green function method is that it requires a detailed understanding of the system's Hamiltonian, which may not always be available. It also assumes that the system is in equilibrium, which may not be the case in certain situations. Additionally, the calculations can become computationally intensive for larger systems.

Similar threads

  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
Replies
4
Views
3K
  • Quantum Physics
Replies
12
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
2K
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
12
Views
2K
Back
Top