PAWpySeed: pawpyseed.core.projector.Projector Class Reference

PAWpySeed Parallel C/Python package for numerical analysis of PAW DFT wavefunctions

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
pawpyseed.core.projector.Projector Class Reference
Inheritance diagram for pawpyseed.core.projector.Projector:
[legend]
Collaboration diagram for pawpyseed.core.projector.Projector:
[legend]

## Public Member Functions
def | __init__ (self, wf, basis, unsym_basis=False, unsym_wf=False, pseudo=False)
def | make_site_lists (self)
def | setup_overlap (self)
def | single_band_projection (self, band_num)
def | proportion_conduction (self, band_num, spinpol=False)
def | defect_band_analysis (self, num_below_ef=20, num_above_ef=20, spinpol=False, return_energies=False, return_energy_list=False, vbmband=None)
def | free_all (self)
Public Member Functions inherited from pawpyseed.core.wavefunction.Wavefunction
def | __init__ (self, struct, pwf, cr, outcar, setup_projectors=False)
def | get_c_projectors_from_pps (self, pps)
def | make_c_projectors (self)
def | check_c_projectors (self)
def | get_state_realspace (self, b, k, s, dim=None)
def | write_state_realspace (self, b, k, s, fileprefix="", dim=None, return_wf=False)
def | write_density_realspace (self, filename="PYAECCAR", dim=None, return_wf=False)
def | get_symmops (self, symprec)
def | get_nosym_kpoints (self, init_kpts=None, symprec=1e-5, gen_trsym=True, fil_trsym=True)
def | get_kpt_mapping (self, allkpts, symprec=1e-5, gen_trsym=True)
def | kpts (self)
def | kws (self)
def | free_all (self)

## Static Public Member Functions
def | from_files (basis, struct="CONTCAR", pwf="WAVECAR", cr="POTCAR", vr="vasprun.xml", outcar="OUTCAR", unsym_basis=False, unsym_wf=False, pseudo=False)
def | from_directory (basis, path, unsym_basis=False, unsym_wf=False, pseudo=False)
def | setup_bases (basis_dirs, desymmetrize=True, atomate_compatible=True)
def | setup_multiple_projections (basis_dir, wf_dirs, pseudo=False, ignore_errors=False, desymmetrize=False, atomate_compatible=True)
Static Public Member Functions inherited from pawpyseed.core.wavefunction.Wavefunction
def | from_files (struct="CONTCAR", pwf="WAVECAR", cr="POTCAR", vr="vasprun.xml", outcar="OUTCAR", setup_projectors=False)
def | from_directory (path, setup_projectors=False)
def | from_atomate_directory (path, setup_projectors=False)

## Public Attributes
| structure
| pwf
| cr
| dim
| projector_owner
| projector_list
| nband
| nwk
| nspin
| nums
| coords
| basis
| wf
| encut
| num_proj_els
| freed
| pseudo
| site_cat
Public Attributes inherited from pawpyseed.core.wavefunction.Wavefunction
| structure
| pwf
| cr
| dim
| projector_owner
| projector_list
| nums
| coords
| nband
| nwk
| nspin
| encut
| num_proj_els
| freed
| nosym_kpts
| orig_kptnums
| op_nums
| symmops

## Constructor & Destructor Documentation

def pawpyseed.core.projector.Projector.__init__ | ( |  | self,
|  |  | wf,
|  |  | basis,
|  |  | unsym_basis = `False`,
|  |  | unsym_wf = `False`,
|  |  | pseudo = `False`
| ) |  |

    Projector is a class to projector KS states
    from wf onto the KS states of basis
    (both wavefunction objects). Projector extends
    Wavefunction, so a Projector is essentially
    a Wavefunction object that is set up to be
    projected onto basis.

    Arguments:
        wf (Wavefunction): The wavefunction objects whose
    bands are to be projected onto basis
        basis (Wavefunction): The wavefunction whose bands
    serve as the basis set for projection
        unsym_basis (bool, False): If True, makes a copy
    of basis in which the k-point mesh is not symmetrically
    reduced, and then frees the original basis
        unsym_wf (bool, False): If True, makes a copy of
    wf in which the k-point mesh is not symmetrically
    reduced, and the frees the original wf
        pseudo (bool, False): Whether the perform projections
    using only plane-wave coefficient components of the
    wavefunctions. Sacrifices orthogonalization and
    normalization for speed

    Returns:
        Projector object, containing all the same fields as
    wf but set up for projections onto basis

## Member Function Documentation

def pawpyseed.core.projector.Projector.defect_band_analysis | ( |  | self,
|  |  | num_below_ef = `20`,
|  |  | num_above_ef = `20`,
|  |  | spinpol = `False`,
|  |  | return_energies = `False`,
|  |  | return_energy_list = `False`,
|  |  | vbmband = `None`
| ) |  |

    Identifies a set of 'interesting' bands in a defect structure
    to analyze by choosing any band that is more than bound conduction
    and more than bound valence in the pseudoprojection scheme,
    and then fully analyzing these bands using single_band_projection

    Args:
        num_below_ef (int, 20): number of bands to analyze below the fermi level
        num_above_ef (int, 20): number of bands to analyze above the fermi level
        spinpol (bool, False): whether to return spin-polarized results (only allowed
    for spin-polarized DFT output)
        TODO: energy and vbmband docs (need to clean up energy return vals)

def pawpyseed.core.projector.Projector.free_all | ( |  | self | ) |

    Frees all of the C structures associated with the Wavefunction object.
    After being called, this object is not usable.

def pawpyseed.core.projector.Projector.from_directory | ( |  | basis,
|  |  | path,
|  |  | unsym_basis = `False`,
|  |  | unsym_wf = `False`,
|  |  | pseudo = `False`
| ) |  |
| static

    Assumes VASP output has the default filenames and is located
    in the directory specificed by path.
    Arguments:
        basis (Wavefunction): the basis Wavefunction
        path (str): path to the VASP calculation directory
        unsym_basis (bool, False): If True, makes a copy
    of basis in which the k-point mesh is not symmetrically
    reduced, and then frees the original basis
        unsym_wf (bool, False): If True, makes a copy of
    wf in which the k-point mesh is not symmetrically
    reduced, and the frees the original wf
        pseudo (bool, False): Whether the perform projections
    using only plane-wave coefficient components of the
    wavefunctions. Sacrifices orthogonalization and
    normalization for speed

    Returns:
        Projector object

def pawpyseed.core.projector.Projector.from_files | ( |  | basis,
|  |  | struct = `"CONTCAR"`,
|  |  | pwf = `"WAVECAR"`,
|  |  | cr = `"POTCAR"`,
|  |  | vr = `"vasprun.xml"`,
|  |  | outcar = `"OUTCAR"`,
|  |  | unsym_basis = `False`,
|  |  | unsym_wf = `False`,
|  |  | pseudo = `False`
| ) |  |
| static

    Construct a Projector object from file paths.
    Arguments:
        basis (Wavefunction): the basis Wavefunction
        struct (str): VASP POSCAR or CONTCAR file path
        pwf (str): VASP WAVECAR file path
        cr (str): VASP POTCAR file path
        vr (str): VASP vasprun file path
        outcar (str): VASP OUTCAR file path
        setup_basis (bool): whether to set up the basis
        unsym_basis (bool, False): If True, makes a copy
    of basis in which the k-point mesh is not symmetrically
    reduced, and then frees the original basis
        unsym_wf (bool, False): If True, makes a copy of
    wf in which the k-point mesh is not symmetrically
    reduced, and the frees the original wf
        pseudo (bool, False): Whether the perform projections
    using only plane-wave coefficient components of the
    wavefunctions. Sacrifices orthogonalization and
    normalization for speed

    Returns:
        Projector object

def pawpyseed.core.projector.Projector.make_site_lists | ( |  | self | ) |

    Organizes sites into sets for use in the projection scheme. M_R and M_S contain site indices
    of sites which are identical in structures R (basis) and S (self). N_R and N_S contain all other
    site indices, and N_RS contains pairs of indices in R and S with overlapping augmentation
    spheres in the PAW formalism.

    Returns:
        M_R (numpy array): Indices of sites in basis which have an identical site in
    S (self) (same element and position to within tolerance of 0.02 Angstroms).
        M_S (numpy array): Indices of sites in self which match sites in M_R
    (i.e. M_R[i] is an identical site to M_S[i])
        N_R (numpy array): Indices of sites in basis but not in M_R
        N_S (numpy array): Indices of sites in self but not in M_S
        N_RS (numpy array): Pairs of indices (one in basis and one in self) which
    are not identical but have overlapping augmentation regions

def pawpyseed.core.projector.Projector.proportion_conduction | ( |  | self,
|  |  | band_num,
|  |  | spinpol = `False`
| ) |  |

    Calculates the proportion of band band_num in self
    that projects onto the valence states and conduction
    states of self.basis (should be the bulk structure).
    Designed for analysis of point defect
    wavefunctions.

    Arguments:
        band_num (int): number of defect bands in self
        spinpol (bool, False): whether to return separate
    values of the projection for spin up and spin down

    Returns:
        v, c (int, int): The valence (v) and conduction (c)
    proportion of band band_num

def pawpyseed.core.projector.Projector.setup_bases | ( |  | basis_dirs,
|  |  | desymmetrize = `True`,
|  |  | atomate_compatible = `True`
| ) |  |
| static

    This function performs the setup of all the bases in the basis_dirs.
    After this function is called, pass the returned projector_list
    each time you call Projector with one of the wavefunctions in the
    basis_dirs list. Free projector_list after you are fully finished
    using the wavefunctions in basis_dirs for projections.

    Arguments:
        basis_dir (str): paths to the VASP outputs
    to be used as the basis structures
        desymmetrize (bool, False): If True, constructs
    Wavefunction objects in which the k-point mesh
    is not symmetrically reduced
        atomate_compatible (bool, True): If True, checks for the gzipped
    files created the atomate workflow tools and reads the most
    recent run based on title

    Returns:
        list of Wavefunction objects, each basis in the same
    order as the basis_dirs list

def pawpyseed.core.projector.Projector.setup_multiple_projections | ( |  | basis_dir,
|  |  | wf_dirs,
|  |  | pseudo = `False`,
|  |  | ignore_errors = `False`,
|  |  | desymmetrize = `False`,
|  |  | atomate_compatible = `True`
| ) |  |
| static

    A convenient generator function for processing the Kohn-Sham wavefunctions
    of multiple structures with respect to one structure used as the basis.
    All C memory is freed after each yield for the wavefunctions to be analyzed,
    and C memory associated with the basis wavefunction is freed when
    the generator is called after all wavefunctions have been yielded.

    Args:
        basis_dir (str): path to the VASP output to be used as the basis structure
        wf_dirs (list of str): paths to the VASP outputs to be analyzed
        ignore_errors (bool, False): whether to ignore errors in setting up
    Wavefunction objects by skipping over the directories for which
    setup fails.
        desymmetrize (bool, False): If True, constructs
    Wavefunction objects in which the k-point mesh
    is not symmetrically reduced
        atomate_compatible (bool, True): If True, checks for the gzipped
    files created the atomate workflow tools and reads the most
    recent run based on title

    Returns:
        list -- wf_dir, basis, wf
        Each iteration of the generator function returns a directory name from
        wf_dirs (wf_dir), the basis Wavefunction object (basis), and the Wavefunction
        object associated with wf_dir (wf), fully setup to project bands of wf
        onto bands of basis.

def pawpyseed.core.projector.Projector.setup_overlap | ( |  | self | ) |

    Evaluates projectors <p_i|psi>, as well
    as <(phi-phit)|psi> and <(phi_i-phit_i)|(phi_j-phit_j)>,
    when needed

def pawpyseed.core.projector.Projector.single_band_projection | ( |  | self,
|  |  | band_num
| ) |  |

    All electron projection of the band_num band of self
    onto all the bands of basis. Returned as a numpy array,
    with the overlap operator matrix elements ordered as follows:
    loop over band
        loop over spin
    loop over kpoint

    Arguments:
        band_num (int): band which is projected onto basis

    Returns:
        res (np.array): overlap operator expectation values
    as described above

## Member Data Documentation

pawpyseed.core.projector.Projector.basis

pawpyseed.core.projector.Projector.coords

pawpyseed.core.projector.Projector.cr

pawpyseed.core.projector.Projector.dim

pawpyseed.core.projector.Projector.encut

pawpyseed.core.projector.Projector.freed

pawpyseed.core.projector.Projector.nband

pawpyseed.core.projector.Projector.nspin

pawpyseed.core.projector.Projector.num_proj_els

pawpyseed.core.projector.Projector.nums

pawpyseed.core.projector.Projector.nwk

pawpyseed.core.projector.Projector.projector_list

pawpyseed.core.projector.Projector.projector_owner

pawpyseed.core.projector.Projector.pseudo

pawpyseed.core.projector.Projector.pwf

pawpyseed.core.projector.Projector.site_cat

pawpyseed.core.projector.Projector.structure

pawpyseed.core.projector.Projector.wf

The documentation for this class was generated from the following file:

- /home/kyle/Research/projects/pawpyseed/pawpyseed/core/projector.py