pyscf.pbc.grad package#

Submodules#

pyscf.pbc.grad.krhf module#

Non-relativistic analytical nuclear gradients for restricted Hartree Fock with kpoints sampling

class pyscf.pbc.grad.krhf.Gradients(method)[source]#

Bases: GradientsBase

Non-relativistic restricted Hartree-Fock gradients

as_scanner()#

Generating a nuclear gradients scanner/solver (for geometry optimizer).

The returned solver is a function. This function requires one argument “cell” as input and returns energy and first order nuclear derivatives.

The solver will automatically use the results of last calculation as the initial guess of the new calculation. All parameters assigned in the nuc-grad object and SCF object (DIIS, conv_tol, max_memory etc) are automatically applied in the solver.

Note scanner has side effects. It may change many underlying objects (_scf, with_df, with_x2c, …) during calculation.

extra_force(atom_id, envs)[source]#

Hook for extra contributions in analytical gradients.

Contributions like the response of auxiliary basis in density fitting method, the grid response in DFT numerical integration can be put in this function.

get_veff(dm=None, kpts=None)[source]#
grad_elec(mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None)#

Electronic part of KRHF/KRKS gradients Args:

mf_grad : pbc.grad.krhf.Gradients or pbc.grad.krks.Gradients object

kernel(mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None)[source]#

Kernel function is the main driver of a method. Every method should define the kernel function as the entry of the calculation. Note the return value of kernel function is not strictly defined. It can be anything related to the method (such as the energy, the wave-function, the DFT mesh grids etc.).

make_rdm1e(mo_energy=None, mo_coeff=None, mo_occ=None)[source]#
class pyscf.pbc.grad.krhf.GradientsBase(method)[source]#

Bases: GradientsBase

Basic nuclear gradient functions for non-relativistic methods

get_hcore(cell=None, kpts=None)[source]#
get_j(dm=None, kpts=None)[source]#
get_jk(dm=None, kpts=None)[source]#

J = ((-nabla i) j| kl) D_lk K = ((-nabla i) j| kl) D_jk

get_k(dm=None, kpts=None, kpts_band=None)[source]#
get_ovlp(cell=None, kpts=None)[source]#
grad_nuc(cell=None, atmlst=None)[source]#
hcore_generator(cell=None, kpts=None)#
class pyscf.pbc.grad.krhf.SCF_GradScanner(g)[source]#

Bases: GradScanner

pyscf.pbc.grad.krhf.as_scanner(mf_grad)[source]#

Generating a nuclear gradients scanner/solver (for geometry optimizer).

The returned solver is a function. This function requires one argument “cell” as input and returns energy and first order nuclear derivatives.

The solver will automatically use the results of last calculation as the initial guess of the new calculation. All parameters assigned in the nuc-grad object and SCF object (DIIS, conv_tol, max_memory etc) are automatically applied in the solver.

Note scanner has side effects. It may change many underlying objects (_scf, with_df, with_x2c, …) during calculation.

pyscf.pbc.grad.krhf.get_hcore(cell, kpts)[source]#

Part of the nuclear gradients of core Hamiltonian

pyscf.pbc.grad.krhf.get_j(mf_grad, dm, kpts)[source]#
pyscf.pbc.grad.krhf.get_jk(mf_grad, dm, kpts)[source]#

J = ((-nabla i) j| kl) D_lk K = ((-nabla i) j| kl) D_jk

pyscf.pbc.grad.krhf.get_k(mf_grad, dm, kpts)[source]#
pyscf.pbc.grad.krhf.get_ovlp(cell, kpts)[source]#
pyscf.pbc.grad.krhf.get_veff(mf_grad, dm, kpts)[source]#

NR Hartree-Fock Coulomb repulsion

pyscf.pbc.grad.krhf.grad_elec(mf_grad, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None)[source]#

Electronic part of KRHF/KRKS gradients Args:

mf_grad : pbc.grad.krhf.Gradients or pbc.grad.krks.Gradients object

pyscf.pbc.grad.krhf.grad_nuc(cell, atmlst)[source]#

Derivatives of nuclear repulsion energy wrt nuclear coordinates

Notes:

An optimized version of this function is available in pbc.gto.ewald_methods.ewald_nuc_grad

pyscf.pbc.grad.krhf.hcore_generator(mf, cell=None, kpts=None)[source]#
pyscf.pbc.grad.krhf.make_rdm1e(mo_energy, mo_coeff, mo_occ)[source]#

Energy weighted density matrix

pyscf.pbc.grad.krks module#

Non-relativistic analytical nuclear gradients for restricted Kohn Sham with kpoints sampling

class pyscf.pbc.grad.krks.Gradients(mf)[source]#

Bases: Gradients

dump_flags(verbose=None)[source]#
get_veff(dm=None, kpts=None)#
pyscf.pbc.grad.krks.get_veff(ks_grad, dm=None, kpts=None)[source]#
pyscf.pbc.grad.krks.get_vxc(ni, cell, grids, xc_code, dms, kpts, kpts_band=None, relativity=0, hermi=1, max_memory=2000, verbose=None)[source]#

pyscf.pbc.grad.kuhf module#

Non-relativistic analytical nuclear gradients for unrestricted Hartree Fock with kpoints sampling

class pyscf.pbc.grad.kuhf.Gradients(method)[source]#

Bases: Gradients

Non-relativistic restricted Hartree-Fock gradients

get_veff(dm=None, kpts=None)[source]#
grad_elec(mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None)#

Electronic part of KRHF/KRKS gradients Args:

mf_grad : pbc.grad.krhf.Gradients or pbc.grad.krks.Gradients object

make_rdm1e(mo_energy=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.grad.kuhf.get_veff(mf_grad, dm, kpts)[source]#

NR Hartree-Fock Coulomb repulsion

pyscf.pbc.grad.kuhf.grad_elec(mf_grad, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None)[source]#
pyscf.pbc.grad.kuhf.make_rdm1e(mo_energy, mo_coeff, mo_occ)[source]#

Energy weighted density matrix

pyscf.pbc.grad.kuks module#

Non-relativistic analytical nuclear gradients for unrestricted Kohn Sham with kpoints sampling

class pyscf.pbc.grad.kuks.Gradients(mf)[source]#

Bases: Gradients

Non-relativistic restricted Hartree-Fock gradients

get_veff(dm=None, kpts=None)#
pyscf.pbc.grad.kuks.get_veff(ks_grad, dm=None, kpts=None)[source]#
pyscf.pbc.grad.kuks.get_vxc(ni, cell, grids, xc_code, dms, kpts, kpts_band=None, relativity=0, hermi=1, max_memory=2000, verbose=None)[source]#

pyscf.pbc.grad.rhf module#

class pyscf.pbc.grad.rhf.Gradients(method)[source]#

Bases: GradientsBase

Non-relativistic Gamma-point restricted Hartree-Fock gradients

get_veff(mol=None, dm=None, kpt=array([0., 0., 0.]))[source]#
grad_elec(mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None, kpt=array([0., 0., 0.]))#
make_rdm1e(mo_energy=None, mo_coeff=None, mo_occ=None)[source]#
class pyscf.pbc.grad.rhf.GradientsBase(method)[source]#

Bases: GradientsBase

Base class for Gamma-point nuclear gradient

get_ovlp(mol=None, kpt=array([0., 0., 0.]))[source]#
grad_nuc(mol=None, atmlst=None)[source]#
pyscf.pbc.grad.rhf.get_ovlp(cell, kpt=array([0., 0., 0.]))[source]#
pyscf.pbc.grad.rhf.get_veff(mf_grad, mol, dm, kpt=array([0., 0., 0.]))[source]#
pyscf.pbc.grad.rhf.grad_elec(mf_grad, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None, kpt=array([0., 0., 0.]))[source]#
pyscf.pbc.grad.rhf.grad_nuc(cell, atmlst=None, ew_eta=None, ew_cut=None)[source]#

pyscf.pbc.grad.rks module#

class pyscf.pbc.grad.rks.Gradients(method)[source]#

Bases: Gradients

Non-relativistic Gamma-point restricted Kohn-Sham DFT gradients

pyscf.pbc.grad.uhf module#

class pyscf.pbc.grad.uhf.Gradients(method)[source]#

Bases: GradientsBase

Non-relativistic Gamma-point restricted Hartree-Fock gradients

get_veff(mol=None, dm=None, kpt=array([0., 0., 0.]))[source]#
grad_elec(mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None, kpt=array([0., 0., 0.]))#
make_rdm1e(mo_energy=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.grad.uhf.get_veff(mf_grad, mol, dm, kpt=array([0., 0., 0.]))[source]#
pyscf.pbc.grad.uhf.grad_elec(mf_grad, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None, kpt=array([0., 0., 0.]))[source]#

pyscf.pbc.grad.uks module#

class pyscf.pbc.grad.uks.Gradients(method)[source]#

Bases: Gradients

Non-relativistic Gamma-point unrestricted Kohn-Sham DFT gradients

Module contents#

Analytical nuclear gradients for PBC