# hartree_fock

The scf program performs Restricted Hartree-Fock calculations (the spatial part of the MOs is common for alpha and beta spinorbitals).

The Hartree-Fock algorithm is a SCF and therefore is based on the module_scf_utils` module.

The Fock matrix is defined in `hartree_fock fock_matrix_hf.irp.f`.

## EZFIO parameters

`energy```

  Energy HF

## Programs

> - scf

## Providers

`ao_two_e_integral_alpha`

  File : `hartree_fock/fock_matrix_hf.irp.f`

      double precision, allocatable   :: ao_two_e_integral_alpha      (ao_num,ao_num)
      double precision, allocatable   :: ao_two_e_integral_beta       (ao_num,ao_num)

  Alpha Fock matrix in AO basis set

  Needs:

  `ao_coef_normalized_ordered_transp` `ao_expo_ordered_transp` `ao_integrals_map` `ao_integrals_threshold` `ao_nucl` `ao_num` | `ao_overlap_abs` `ao_power` `ao_prim_num` `ao_two_e_integral_schwartz` `ao_two_e_integrals_in_map` | `do_direct_integrals` `n_pt_max_integrals` `nucl_coord` `scf_density_matrix_ao_alpha` `scf_density_matrix_ao_beta`

  Needed by:

  `fock_matrix_ao_alpha` | `hf_energy` |

`ao_two_e_integral_beta`

  File : `hartree_fock/fock_matrix_hf.irp.f`

      double precision, allocatable   :: ao_two_e_integral_alpha      (ao_num,ao_num)
      double precision, allocatable   :: ao_two_e_integral_beta       (ao_num,ao_num)

  Alpha Fock matrix in AO basis set

  Needs:

  `ao_coef_normalized_ordered_transp` `ao_expo_ordered_transp` `ao_integrals_map` `ao_integrals_threshold` `ao_nucl` `ao_num` | `ao_overlap_abs` `ao_power` `ao_prim_num` `ao_two_e_integral_schwartz` `ao_two_e_integrals_in_map` | `do_direct_integrals` `n_pt_max_integrals` `nucl_coord` `scf_density_matrix_ao_alpha` `scf_density_matrix_ao_beta`

  Needed by:

  `fock_matrix_ao_alpha` | `hf_energy` |

`extra_e_contrib_density`

  File : `hartree_fock/hf_energy.irp.f`

      double precision        :: extra_e_contrib_density

  Extra contribution to the SCF energy coming from the density.

  For a Hartree-Fock calculation: extra_e_contrib_density = 0

  For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - trace of the V_xc potential

  Needed by:

  `scf_energy` |  |

`fock_matrix_ao_alpha`

  File : `hartree_fock/fock_matrix_hf.irp.f`

      double precision, allocatable   :: fock_matrix_ao_alpha (ao_num,ao_num)
      double precision, allocatable   :: fock_matrix_ao_beta  (ao_num,ao_num)

  Alpha Fock matrix in AO basis set

  Needs:

  `ao_num` | `ao_one_e_integrals` | `ao_two_e_integral_alpha`

  Needed by:

  `fock_matrix_ao` `fock_matrix_mo_alpha` | `fock_matrix_mo_beta` | `scf_energy`

`fock_matrix_ao_beta`

  File : `hartree_fock/fock_matrix_hf.irp.f`

      double precision, allocatable   :: fock_matrix_ao_alpha (ao_num,ao_num)
      double precision, allocatable   :: fock_matrix_ao_beta  (ao_num,ao_num)

  Alpha Fock matrix in AO basis set

  Needs:

  `ao_num` | `ao_one_e_integrals` | `ao_two_e_integral_alpha`

  Needed by:

  `fock_matrix_ao` `fock_matrix_mo_alpha` | `fock_matrix_mo_beta` | `scf_energy`

`hf_energy`

  File : `hartree_fock/hf_energy.irp.f`

      double precision        :: hf_energy
      double precision        :: hf_two_electron_energy
      double precision        :: hf_one_electron_energy

  Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components.

  Needs:

  `ao_num` `ao_one_e_integrals` | `ao_two_e_integral_alpha` `nuclear_repulsion` | `scf_density_matrix_ao_alpha` `scf_density_matrix_ao_beta`

`hf_one_electron_energy`

  File : `hartree_fock/hf_energy.irp.f`

      double precision        :: hf_energy
      double precision        :: hf_two_electron_energy
      double precision        :: hf_one_electron_energy

  Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components.

  Needs:

  `ao_num` `ao_one_e_integrals` | `ao_two_e_integral_alpha` `nuclear_repulsion` | `scf_density_matrix_ao_alpha` `scf_density_matrix_ao_beta`

`hf_two_electron_energy`

  File : `hartree_fock/hf_energy.irp.f`

      double precision        :: hf_energy
      double precision        :: hf_two_electron_energy
      double precision        :: hf_one_electron_energy

  Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components.

  Needs:

  `ao_num` `ao_one_e_integrals` | `ao_two_e_integral_alpha` `nuclear_repulsion` | `scf_density_matrix_ao_alpha` `scf_density_matrix_ao_beta`

## Subroutines / functions

`create_guess:`()

  File : `hartree_fock/scf.irp.f`

      subroutine create_guess

  Create a MO guess if no MOs are present in the EZFIO directory

  Needs:

  `ezfio_filename` `mo_coef` | `mo_guess_type` `mo_one_e_integrals` | `ao_ortho_lowdin_coef` `mo_label`

  Called by:

  `scf()` |  |

  Calls:

  `ezfio_has_mo_basis_mo_coef()` | `huckel_guess()` | `mo_as_eigvectors_of_mo_matrix()`

  Touches:

  `fock_matrix_ao_alpha` `fock_matrix_ao_alpha` | `mo_coef` | `mo_label`

`run:`()

  File : `hartree_fock/scf.irp.f`

      subroutine run

  Run SCF calculation

  Needs:

  `scf_energy` | `mo_label` |

  Called by:

  `pt2()` | `scf()` |

  Calls:

  `ezfio_set_hartree_fock_energy()` | `roothaan_hall_scf()` |

  Touches:

  `fock_matrix_ao_alpha` `fock_matrix_ao_alpha` | `mo_coef` `level_shift` | `mo_coef`