Skip to content

Commit

Permalink
Minor update to make FermiDos more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
kavanase committed Dec 29, 2024
1 parent da607e8 commit d1f986d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pymatgen/electronic_structure/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,15 @@ def get_doping(self, fermi_level: float, temperature: float) -> float:
(P-type).
"""
cb_integral = np.sum(
self.tdos[self.idx_mid_gap :]
* f0(self.energies[self.idx_mid_gap :], fermi_level, temperature)
* self.de[self.idx_mid_gap :],
self.tdos[max(self.idx_mid_gap, self.idx_vbm+1) :]
* f0(self.energies[max(self.idx_mid_gap, self.idx_vbm+1) :], fermi_level, temperature)
* self.de[max(self.idx_mid_gap, self.idx_vbm+1) :],
axis=0,
)
vb_integral = np.sum(
self.tdos[: self.idx_mid_gap + 1]
* f0(-self.energies[: self.idx_mid_gap + 1], -fermi_level, temperature)
* self.de[: self.idx_mid_gap + 1],
self.tdos[: min(self.idx_mid_gap, self.idx_cbm - 1) + 1]
* f0(-self.energies[: min(self.idx_mid_gap, self.idx_cbm - 1) + 1], -fermi_level, temperature)
* self.de[: min(self.idx_mid_gap, self.idx_cbm - 1) + 1],
axis=0,
)
return (vb_integral - cb_integral) / (self.volume * self.A_to_cm**3)
Expand Down

0 comments on commit d1f986d

Please sign in to comment.