PAWpySeed
Parallel C/Python package for numerical analysis of PAW DFT wavefunctions
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pawpyseed.core.projector.Projector Class Reference
Inheritance diagram for pawpyseed.core.projector.Projector:
Inheritance graph
[legend]
Collaboration diagram for pawpyseed.core.projector.Projector:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, wf, basis, unsym_basis=False, unsym_wf=False, method="aug_real")
 
def make_site_lists (self)
 
def setup_overlap (self)
 
def single_band_projection (self, band_num, kwargs)
 
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, vbmband=None, band_list=None, analyze_all=False)
 

Static Public Member Functions

def setup_bases (basis_dirs, desymmetrize=True, atomate_compatible=True)
 
def setup_multiple_projections (basis_dir, wf_dirs, method="aug_real", ignore_errors=False, desymmetrize=False, atomate_compatible=True)
 

Public Attributes

 method
 
 site_cat
 

Static Public Attributes

list METHODS = ["pseudo", "realspace", "aug_recip", "aug_real"]
 

Detailed Description

Projector is a class to project KS states
from wf onto the KS states of basis
(both wavefunction objects).

Attributes:
    wf (Wavefunction): Wavefunction object
    basis (Wavefunction): Wavefunction object onto which the
        wavefunctions of wf are to be projected
    method (str): The method used to perform the projections.
        'aug_real' (default): Filter high-frequency components out
            of the partial waves and then project them onto
            the pseudo wavefunctions in real space inside
            the augmentation spheres
        'aug_recip': Filter high-frequency components out of
            the partial waves, then sum all the partial wave components
            in real space on the FFT grid. Fourier transform
            the result and project it onto the pseudowavefunctions
            in reciprocal space.
        'realspace': Project the full wavefunctions onto realspace
            grids, then integrate over real space.
        'pseudo': Perform projections
            using only plane-wave coefficient components of the
            wavefunctions (pseudo wavefunctions).
            Sacrifices orthogonalization and
            normalization for speed. Not recommended except for
            very rough, qualitative informtation.

Constructor & Destructor Documentation

def pawpyseed.core.projector.Projector.__init__ (   self,
  wf,
  basis,
  unsym_basis = False,
  unsym_wf = False,
  method = "aug_real" 
)
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
    method (str, "aug_recip"): Options: "pseudo", "realspace", "aug_recip", "aug_real";
The method to use for the projections. See method
options in the Attributes section.

Returns:
    Projector object

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,
  vbmband = None,
  band_list = None,
  analyze_all = False 
)
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.
NOTE: ALL BANDS ARE ZERO-INDEXED!

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)
    return_energies (bool, False): whether to return the energy levels
of the bands analyzed in the form
{band : [kpoint label: {spin label: (energy, occupation)}},
where the kpoint label and spin label are integers
    vbmband (int, None): Optionally allows a VBM band number to be specified.
If None, the VBM of wf is determined and used.
    band_list (list of int, None): If not None, overrides num_below_ef,
num_above_ef, and vbmband. Specifies the set of bands to analyze.
    analyze_all (bool, False): If True, overrides num_below_ef,
num_above_ef, vbmband, and band_list. Whether to perform
analysis on all bands in wf
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. R si for self.basis, S is for self.wf

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 convenience function performs the setup
of all the bases in the basis_dirs list.

Arguments:
    basis_dir (list of 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,
  method = "aug_real",
  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 by 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,
  kwargs 
)
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:
    (np.array): overlap operator expectation values
as described above

Example:
    # Get overlap of band b0, k-point k, spin s (0 or 1 index)
    # of wf with band b, k-point k, spin s of basis
    # <basis;b,k,s|wf;b0,k,s>
    >>> pr = Projector(wf, basis)
    >>> res = pr.single_band_projection(b0)
    >>> print(res[b*pr.nwk*pr.nspin + s*pr.nwk + k])

Member Data Documentation

pawpyseed.core.projector.Projector.method
list pawpyseed.core.projector.Projector.METHODS = ["pseudo", "realspace", "aug_recip", "aug_real"]
static
pawpyseed.core.projector.Projector.site_cat

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