View source on GitHub |
Implementation of the objective function code for Restricted Hartree-Fock
openfermion.hamiltonians.HartreeFockFunctional(
*,
one_body_integrals: np.ndarray,
two_body_integrals: np.ndarray,
overlap: np.ndarray,
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.
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'