From eb9428d1de3439ebf195a6832453757bd9885c56 Mon Sep 17 00:00:00 2001 From: Mark Turiansky Date: Tue, 8 Oct 2019 19:24:26 -0700 Subject: [PATCH] Eigenval docstrings --- pymatgen/io/vasp/outputs.py | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pymatgen/io/vasp/outputs.py b/pymatgen/io/vasp/outputs.py index f1c5bcc3641..7fada65295b 100644 --- a/pymatgen/io/vasp/outputs.py +++ b/pymatgen/io/vasp/outputs.py @@ -4502,8 +4502,59 @@ def get_parchg(self, poscar, kpoint, band, spin=None, phase=False, class Eigenval: """ Object for reading EIGENVAL file. + + .. attribute:: filename + + string containing input filename + + .. attribute:: occu_tol + + tolerance for determining occupation in band properties + + .. attribute:: ispin + + spin polarization tag (int) + + .. attribute:: nelect + + number of electrons + + .. attribute:: nkpt + + number of kpoints + + .. attribute:: nbands + + number of bands + + .. attribute:: kpoints + + list of kpoints + + .. attribute:: kpoints_weights + + weights of each kpoint in the BZ, should sum to 1. + + .. attribute:: eigenvalues + + Eigenvalues as a dict of {(spin): np.ndarray(shape=(nkpt, nbands, 2))}. + This representation is based on actual ordering in VASP and is meant as + an intermediate representation to be converted into proper objects. The + kpoint index is 0-based (unlike the 1-based indexing in VASP). """ + def __init__(self, filename, occu_tol=1e-8): + """ + Reads input from filename to construct Eigenval object + + Args: + filename (str): filename of EIGENVAL to read in + occu_tol (float): tolerance for determining band gap + + Returns: + a pymatgen.io.vasp.outputs.Eigenval object + """ + self.filename = filename self.occu_tol = occu_tol @@ -4551,6 +4602,7 @@ def eigenvalue_band_properties(self): Band properties from the eigenvalues as a tuple, (band gap, cbm, vbm, is_band_gap_direct). """ + vbm = -float("inf") vbm_kpoint = None cbm = float("inf")