Example #1
0
    def get_transitions(self, initial = 'full', final = 'empty',set_scissor = None, set_gap = None, set_direct_gap = None):
        """
        Compute the (vertical) transitions energies. For each kpoint compute the transition energies, i.e.
        the (positive) energy difference (in eV) between the final and the initial states.

        Args:
            initial (string or list) : specifies the bands from which electrons can be extracted. It can be set to `full` or
                `empty` to select the occupied or empty bands, respectively. Otherwise a list of bands can be
                provided
            final  (string or list) : specifies the final bands of the excited electrons. It can be set to `full` or
                `empty` to select the occupied or empty bands, respectively. Otherwise a list of bands can be
                provided
            set_scissor (:py:class:`float`) : set the value of the scissor (in eV) that is added to the empty bands.
                If a scissor is provided the set_gap and set_direct_gap parameters are ignored
            set_gap (:py:class:`float`) : set the value of the gap (in eV) of the system. If set_gap is provided
                the set_direct_gap parameter is ignored
            set_direct_gap (:py:class:`float`) : set the value of the direct gap (in eV) of the system.

        Return:
            :py:class:`numpy.array`  : an array with the transition energies for each kpoint

        """
        transitions = U.get_transitions(self.evals,self.nbands,self.nbands_full,initial=initial,final=final,
                      set_scissor=set_scissor,set_gap=set_gap,set_direct_gap=set_direct_gap)
        return transitions
Example #2
0
    def eval_reciprocal_lattice_volume(self, rescale = False):
        """
        Compute the volume of the reciprocal lattice. If ``rescale`` is True the reciprocal lattice vectors are expressed
        in units of 2*np.pi/alat.

        Returns:
            :py:class:`float` : reciprocal lattice volume

        """
        lattice = self.get_reciprocal_lattice(rescale=rescale)
        return U.eval_lattice_volume(lattice)
Example #3
0
    def eval_lattice_volume(self, rescale = False):
        """
        Compute the volume of the direct lattice. If ``rescale`` is False the results is expressed in a.u., otherwise
            the lattice vectors are expressed in units of alat.

        Returns:
            :py:class:`float` : lattice volume

        """
        lattice = self.get_lattice(rescale=rescale)
        return U.eval_lattice_volume(lattice)
Example #4
0
    def get_gap(self, verbose = True):
        """
        Compute the energy gap of the system (in eV). The method check if the gap is direct or
        indirect. Implemented and tested only for semiconductors.

        Return:
            :py:class:`dict` : a dictionary with the values of direct and indirect gaps and the positions
            of the VMB and CBM

        """
        gap = U.get_gap(self.evals,self.nbands_full,verbose=verbose)
        return gap
Example #5
0
    def get_lattice(self, rescale = False):
        """
        Compute the lattice vectors. If rescale = True the vectors are expressed in units
        of the lattice constant.

        Args:
            rescale (:py:class:`bool`)  : if True express the lattice vectors in units alat

        Returns:
            :py:class:`array` : array with the lattice vectors a_i as rows

        """
        return U.get_lattice(self.lattice,self.alat,rescale=rescale)
Example #6
0
    def get_reciprocal_lattice(self, rescale = False):
        """
        Compute the reciprocal lattice vectors. If rescale = False the vectors are normalized
        so that np.dot(a_i,b_j) = 2*np.pi*delta_ij, where a_i is a basis vector of the direct
        lattice. If rescale = True the reciprocal lattice vectors are expressed in units of
        2*np.pi/alat.

        Args:
            rescale (:py:class:`bool`)  : if True express the reciprocal vectors in units of 2*np.pi/alat

        Returns:
            :py:class:`array` : array with the reciprocal lattice vectors b_i as rows

        """
        return U.get_reciprocal_lattice(self.lattice,self.alat,rescale=rescale)
Example #7
0
    def get_evals(self, set_scissor = None, set_gap = None, set_direct_gap = None, verbose = True):
        """
        Return the ks energies for each kpoint (in eV). The top of the valence band is used as the
        reference energy value. It is possible to shift the energies of the empty bands by setting an arbitrary
        value for the gap (direct or indirect) or by adding an explicit scissor. Implemented only for semiconductors.

        Args:
            set_scissor (:py:class:`float`) : set the value of the scissor (in eV) that is added to the empty bands.
                If a scissor is provided the set_gap and set_direct_gap parameters are ignored
            set_gap (:py:class:`float`) : set the value of the gap (in eV) of the system. If set_gap is provided
                the set_direct_gap parameter is ignored
            set_direct_gap (:py:class:`float`) : set the value of the direct gap (in eV) of the system.

        Return:
            :py:class:`numpy.array`  : an array with the ks energies for each kpoint

        """
        evals = U.get_evals(self.evals,self.nbands,self.nbands_full,
                set_scissor=set_scissor,set_gap=set_gap,set_direct_gap=set_direct_gap,verbose=verbose)
        return evals