xi.py
def compute_xi(iscf, fscf):
    """ 
    compute the xi matrix using two given scfs
    """

    if userin.scf_type == 'shirley_xas':

        # The pseudo part: xi_{mn}^PS = < nk | B_j > < B_j | ~ B_i > < ~ B_i | ~mk >
        # xi      = iscf.obf.eigvec.H * fscf.obf.overlap * fscf.obf.eigvec # All 3 must be sp.matrix
        xi      = iscf.obf.eigvec[:, : iscf.nbnd_use].H \
                * fscf.obf.overlap \
                * fscf.obf.eigvec[:, : fscf.nbnd_use]

        # PAW corrections:
        # \sum_{I, l, l'} < nk | beta_Il > S_ll' < ~beta_Il' | ~mk >
        proj_offset = 0
        proj = fscf.proj

        if userin.do_paw_correction:
            # loop over species first, then loop over atoms within each species
            # just to respect the order as in Qespresso/shirley_xas
            for I in range(proj.natom):
                atom_name   = proj.atomic_pos[I][0]
                s           = proj.ind[atom_name]
                nprojs      = proj.nprojs[s]
                full_sij    = proj.full_sij[s]
                proj_range  = slice(proj_offset, proj_offset + nprojs)
                xi          += iscf.proj.beta_nk[proj_range, : iscf.nbnd_use].H \
                            * full_sij \
                            * fscf.proj.beta_nk[proj_range, : fscf.nbnd_use]
                proj_offset += nprojs

        xi      = xi.T # fscf.nbnd_use x iscf.nbnd_use. This is important !

        return xi

    return None
 
    compute the xi matrix using two given scfs
    
compute the xi matrix using two given scfs
compute the xi matrix using two given scfs
def compute_xi(iscf, fscf):
    if userin.scf_type == 'shirley_xas':
        xi      = iscf.obf.eigvec[:, : iscf.nbnd_use].H \
                * fscf.obf.overlap \
                * fscf.obf.eigvec[:, : fscf.nbnd_use]
        proj_offset = 0
        proj = fscf.proj
        if userin.do_paw_correction:
            for I in range(proj.natom):
                atom_name   = proj.atomic_pos[I][0]
                s           = proj.ind[atom_name]
                nprojs      = proj.nprojs[s]
                full_sij    = proj.full_sij[s]
                proj_range  = slice(proj_offset, proj_offset + nprojs)
                xi          += iscf.proj.beta_nk[proj_range, : iscf.nbnd_use].H \
                            * full_sij \
                            * fscf.proj.beta_nk[proj_range, : fscf.nbnd_use]
                proj_offset += nprojs
        xi      = xi.T 
        return xi
    return None
def compute_xi ( iscf , fscf ) : if userin . scf_type == 'shirley_xas' : xi = iscf . obf . eigvec [ : , : iscf . nbnd_use ] . H * fscf . obf . overlap * fscf . obf . eigvec [ : , : fscf . nbnd_use ] proj_offset = 0 proj = fscf . proj if userin . do_paw_correction : for I in range ( proj . natom ) : atom_name = proj . atomic_pos [ I ] [ 0 ] s = proj . ind [ atom_name ] nprojs = proj . nprojs [ s ] full_sij = proj . full_sij [ s ] proj_range = slice ( proj_offset , proj_offset + nprojs ) xi += iscf . proj . beta_nk [ proj_range , : iscf . nbnd_use ] . H * full_sij * fscf . proj . beta_nk [ proj_range , : fscf . nbnd_use ] proj_offset += nprojs xi = xi . T return xi return None
compute the xi matrix using two given scfs
compute the xi matrix using two given scfs
""" 
    compute the xi matrix using two given scfs
    """ # The pseudo part: xi_{mn}^PS = < nk | B_j > < B_j | ~ B_i > < ~ B_i | ~mk > # xi      = iscf.obf.eigvec.H * fscf.obf.overlap * fscf.obf.eigvec # All 3 must be sp.matrix # PAW corrections: # \sum_{I, l, l'} < nk | beta_Il > S_ll' < ~beta_Il' | ~mk > # loop over species first, then loop over atoms within each species # just to respect the order as in Qespresso/shirley_xas # fscf.nbnd_use x iscf.nbnd_use. This is important !
iscf
fscf