Exemplo n.º 1
0
Arquivo: hf.py Projeto: berquist/pyscf
def get_hcore(cell, kpt=np.zeros(3)):
    """Get the core Hamiltonian AO matrix.
    """
    hcore = get_t(cell, kpt)
    if cell.pseudo:
        hcore += get_pp(cell, kpt)
    else:
        hcore += get_nuc(cell, kpt)

    return hcore
Exemplo n.º 2
0
def get_hcore(cell, kpt=np.zeros(3)):
    '''Get the core Hamiltonian AO matrix.
    '''
    hcore = get_t(cell, kpt)
    if cell.pseudo:
        hcore += get_pp(cell, kpt)
    else:
        hcore += get_nuc(cell, kpt)

    return hcore
Exemplo n.º 3
0
Arquivo: hf.py Projeto: sunqm/pyscf
def get_hcore(cell, kpt=np.zeros(3)):
    '''Get the core Hamiltonian AO matrix.
    '''
    hcore = get_t(cell, kpt)
    if cell.pseudo:
        hcore += get_pp(cell, kpt)
    else:
        hcore += get_nuc(cell, kpt)
    if len(cell._ecpbas) > 0:
        hcore += ecp.ecp_int(cell, kpt)
    return hcore
Exemplo n.º 4
0
    def frag_vnuc_loc(self, impAtom):
        '''
        get fragment Vnuc
        '''

        mol = self.frag_mol_ao(impAtom)
        if not mol.pseudo: raise Exception("no pseudo-potential applied")

        vnuc_ao = get_pp(mol, np.zeros(3))  #gamma point
        vnuc_loc = reduce(np.dot, (self.ao2loc.T, vnuc_ao, self.ao2loc))
        return vnuc_loc
Exemplo n.º 5
0
    def test_pp(self):
        cell = pbcgto.Cell()
        cell.verbose = 0
        cell.atom = 'C 0 0 0; C 1 1 1; C 0 2 2; C 2 0 2'
        cell.h = np.diag([4, 4, 4])
        cell.basis = 'gth-szv'
        cell.pseudo = 'gth-pade'
        cell.gs = [10, 10, 10]
        cell.build()

        np.random.seed(1)
        k = np.random.random(3)
        v0 = get_pp(cell, k)
        v1 = pseudo.get_pp(cell, k)
        self.assertAlmostEqual(np.linalg.norm(v0-v1), 0, 8)
Exemplo n.º 6
0
    def test_pp(self):
        cell = pbcgto.Cell()
        cell.verbose = 0
        cell.atom = 'C 0 0 0; C 1 1 1; C 0 2 2; C 2 0 2'
        cell.h = np.diag([4, 4, 4])
        cell.basis = 'gth-szv'
        cell.pseudo = 'gth-pade'
        cell.gs = [10, 10, 10]
        cell.build()

        np.random.seed(1)
        k = np.random.random(3)
        v0 = get_pp(cell, k)
        v1 = pseudo.get_pp(cell, k)
        self.assertAlmostEqual(np.linalg.norm(v0 - v1), 0, 8)
Exemplo n.º 7
0
    def bound_vnuc_sub(self, boundary_atoms, loc2sub, numActive):

        vnuc_sub = np.zeros((numActive, numActive), dtype=float)
        if (boundary_atoms is None):
            return vnuc_sub
        else:
            mol = self.bound_mol_ao(boundary_atoms)
            if not mol.pseudo: raise Exception("no pseudo-potential applied")

            vnuc_ao = get_pp(mol, np.zeros(3))  #gamma point
            vnuc_loc = reduce(np.dot, (self.ao2loc.T, vnuc_ao, self.ao2loc))
            vnuc_sub = reduce(
                np.dot,
                (loc2sub[:, :numActive].T, vnuc_loc, loc2sub[:, :numActive]))
            return vnuc_sub