pyscfad.dft.numint.NumInt.nr_uks#

NumInt.nr_uks(mol, grids, xc_code, dms, relativity=0, hermi=1, max_memory=2000, verbose=None)[source]#

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

Args:

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.

dmsa list of 2D arrays

A list of density matrices, stored as (alpha,alpha,…,beta,beta,…)

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 (alpha,beta) electrons generated by numerical integration. excsum is the XC functional value. vmat is the XC potential matrix for (alpha,beta) spin.

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((2,nao,nao))
>>> ni = dft.numint.NumInt()
>>> nelec, exc, vxc = ni.nr_uks(mol, grids, 'lda,vwn', dm)