File: occupation_numbers_figure.py

package info (click to toggle)
gpaw 21.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,492 kB
  • sloc: python: 121,997; ansic: 14,138; sh: 1,125; csh: 139; makefile: 43
file content (23 lines) | stat: -rw-r--r-- 679 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# creates: occupation_numbers.png
import numpy as np
import matplotlib.pyplot as plt

from gpaw.occupations import fermi_dirac, marzari_vanderbilt, methfessel_paxton

width = 0.05
x = np.linspace(-0.2, 0.2, 101)

ax = plt.subplot()
ax.plot(x, fermi_dirac(x, 0.0, width)[0],
        label='fermi-dirac')
ax.plot(x, marzari_vanderbilt(x, 0.0, width)[0],
        label='marzari-vanderbilt')
ax.plot(x, methfessel_paxton(x, 0.0, width, 0)[0],
        label='methfessel_paxton-0')
ax.plot(x, methfessel_paxton(x, 0.0, width, 1)[0],
        label='methfessel_paxton-1')
plt.xlabel('energy [eV]')
plt.ylabel('occupation')
plt.legend()
# plt.show()
plt.savefig('occupation_numbers.png')