10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-10-20 06:48:20 +02:00
quantum_package/docs/source/modules/hartree_fock.rst

456 lines
8.7 KiB
ReStructuredText
Raw Normal View History

.. _hartree_fock:
.. program:: hartree_fock
.. default-role:: option
============
Hartree-Fock
============
The Hartree-Fock module performs *Restricted* Hartree-Fock calculations (the
spatial part of the |MOs| is common for alpha and beta spinorbitals).
The Hartree-Fock program does the following:
#. Compute/Read all the one- and two-electron integrals, and store them in memory
#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it
will read them as initial guess. Otherwise, it will create a guess.
#. Perform the |SCF| iterations
At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation
crashes for any unexpected reason, the calculation can be restarted by running again
the |SCF| with the same |EZFIO| database.
The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method.
If the |SCF| does not converge, try again with a higher value of :option:`level_shift`.
To start a calculation from scratch, the simplest way is to remove the
``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again.
.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS
.. _level-shifting: https://doi.org/10.1002/qua.560070407
EZFIO parameters
----------------
.. option:: max_dim_diis
2018-11-26 13:45:32 +01:00
Maximum size of the |DIIS| extrapolation procedure
2018-11-26 13:45:32 +01:00
Default: 15
.. option:: threshold_diis
2018-11-26 13:45:32 +01:00
Threshold on the convergence of the |DIIS| error vector during a Hartree-Fock calculation. If 0. is chosen, the square root of thresh_scf will be used.
2018-11-26 13:45:32 +01:00
Default: 0.
.. option:: thresh_scf
2018-11-26 13:45:32 +01:00
Threshold on the convergence of the Hartree Fock energy.
2018-11-26 13:45:32 +01:00
Default: 1.e-10
.. option:: n_it_scf_max
2018-11-26 13:45:32 +01:00
Maximum number of |SCF| iterations
2018-11-26 13:45:32 +01:00
Default: 500
.. option:: level_shift
2018-11-26 13:45:32 +01:00
Initial value of the energy shift on the virtual |MOs|
2018-11-26 13:45:32 +01:00
Default: 0.0
.. option:: scf_algorithm
2018-11-26 13:45:32 +01:00
Type of |SCF| algorithm used. Possible choices are [ Simple | DIIS]
2018-11-26 13:45:32 +01:00
Default: DIIS
.. option:: mo_guess_type
2018-11-26 13:45:32 +01:00
Initial MO guess. Can be [ Huckel | HCore ]
2018-11-26 13:45:32 +01:00
Default: Huckel
.. option:: energy
2018-11-26 13:45:32 +01:00
Calculated HF energy
.. option:: no_oa_or_av_opt
2018-11-26 13:45:32 +01:00
If |true|, skip the (inactive+core) --> (active) and the (active) --> (virtual) orbital rotations within the |SCF| procedure
2018-11-26 13:45:32 +01:00
Default: False
2018-11-25 14:59:02 +01:00
Providers
---------
2018-11-26 13:45:32 +01:00
.. c:var:: ao_bi_elec_integral_alpha
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: ao_bi_elec_integral_alpha (ao_num,ao_num)
double precision, allocatable :: ao_bi_elec_integral_beta (ao_num,ao_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Alpha Fock matrix in AO basis set
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: ao_bi_elec_integral_beta
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: ao_bi_elec_integral_alpha (ao_num,ao_num)
double precision, allocatable :: ao_bi_elec_integral_beta (ao_num,ao_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Alpha Fock matrix in AO basis set
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: eigenvalues_fock_matrix_ao
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num)
double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`diis.irp.f`
2018-11-26 13:45:32 +01:00
Eigenvalues and eigenvectors of the Fock matrix over the AO basis
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: eigenvectors_fock_matrix_ao
.. code:: text
double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num)
double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num)
2018-12-18 17:30:16 +01:00
File: :file:`diis.irp.f`
2018-11-26 13:45:32 +01:00
Eigenvalues and eigenvectors of the Fock matrix over the AO basis
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: eigenvectors_fock_matrix_mo
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: eigenvectors_fock_matrix_mo (ao_num,mo_tot_num)
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
File: :file:`diagonalize_fock.irp.f`
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
Eigenvector of the Fock matrix in the MO basis obtained with level shift.
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: extrapolate_fock_matrix
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
subroutine extrapolate_Fock_matrix( &
error_matrix_DIIS,Fock_matrix_DIIS, &
Fock_matrix_AO_,size_Fock_matrix_AO, &
iteration_SCF,dim_DIIS &
)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`roothaan_hall_scf.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Compute the extrapolated Fock matrix using the DIIS procedure
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_ao
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_ao (ao_num,ao_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Fock matrix in AO basis set
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_ao_alpha
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num)
double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Alpha Fock matrix in AO basis set
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_ao_beta
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num)
double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
Alpha Fock matrix in AO basis set
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_diag_mo
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_mo (mo_tot_num,mo_tot_num)
double precision, allocatable :: fock_matrix_diag_mo (mo_tot_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-26 13:45:32 +01:00
Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is
| F-K | F + K/2 | F | |---------------------------------| | F + K/2 | F | F - K/2 | |---------------------------------| | F | F - K/2 | F + K |
F = 1/2 (Fa + Fb)
K = Fb - Fa
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_mo
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_mo (mo_tot_num,mo_tot_num)
double precision, allocatable :: fock_matrix_diag_mo (mo_tot_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is
| F-K | F + K/2 | F | |---------------------------------| | F + K/2 | F | F - K/2 | |---------------------------------| | F | F - K/2 | F + K |
F = 1/2 (Fa + Fb)
K = Fb - Fa
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_mo_alpha
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_mo_alpha (mo_tot_num,mo_tot_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Fock matrix on the MO basis
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fock_matrix_mo_beta
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: fock_matrix_mo_beta (mo_tot_num,mo_tot_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Fock matrix on the MO basis
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: fps_spf_matrix_ao
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. code:: text
double precision, allocatable :: fps_spf_matrix_ao (AO_num,AO_num)
2018-12-18 17:30:16 +01:00
File: :file:`diis.irp.f`
2018-11-26 13:45:32 +01:00
Commutator FPS - SPF
.. c:var:: fps_spf_matrix_mo
2018-11-25 14:59:02 +01:00
.. code:: text
double precision, allocatable :: fps_spf_matrix_mo (mo_tot_num,mo_tot_num)
2018-12-18 17:30:16 +01:00
File: :file:`diis.irp.f`
2018-11-25 14:59:02 +01:00
Commutator FPS - SPF in MO basis
2018-11-26 13:45:32 +01:00
.. c:var:: hf_density_matrix_ao
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision, allocatable :: hf_density_matrix_ao (ao_num,ao_num)
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`hf_density_matrix_ao.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
S^{-1}.P.S^{-1} where P = C.C^t
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: hf_density_matrix_ao_alpha
2018-11-25 14:59:02 +01:00
.. code:: text
double precision, allocatable :: hf_density_matrix_ao_alpha (ao_num,ao_num)
2018-12-18 17:30:16 +01:00
File: :file:`hf_density_matrix_ao.irp.f`
2018-11-25 14:59:02 +01:00
S^{-1}.P_alpha.S^{-1}
2018-11-26 13:45:32 +01:00
.. c:var:: hf_density_matrix_ao_beta
2018-11-25 14:59:02 +01:00
.. code:: text
double precision, allocatable :: hf_density_matrix_ao_beta (ao_num,ao_num)
2018-12-18 17:30:16 +01:00
File: :file:`hf_density_matrix_ao.irp.f`
2018-11-25 14:59:02 +01:00
S^{-1}.P_beta.S^{-1}
2018-11-26 13:45:32 +01:00
.. c:var:: hf_energy
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision :: hf_energy
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`fock_matrix.irp.f`
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Hartree-Fock energy
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:var:: threshold_diis_nonzero
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
double precision :: threshold_diis_nonzero
2018-12-18 17:30:16 +01:00
File: :file:`diis.irp.f`
2018-11-26 13:45:32 +01:00
If threshold_DIIS is zero, choose sqrt(thresh_scf)
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
Subroutines / functions
-----------------------
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:function:: create_guess
2018-11-25 14:59:02 +01:00
.. code:: text
2018-11-26 13:45:32 +01:00
subroutine create_guess
2018-11-25 14:59:02 +01:00
2018-12-18 17:30:16 +01:00
File: :file:`scf.irp.f`
2018-11-26 13:45:32 +01:00
Create a MO guess if no MOs are present in the EZFIO directory
2018-11-25 14:59:02 +01:00
2018-11-26 13:45:32 +01:00
.. c:function:: huckel_guess
.. code:: text
subroutine huckel_guess
File: :file:`huckel.irp.f`
Build the MOs using the extended Huckel model
.. c:function:: roothaan_hall_scf
.. code:: text
subroutine Roothaan_Hall_SCF
2018-12-18 17:30:16 +01:00
File: :file:`roothaan_hall_scf.irp.f`
2018-11-26 13:45:32 +01:00
Roothaan-Hall algorithm for SCF Hartree-Fock calculation
.. c:function:: run
.. code:: text
subroutine run
2018-12-18 17:30:16 +01:00
File: :file:`scf.irp.f`
2018-11-26 13:45:32 +01:00
Run SCF calculation
.. c:function:: scf
.. code:: text
subroutine scf
2018-12-18 17:30:16 +01:00
File: :file:`scf.irp.f`
2018-11-26 13:45:32 +01:00
Produce `Hartree_Fock` MO orbital output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: hartree_fock.energy optional: mo_basis.mo_coef
2018-11-25 14:59:02 +01:00