pyscfad.scf.hf.kernel#

pyscfad.scf.hf.kernel(mf, conv_tol=1e-10, conv_tol_grad=None, dump_chk=True, dm0=None, callback=None, conv_check=True, **kwargs)[source]#

kernel: the SCF driver.

Args:
mfan instance of SCF class

mf object holds all parameters to control SCF. One can modify its member functions to change the behavior of SCF. The member functions which are called in kernel are

mf.get_init_guess
mf.get_hcore
mf.get_ovlp
mf.get_veff
mf.get_fock
mf.get_grad
mf.eig
mf.get_occ
mf.make_rdm1
mf.energy_tot
mf.dump_chk
Kwargs:
conv_tolfloat

converge threshold.

conv_tol_gradfloat

gradients converge threshold.

dump_chkbool

Whether to save SCF intermediate results in the checkpoint file

dm0ndarray

Initial guess density matrix. If not given (the default), the kernel takes the density matrix generated by mf.get_init_guess.

callbackfunction(envs_dict) => None

callback function takes one dict as the argument which is generated by the builtin function locals(), so that the callback function can access all local variables in the current environment.

sap_basisstr

SAP basis name

Returns:

A list : scf_conv, e_tot, mo_energy, mo_coeff, mo_occ

scf_convbool

True means SCF converged

e_totfloat

Hartree-Fock energy of last iteration

mo_energy1D float array

Orbital energies. Depending the eig function provided by mf object, the orbital energies may NOT be sorted.

mo_coeff2D array

Orbital coefficients.

mo_occ1D array

Orbital occupancies. The occupancies may NOT be sorted from large to small.

Examples:

>>> from pyscf import gto, scf
>>> mol = gto.M(atom='H 0 0 0; H 0 0 1.1', basis='cc-pvdz')
>>> conv, e, mo_e, mo, mo_occ = scf.hf.kernel(scf.hf.SCF(mol), dm0=numpy.eye(mol.nao_nr()))
>>> print('conv = %s, E(HF) = %.12f' % (conv, e))
conv = True, E(HF) = -1.081170784378