![]() |
Implementation of the objective function code for Restricted Hartree-Fock
openfermion.hamiltonians.HartreeFockFunctional(
*,
one_body_integrals: np.ndarray = 'rhf',
two_body_integrals: np.ndarray = 0.0,
overlap: np.ndarray = None,
n_electrons: int,
model='rhf',
nuclear_repulsion: Optional[float] = 0.0,
initial_orbitals: Optional[Union[None, Callable]] = None
)
The object transforms a variety of input types into the appropriate output. It does this by analyzing the type and size of the input based on its knowledge of each type.
Args | |
---|---|
one_body_integrals
|
integrals in the atomic orbital basis for the one-body potential. |
two_body_integrals
|
integrals in the atomic obrital basis for the two-body potential ordered according to phi{p}(r1)^{*}phi{q}^{*}(r2) x phi{r}(r2)phi{s}(r1) |
overlap
|
overlap integrals in the atomic orbital basis |
n_electrons
|
number of electrons total |
model
|
Optional flag for performing restricted-, unrestricted-, or generalized- hartree-fock. |
nuclear_repulsion
|
Optional nuclear repulsion term. Energy is shifted by this amount. default is 0. |
initial_orbitals
|
Method for producing the initial orbitals from the atomic orbitals. Default is defining the core orbitals. |
Methods
energy_from_rhf_opdm
energy_from_rhf_opdm(
opdm_aa: np.ndarray
) -> float
Compute the energy given a spin-up opdm
Args | |
---|---|
opdm_aa
|
spin-up opdm. Should be an n x n matrix where n is the number of spatial orbitals |
Returns: RHF energy
rdms_from_rhf_opdm
rdms_from_rhf_opdm(
opdm_aa: np.ndarray
) -> openfermion.ops.InteractionRDM
Generate spin-orbital InteractionRDM object from the alpha-spin opdm.
Args | |
---|---|
opdm_aa
|
single spin sector of the 1-particle denstiy matrix |
Returns: InteractionRDM object for full spin-orbital 1-RDM and 2-RDM
rhf_global_gradient
rhf_global_gradient(
params: np.ndarray,
alpha_opdm: np.ndarray
)
Compute rhf global gradient
Args | |
---|---|
params
|
rhf-parameters for rotation matrix. |
alpha_opdm
|
1-RDM corresponding to results of basis rotation parameterized by `params'. |
Returns: gradient vector the same size as the input `params'