pyscfad.pbc.dft.numint.NumInt.nr_rks#

NumInt.nr_rks(cell, grids, xc_code, dms, hermi=0, kpt=array([0., 0., 0.]), kpts_band=None, max_memory=2000, verbose=None)[source]#

Calculate RKS XC functional and potential matrix on given meshgrids for a set of density matrices

Args:

ni : an instance of NumInt

mol : an instance of Mole

gridsan instance of Grids

grids.coords and grids.weights are needed for coordinates and weights of meshgrids.

xc_codestr

XC functional description. See parse_xc() of pyscf/dft/libxc.py for more details.

dms2D array or a list of 2D arrays

Density matrix or multiple density matrices

Kwargs:
hermiint

Input density matrices symmetric or not. It also indicates whether the potential matrices in return are symmetric or not.

max_memoryint or float

The maximum size of cache to use (in MB).

Returns:

nelec, excsum, vmat. nelec is the number of electrons generated by numerical integration. excsum is the XC functional value. vmat is the XC potential matrix in 2D array of shape (nao,nao) where nao is the number of AO functions.

Examples:

>>> from pyscf import gto, dft
>>> mol = gto.M(atom='H 0 0 0; H 0 0 1.1')
>>> grids = dft.gen_grid.Grids(mol)
>>> grids.coords = numpy.random.random((100,3))  # 100 random points
>>> grids.weights = numpy.random.random(100)
>>> nao = mol.nao_nr()
>>> dm = numpy.random.random((nao,nao))
>>> ni = dft.numint.NumInt()
>>> nelec, exc, vxc = ni.nr_rks(mol, grids, 'lda,vwn', dm)