def batch_nuc(mol, grid_coords, out=None): fakemol = gto.fakemol_for_charges(grid_coords) j3c = aux_e2(mol, fakemol, intor='int3c2e', aosym='s2ij', cintopt=cintopt) return lib.unpack_tril(j3c.T, out=out)
def init_prod_log_df(self, auxmol, sv, rcut_tol=1e-7): """ Initializes the radial functions from pyscf""" from pyscf.df.incore import aux_e2 self.init_log_mesh(sv.ao_log.rr, sv.ao_log.pp) self.auxmol = auxmol ao_log_c.__init__(self) self.init_ao_log_gto_lm(auxmol, sv, sv.ao_log, rcut_tol) j3c = aux_e2(sv.mol, auxmol, intor='cint3c2e_sph', aosym='s1') nao = sv.mol.nao_nr() naoaux = auxmol.nao_nr() j3c = j3c.reshape(nao,nao,naoaux) #print(nao, naoaux) return self
def get_gth_pp(mol): from pyscf.gto import ATOM_OF from pyscf.pbc.gto import Cell from pyscf.pbc.gto.pseudo import pp_int from pyscf.df import incore # Analytical integration for get_pp_loc_part1(cell). fakemol = pp_int.fake_cell_vloc(mol, 0) vpploc = 0 if fakemol.nbas > 0: charges = fakemol.atom_charges() atmlst = fakemol._bas[:, ATOM_OF] v = incore.aux_e2(mol, fakemol, 'int3c2e', aosym='s2', comp=1) v = numpy.einsum('...i,i->...', v, -charges[atmlst]) vpploc += lib.unpack_tril(v) # To compute the rest part of GTH PP, mimic the mol with a 0D cell. cell_0D = mol.view(Cell) cell_0D.dimension = 0 cell_0D.a = numpy.eye(3) vpploc += pp_int.get_pp_loc_part2(cell_0D).real vpploc += pp_int.get_pp_nl(cell_0D).real return vpploc
def get_gth_pp(mol): from pyscf.gto import ATOM_OF from pyscf.pbc.gto import Cell from pyscf.pbc.gto.pseudo import pp_int from pyscf.df import incore # Analytical integration for get_pp_loc_part1(cell). fakemol = pp_int.fake_cell_vloc(mol, 0) vpploc = 0 if fakemol.nbas > 0: charges = fakemol.atom_charges() atmlst = fakemol._bas[:,ATOM_OF] v = incore.aux_e2(mol, fakemol, 'int3c2e', aosym='s2', comp=1) v = numpy.einsum('...i,i->...', v, -charges[atmlst]) vpploc += lib.unpack_tril(v) # To compute the rest part of GTH PP, mimic the mol with a 0D cell. cell_0D = mol.view(Cell) cell_0D.dimension = 0 cell_0D.a = numpy.eye(3) vpploc += pp_int.get_pp_loc_part2(cell_0D).real vpploc += pp_int.get_pp_nl(cell_0D).real return vpploc