jarvis.io.vasp.outputs ====================== .. py:module:: jarvis.io.vasp.outputs .. autoapi-nested-parse:: Modulet for analzing VASP outputs. Attributes ---------- .. autoapisummary:: jarvis.io.vasp.outputs.RYTOEV jarvis.io.vasp.outputs.AUTOA jarvis.io.vasp.outputs.TPI jarvis.io.vasp.outputs.HSQDTM Classes ------- .. autoapisummary:: jarvis.io.vasp.outputs.Chgcar jarvis.io.vasp.outputs.Locpot jarvis.io.vasp.outputs.Oszicar jarvis.io.vasp.outputs.Outcar jarvis.io.vasp.outputs.Waveder jarvis.io.vasp.outputs.Wavecar jarvis.io.vasp.outputs.Vasprun Functions --------- .. autoapisummary:: jarvis.io.vasp.outputs.parse_raman_dat Module Contents --------------- .. py:data:: RYTOEV :value: 13.605826 .. py:data:: AUTOA :value: 0.529177249 .. py:data:: TPI .. py:data:: HSQDTM :value: 3.8100198740807945 .. py:class:: Chgcar(filename='', atoms=None, chg=[], chgdif=None, aug=None, augdiff=None, dim=None, nsets=1, lines='') Bases: :py:obj:`object` Class handling VASP CHGCAR file data. .. py:attribute:: filename :value: '' .. py:attribute:: atoms :value: None .. py:attribute:: chg :value: [] .. py:attribute:: dim :value: None .. py:attribute:: chgdif :value: None .. py:attribute:: aug :value: None .. py:attribute:: augdiff :value: None .. py:attribute:: nsets :value: 1 .. py:attribute:: lines :value: '' .. py:method:: to_dict() Convert to a dictionary. .. py:method:: from_dict(d={}) :classmethod: Construct class from a dictionary. .. py:method:: is_spin_polarized() Check if the calculations is spin-polarized, ISPIN=2. .. py:method:: is_spin_orbit() Check if the calculations is spin-orbit, LSORBIT=T. .. py:method:: modify_grid(chg_set=0, multiply_volume=True, final_grid=[50, 50, 50], write_file=True, filename='New_CHGCAR') Modify grid and Write a charge set to a file for visualization. .. py:method:: read_file(lines='') Read CHGCAR. .. py:method:: chg_set(text, start, end, volume, ng) Return CHGCAR sets. .. py:class:: Locpot(filename='', atoms=None, chg=[], chgdif=None, aug=None, augdiff=None, dim=None, nsets=1, lines='') Bases: :py:obj:`Chgcar` Read LOCPOT files. .. py:method:: vac_potential(direction='X', Ef=0, cbm=0, vbm=0, filename='Avg.png', use_ase=False, plot=True) Calculate vacuum potential used in work-function calculation. .. py:class:: Oszicar(filename, data={}) Bases: :py:obj:`object` Construct Oszicar object. .. py:attribute:: filename .. py:attribute:: data .. py:method:: from_dict(d={}) :classmethod: Construct class from a dictionary. .. py:method:: to_dict() Convert class to a dictionary. .. py:property:: magnetic_moment Get magnetic moment. .. py:property:: ionic_steps Get all ionic steps realted data. .. py:property:: electronic_steps Get all electronic steps realted data. .. py:class:: Outcar(filename, data={}) Bases: :py:obj:`object` Construct OUTCAR object. .. py:attribute:: filename .. py:attribute:: data .. py:method:: from_dict(d={}) :classmethod: Construct class from a dictionary. .. py:method:: to_dict() Convert class to a dictionary. .. py:property:: nions Get number of ions. .. py:property:: nbands Get number of bands. .. py:property:: nedos Get number of dos points. .. py:property:: efermi Get Fermi energy. .. py:method:: all_structures(elements=[]) Get all structure snapshots. .. py:property:: all_band_energies Get all band energies. .. py:property:: bandgap Get bandgap. .. py:method:: magnetization(dir='x', elements=[]) Get magnetization in x,y,z. .. py:method:: total_charge(elements=[]) Get total charge. .. py:property:: nelect Get number of electrons. .. py:property:: phonon_eigenvalues Get phonon eigenvalues. .. py:property:: converged Check if calculation is converged. .. py:method:: efg_tensor_diag(std_conv=True, prec=3) Get diagonalized electric field gradient tensor. .. py:property:: efg_raw_tensor Get raw electric field gradient tensor. .. py:property:: quad_mom Get quadrupole momemnt. .. py:property:: piezoelectric_tensor Get piezoelectric tensor. .. py:method:: freq_dielectric_tensor() Parse dielectric function. .. py:method:: elastic_props(atoms=None, vacuum=False) Obtain elastic tensor and calculate related properties. For 3D and 2D cases. Args: outcar: OUTCAR file path vacuum: whether the structure has vaccum such as 2D materials for vacuum structures bulk and shear mod. Needs extra attention and elastic tensor are in Nm^-1 rather than GPa Returns: info: data for elastic tensor (in string and object representation), bulk, shear modulus, and phonon modes .. py:class:: Waveder(filename, gamma_only=False) Bases: :py:obj:`object` Class for reading a WAVEDER file. The LOPTICS tag produces a WAVEDER file. The WAVEDER contains the derivative of the orbitals with respect to k. .. py:property:: cder_data Return the orbital derivative between states. .. py:property:: nbands Return the number of bands in the calculation. .. py:property:: nkpoints Return the number of k-points in the calculation. .. py:property:: nelect Return the number of electrons in the calculation. .. py:method:: get_orbital_derivative_between_states(band_i, band_j, kpoint, spin, cart_dir) Return a valuebetween bands band_i and band_j. For k-point index, spin-channel and cartesian direction. Args: band_i (Integer): Index of band i band_j (Integer): Index of band j kpoint (Integer): Index of k-point spin (Integer): Index of spin-channel (0 or 1) cart_dir (Integer): Index of cartesian direction (0,1,2) Returns: a float value .. py:class:: Wavecar(filename='WAVECAR', lsorbit=False, lgamma=False, recl=None, nspin=None, rtag=None, nkpts=None, nbands=None, encut=None, lattice_mat=None, nplws=None, wfc=None, efermi=None, kvecs=None, energies=None, occs=None, gvec=None) Bases: :py:obj:`object` Class for VASP Pseudowavefunction stored in WAVECAR. The format of VASP WAVECAR, as shown in http://www.andrew.cmu.edu/user/feenstra/wavetrans/ is: Record-length #spin components RTAG(a value specifying the precision) #k-points #bands ENCUT(maximum energy for plane waves) LatVec-A LatVec-B LatVec-C Loop over spin Loop over k-points #plane waves, k vector Loop over bands band energy, band occupation End loop over bands Loop over bands Loop over plane waves Plane-wave coefficient End loop over plane waves End loop over bands End loop over k-points End loop over spin .. py:attribute:: _filename :value: 'WAVECAR' .. py:attribute:: _lsoc :value: False .. py:attribute:: _lgam :value: False .. py:attribute:: _recl :value: None .. py:attribute:: _nspin :value: None .. py:attribute:: _rtag :value: None .. py:attribute:: _nkpts :value: None .. py:attribute:: _nbands :value: None .. py:attribute:: _encut :value: None .. py:attribute:: _lattice_mat :value: None .. py:attribute:: _nplws :value: None .. py:attribute:: _efermi :value: None .. py:attribute:: _kvecs :value: None .. py:attribute:: _energies :value: None .. py:attribute:: _occs :value: None .. py:attribute:: _gvec :value: None .. py:method:: isSocWfc() Check if the WAVECAR is from an SOC calculation. .. py:method:: readWFHeader() Read the system information from WAVECAR. It is written in the first two record. rec1: recl, nspin, rtag rec2: nkpts, nbands, encut, ((cell(i,j) i=1, 3), j=1, 3) .. py:method:: setWFPrec() Set wavefunction coefficients precision. TAG = 45200: single precision complex, np.complex64, or complex(qs) TAG = 45210: double precision complex, np.complex128, or complex(q) .. py:method:: readWFBand(ispin=1, ikpt=1, iband=1) Extract KS energies and Fermi occupations from WAVECAR. .. py:method:: gvectors(ikpt=1) Generate the G-vectors. satisfies the following relation (G + k)**2 / 2 < ENCUT .. py:method:: readBandCoeff(ispin=1, ikpt=1, iband=1, norm=False) Read the planewave coefficients of specified KS states. .. py:method:: whereRec(ispin=1, ikpt=1, iband=1) Return the rec position for specified KS state. .. py:method:: checkIndex(ispin, ikpt, iband) Check if the index is valid. .. py:class:: Vasprun(filename='vasprun.xml', data={}) Bases: :py:obj:`object` Construct vasprun.xml handling object. .. py:attribute:: _filename :value: 'vasprun.xml' .. py:attribute:: _data .. py:attribute:: ionic_steps :value: None .. py:attribute:: electronic_steps :value: None .. py:attribute:: input_parameters :value: None .. py:method:: from_dict(d={}) :classmethod: Construct class from a dictionary. .. py:method:: to_dict() Convert class to a dictionary. .. py:method:: xml_to_dict() Convert XML to dictionary. .. py:property:: final_energy Get final energy. .. py:property:: nbands Get number of electronic bands. .. py:property:: nkpoints Get number of kpoints. .. py:property:: nspins Get total numnber of spins. .. py:property:: efermi Get Fermi-energy. .. py:property:: num_atoms Get number of simulation atoms. .. py:property:: num_types Get number of atom types. .. py:property:: dielectric_loptics Get real and imag. dielectric function data. .. py:property:: avg_absorption_coefficient Get average absoprtion coefficient. Used in solar-cell module. .. py:method:: phonon_data(fc_mass=True) Get phonon data. .. py:property:: converged_electronic Check whether electronically converged. .. py:property:: converged_ionic Check whether ionically converged. .. py:property:: converged Check whether both electronically and ionically converged. .. py:property:: dfpt_data Get DFPT IBRION=8 LEPSILON lated data. .. py:property:: get_dir_gap Get direct bandgap. .. py:property:: get_indir_gap Get indirect bandgap. .. py:method:: bandgap_occupation_tol(occu_tol=0.1) Get bandgap based on occupation tolerance. .. py:property:: fermi_velocities Get fermi velocities in m/s. .. py:property:: elements Get atom elements. .. py:method:: vrun_structure_to_atoms(s={}) Convert structure to Atoms object. .. py:property:: all_energies Get all total energies. .. py:property:: is_spin_polarized Check if the calculation is spin polarized. .. py:property:: is_spin_orbit Check if the calculation is spin orbit. .. py:property:: all_structures Get all structures. .. py:property:: eigenvalues Get all eigenvalues. .. py:property:: all_forces Get all forces. .. py:property:: all_stresses Get all stresses. .. py:property:: all_input_parameters Get all explicit input parameters. Need to add a few more. .. py:property:: kpoints Get Kpoints. .. py:method:: get_bandstructure(E_low=-4, E_high=4, spin=0, zero_efermi=True, kpoints_file_path='KPOINTS', plot=False, filename=None) Get electronic bandstructure plot. .. py:property:: total_dos Get total density of states. .. py:property:: partial_dos_spdf Get partial density of states. .. py:property:: projected_spins_kpoints_bands Use for spin, kpoint and band projected bandstructure plots. .. py:property:: projected_atoms_spins_kpoints_bands Use for atom,spin,kpoint and band projected bandstructures. .. py:method:: get_spdf_dos(plot=False) Get spdf resolved partial density of states. .. py:method:: get_atom_resolved_dos(plot=False) Get atom resolved density of states. .. py:function:: parse_raman_dat(vasp_raman_path='RAMANDIR-bulk@JVASP-1002_mp-149/vasp_raman.dat') Parse vasp_raman.dat . generated by https://github.com/raman-sc/VASP Activities to Intensities: J. At. Mol. Sci. 3 (2012) 1-22 Intensity = const0 * (nu0-nu)**4/nu * 1/(1-exp(-h*c*nu/(kB*T))) * activity Data for computing intensities, as in Materials Project's paper: T=300K, nu0=18796.9925 cm-1