User Tools

Site Tools


exercises:2015_ethz_mmm:simple_stm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exercises:2015_ethz_mmm:simple_stm [2015/05/28 21:08] pshindeexercises:2015_ethz_mmm:simple_stm [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 12: Line 12:
 Download, as usual, the files from the media manager: {{exercise-10.2.tar.gz|}}. The 1h.1.5.inp file is **commented**). Download, as usual, the files from the media manager: {{exercise-10.2.tar.gz|}}. The 1h.1.5.inp file is **commented**).
  
-Please use command **module load cp2k/trunk.2.5.13191** to do this particular exercise.+Please use command **module load cp2k/2.5.14075** , as well as **module load python/2.7.9** to do this particular exercise.
 </note> </note>
 ===== 1. Task: Running the job and looking at the orbitals ===== ===== 1. Task: Running the job and looking at the orbitals =====
Line 45: Line 45:
     &END     &END
  
-      &MO +
-! molecular orbitals eigenvalues and molecular ocuupations after each scf +
-       FILENAME EIG +
-! add the last iteration with description +
-       ADD_LAST NUMERIC +
-! printing of eigenvalues of molecular orbitals +
-       EIGENVALUES +
-! also print occupation of the molecular orbitals +
-       OCCUPATION_NUMBERS +
-      &END +
-    &END+
 </code> </code>
  
-There will be an output file with the energy levels and their occupation. The last one can be easily found... +There will be an output file with the unoccupied energy levels and the last "**EIG**" file with occupied energy levels
- +To plot the energy level diagram, copy and paste following lines into the python script **eldplot.py**. The file **energy.dat** contains energy eigenvalues (in a.u.) in one column from the output file and from the EIG file. The Fermi energy (**Ef** in a.u., is the energy of the highest occupied value) must be entered in the **eldplot.py** script. Use the command **python eldplot.py** to get the energy level diagram as a postscript image. (use gs to visualize it). Identify the occupied and unoccupied energy levels and name them. Feel free to change the png image names.
-To plot the energy level diagram, copy and paste following lines into the python script **eldplot.py**. The file **energy.dat** contains energy eigenvalues in a column from the output file at the previous step. The Fermi energy (Ef) must be entered in the **eldplot.py** script. Use command **python eldplot.py** to get the energy level diagram as a png image. Identify the occupied and unoccupied energy levels and name them.+
 <code> <code>
 import matplotlib.pyplot as plt import matplotlib.pyplot as plt
Line 77: Line 66:
 f.close() f.close()
  
 +x1 = []
 y1 = [] y1 = []
  
 # Fermi energy # Fermi energy
- 
 Ef=0.0 Ef=0.0
  
Line 87: Line 76:
     y1.append(float((p[0]-Ef)*27.212))     y1.append(float((p[0]-Ef)*27.212))
  
-yv = np.array(y1)+for yv in y1: 
 +    x [0.2,0.8] 
 +    y = [yv, yv]
  
-[0.2,0.8] +    if yv <= 0
-y = [yvyv]+        plt.plot(x,y,color='red'
 +    else: 
 +        plt.plot(x,y,color='green')
  
 # add label to y-axis # add label to y-axis
Line 101: Line 94:
 # remove x-axis label # remove x-axis label
 plt.gca().xaxis.set_major_locator(plt.NullLocator()) plt.gca().xaxis.set_major_locator(plt.NullLocator())
-plt.plot(x,y,color='red') 
  
 +# show plot
 #plt.show() #plt.show()
-plt.savefig('ELD.png')+ 
 +# save plot in a eps file 
 +plt.savefig('ELD.eps') 
 </code> </code>
 +An example of the energy level diagram is as follows,
 +
 +{{ eld1.png?direct&700 |}}
  
 <note tip> <note tip>
exercises/2015_ethz_mmm/simple_stm.1432847290.txt.gz · Last modified: 2020/08/21 10:14 (external edit)