Skip to content

Commit

Permalink
Improve get_eig.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
kavanase committed Sep 5, 2024
1 parent 044de3c commit cfc37bf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions script/get_eig.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import matplotlib.pyplot as plt


E_MIN = -3
E_MAX = 3
dq = 0.01

# Copied from pymatgen
Expand Down Expand Up @@ -83,16 +81,16 @@ def plot_eigs(eigval, q):

# occpied
indx_occ = np.where(occ > 0.9)
plt.plot([q+float(spin)*dq]*len(y[indx_occ]), y[indx_occ] - efermi, color=c, lw=0, marker='o')
plt.plot([q+float(spin)*dq]*len(y[indx_occ]), y[indx_occ] - efermi, color="C0", lw=0, marker='o')

# unoccpied
indx_unocc = np.where(occ < 0.3)
plt.plot([q+float(spin)*dq]*len(y[indx_unocc]), y[indx_unocc] - efermi, color=c, lw=0, marker='o', fillstyle='none')
plt.plot([q+float(spin)*dq]*len(y[indx_unocc]), y[indx_unocc] - efermi, color="C1", lw=0, marker='o', fillstyle='none')

# halfoccpied
indx_hocc = (0.3 <= occ) & (occ <= 0.9)
if len(indx_hocc) > 0:
plt.plot([q+float(spin)*dq]*len(y[indx_hocc]), y[indx_hocc] - efermi, color=c, lw=0, marker='o', fillstyle='bottom')
plt.plot([q+float(spin)*dq]*len(y[indx_hocc]), y[indx_hocc] - efermi, color="C2", lw=0, marker='o', fillstyle='bottom')


def read_poscar(i_path, l_get_sorted_symbols=False):
Expand Down Expand Up @@ -129,6 +127,7 @@ def plot(qs, eigvals, e_min, e_max):
for q, eigval in zip(qs, eigvals):
plot_eigs(eigval, q)
plt.ylim((e_min, e_max))
plt.savefig("Q_eigs.pdf", bbox_inches="tight")
plt.show()

def read_data(paths, pivot_path):
Expand Down

0 comments on commit cfc37bf

Please sign in to comment.