fcdmft.rpa.mp2.pbc.kqsmp2 module#

k-point spin-restricted quasiparticle self-consistent MP2

NOTE: this code has bugs in get_sigma_mp2 (off-diag self-energy)

class fcdmft.rpa.mp2.pbc.kqsmp2.KQSMP2(mf, ncore=None, ncut=None, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: KMP2

Attributes:
diis_file
e_tot
e_tot_scs
emp2
emp2_scs
nmo
nocc

Methods

__call__(*args, **kwargs)

Update the attributes of the current object.

apply(fn, *args, **kwargs)

Apply the fn to rest arguments: return fn(*args, **kwargs). The return value of method set is the object itself. This allows a series of functions/methods to be executed in pipe.

as_scanner()

Generating a scanner/solver for MP2 PES.

check_sanity()

Check input of class/object attributes, check whether a class method is overwritten.

copy()

Returns a shallow copy

energy(t2, eris)

MP2 energy

get_frozen_mask()

Boolean mask for orbitals in k-point post-HF method.

get_nmo([per_kpoint])

Number of orbitals for k-point calculations.

get_nocc([per_kpoint])

Number of occupied orbitals for k-point calculations.

kernel([mo_energy, mo_coeff])

Args:

make_fno([thresh, pct_occ, nvir_act, t2])

Frozen natural orbitals

make_rdm1([t2, kind])

Spin-traced one-particle density matrix in the MO basis representation.

make_rdm2([t2, kind])

Spin-traced two-particle density matrix in MO basis

post_kernel(envs)

A hook to be run after the main body of the kernel function.

pre_kernel(envs)

A hook to be run before the main body of kernel function is executed.

run(*args, **kwargs)

Call the kernel function of current object.

set(*args, **kwargs)

Update the attributes of the current object.

to_gpu([out])

Convert a method to its corresponding GPU variant, and recursively converts all attributes of a method to cupy objects or gpu4pyscf objects.

update_amps(t2, eris)

Update non-canonical MP2 amplitudes

view(cls)

New view of object with the same attributes.

ao2mo

density_fit

dump_flags

get_e_hf

init_amps

nuc_grad_method

reset

run_diis

set_frozen

diis_file = None#
diis_space = 10#
diis_start_cycle = 1#
dump_flags()[source]#
get_frozen_mask()#

Boolean mask for orbitals in k-point post-HF method.

Creates a boolean mask to remove frozen orbitals and keep other orbitals for post-HF calculations.

Args:

mp (MP2): An instantiation of an SCF or post-Hartree-Fock object.

Returns:

moidx (list of ndarray of bool): Boolean mask of orbitals to include.

get_nmo(per_kpoint=False)#

Number of orbitals for k-point calculations.

Number of orbitals for use in a calculation with k-points, taking into account frozen orbitals.

Note:

If per_kpoint is False, then the number of orbitals here is equal to max(nocc) + max(nvir), where each max is done over all k-points. Otherwise the number of orbitals is returned as a list of number of orbitals at each k-point.

Args:

mp (MP2): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of orbitals at each k-point.

For a description of False, see Note.

Returns:
nmo (int, list of int): Number of orbitals. For return type, see description of arg

per_kpoint.

get_nocc(per_kpoint=False)#

Number of occupied orbitals for k-point calculations.

Number of occupied orbitals for use in a calculation with k-points, taking into account frozen orbitals.

Args:

mp (MP2): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of occupied

orbitals at each k-point. False gives the max of this list.

Returns:
nocc (int, list of int): Number of occupied orbitals. For return type, see description of arg

per_kpoint.

kernel(mo_energy=None, mo_coeff=None)[source]#
Args:

mo_energy : 2D array (nkpts, nmo), mean-field mo energy mo_coeff : 3D array (nkpts, nmo, nmo), mean-field mo coefficient

Returns:

self.mo_energy : QSMP2 quasiparticle energy self.mo_coeff : QSMP2 mo_coeff

property nmo#
property nocc#
run_diis(ham, istep, adiis)[source]#
fcdmft.rpa.mp2.pbc.kqsmp2.get_g0(omega, mo_energy, eta)[source]#
fcdmft.rpa.mp2.pbc.kqsmp2.get_sigma_mp2(mp2, kp, p, q, ep, eq=None)[source]#

Compute KMP2 self-energy in MO basis on real axis

fcdmft.rpa.mp2.pbc.kqsmp2.kernel(mp2, mo_energy, mo_coeff)[source]#

QSMP2-corrected quasiparticle orbital energies

Parameters:
mp2MP2 object
mo_energydouble array

molecular orbital energies

mo_coeffdouble ndarray

molecular orbital coefficients

Returns:
convbool

whether the quasiparticle equation is converged

mo_energydouble array

MP2-corrected quasiparticle orbital energies

mo_coeffdouble ndarray

MP2-corrected quasiparticle orbital coefficients