10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-09-27 03:51:01 +02:00

gitignore files

This commit is contained in:
Anthony Scemama 2018-12-25 19:24:43 +01:00
parent ea6afea0a9
commit d292f00154
15 changed files with 3295 additions and 4 deletions

View File

@ -7,16 +7,22 @@ tags
Makefile
ao_basis
ao_one_e_integrals
ao_two_e_erf_integrals
ao_two_e_integrals
becke_numerical_grid
aux_quantities
becke_numerical_grid
bitmask
cis
cisd
davidson
davidson_dressed
davidson_undressed
density_for_dft
determinants
dft_keywords
dft_utils_in_r
dft_utils_one_e
dft_utils_two_body
dressing
dummy
electrons
@ -25,11 +31,13 @@ fci
generators_cas
generators_full
hartree_fock
integrals_bielec
iterations
kohn_sham
kohn_sham_rs
mo_basis
mo_guess
mo_one_e_integrals
mo_two_e_erf_integrals
mo_two_e_integrals
mpi
mrpt_utils
@ -38,6 +46,7 @@ perturbation
pseudo
psiref_cas
psiref_utils
scf_utils
selectors_cassd
selectors_full
selectors_utils
@ -46,4 +55,3 @@ slave
tools
utils
zmq

View File

@ -0,0 +1,37 @@
.. _aux_quantities:
.. program:: aux_quantities
.. default-role:: option
============
Data energy and density
============
This module contains some global variables (such as densities and energies) which are stored in the EZFIO folder in a different place than determinants. This is used in practice to store density matrices which can be obtained from any methods, as long as they are stored in the same MO basis which is used for the calculations. In |RS-DFT| calculations, this can be done to perform damping on the density in order to speed up convergence.
EZFIO parameters
----------------
.. option:: data_energy_var
Variational energy computed with the wave function
.. option:: data_energy_proj
Projected energy computed with the wave function
.. option:: data_one_body_alpha_dm_mo
Alpha one body density matrix on the MO basis computed with the wave function
.. option:: data_one_body_beta_dm_mo
Beta one body density matrix on the MO basis computed with the wave function

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,349 @@
.. _kohn_sham:
.. program:: kohn_sham
.. default-role:: option
============
Kohn-Sham
============
The Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the
spatial part of the |MOs| is common for alpha and beta spinorbitals).
The Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure.
It performs the following actions:
#. 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
The definition of the Fock matrix is in :file:`kohn_sham fock_matrix_ks.irp.f`
For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options.
The main are:
# :option:`scf_utils thresh_scf`
# :option:`scf_utils level_shift`
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
Providers
---------
.. c:var:: ao_bi_elec_integral_alpha
.. code:: text
double precision, allocatable :: ao_bi_elec_integral_alpha (ao_num,ao_num)
double precision, allocatable :: ao_bi_elec_integral_beta (ao_num,ao_num)
File: :file:`fock_matrix_ks.irp.f`
Alpha Fock matrix in ao basis set
.. c:var:: ao_bi_elec_integral_beta
.. code:: text
double precision, allocatable :: ao_bi_elec_integral_alpha (ao_num,ao_num)
double precision, allocatable :: ao_bi_elec_integral_beta (ao_num,ao_num)
File: :file:`fock_matrix_ks.irp.f`
Alpha Fock matrix in ao basis set
.. c:var:: ao_potential_alpha_xc
.. code:: text
double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num)
double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num)
File: :file:`pot_functionals.irp.f`
.. c:var:: ao_potential_beta_xc
.. code:: text
double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num)
double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num)
File: :file:`pot_functionals.irp.f`
.. c:var:: e_correlation_dft
.. code:: text
double precision :: e_correlation_dft
File: :file:`pot_functionals.irp.f`
.. c:var:: e_exchange_dft
.. code:: text
double precision :: e_exchange_dft
File: :file:`pot_functionals.irp.f`
.. c:var:: extra_e_contrib_density
.. code:: text
double precision :: extra_e_contrib_density
File: :file:`ks_enery.irp.f`
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 - 1/2 trace of the V_xc potential
.. c:var:: fock_matrix_alpha_no_xc_ao
.. code:: text
double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num)
double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num)
File: :file:`fock_matrix_ks.irp.f`
Mono electronic an Coulomb matrix in ao basis set
.. c:var:: fock_matrix_ao_alpha
.. code:: text
double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num)
double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num)
File: :file:`fock_matrix_ks.irp.f`
Alpha Fock matrix in ao basis set
.. c:var:: fock_matrix_ao_beta
.. code:: text
double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num)
double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num)
File: :file:`fock_matrix_ks.irp.f`
Alpha Fock matrix in ao basis set
.. c:var:: fock_matrix_beta_no_xc_ao
.. code:: text
double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num)
double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num)
File: :file:`fock_matrix_ks.irp.f`
Mono electronic an Coulomb matrix in ao basis set
.. c:var:: fock_matrix_energy
.. code:: text
double precision :: ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
File: :file:`ks_enery.irp.f`
Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity.
.. c:var:: ks_energy
.. code:: text
double precision :: ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
File: :file:`ks_enery.irp.f`
Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity.
.. c:var:: one_electron_energy
.. code:: text
double precision :: ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
File: :file:`ks_enery.irp.f`
Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity.
.. c:var:: trace_potential_xc
.. code:: text
double precision :: ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
File: :file:`ks_enery.irp.f`
Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity.
.. c:var:: two_electron_energy
.. code:: text
double precision :: ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
File: :file:`ks_enery.irp.f`
Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity.
Subroutines / functions
-----------------------
.. c:function:: check_coherence_functional
.. code:: text
subroutine check_coherence_functional
File: :file:`ks_scf.irp.f`
.. c:function:: create_guess
.. code:: text
subroutine create_guess
File: :file:`ks_scf.irp.f`
Create a MO guess if no MOs are present in the EZFIO directory
.. c:function:: run
.. code:: text
subroutine run
File: :file:`ks_scf.irp.f`
Run SCF calculation
.. c:function:: srs_ks_cf
.. code:: text
subroutine srs_ks_cf
File: :file:`ks_scf.irp.f`
Produce `Kohn_Sham` 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: kohn_sham.energy optional: mo_basis.mo_coef

View File

@ -0,0 +1,68 @@
.. _kohn_sham_rs:
.. program:: kohn_sham_rs
.. default-role:: option
=========================
Range-separated Kohn-Sham
=========================
The Range-separated Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the
spatial part of the |MOs| is common for alpha and beta spinorbitals) where the coulomb interaction is partially treated using exact exchange.
The splitting of the interaction between long- and short-range is determined by the range-separation parameter :option:`ao_two_e_erf_integrals mu_erf`. The long-range part of the interaction is explicitly treated with exact exchange, and the short-range part of the interaction is treated with appropriate DFT functionals.
The Range-separated Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure.
It performs the following actions:
#. 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
The definition of the Fock matrix is in :file:`kohn_sham_rs fock_matrix_rs_ks.irp.f`
For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options.
The main are:
# :option:`scf_utils thresh_scf`
# :option:`scf_utils level_shift`
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
Providers
---------
.. c:var:: rs_ks_energy
.. code:: text
double precision :: rs_ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
File: :file:`rs_ks_energy.irp.f`
Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity.

View File

@ -0,0 +1,510 @@
.. _mo_two_e_erf_integrals:
.. program:: mo_two_e_erf_integrals
.. default-role:: option
======================
mo_two_e_erf_integrals
======================
Here, all two-electron integrals (:math:`erf({\mu}_{erf} * r_{12})/r_{12}`) are computed.
As they have 4 indices and many are zero, they are stored in a map, as defined
in :file:`Utils/map_module.f90`.
The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_integrals mu_erf`.
To fetch an |MO| integral, use
`get_mo_bielec_integral_erf(i,j,k,l,mo_integrals_map_erf)`
The conventions are:
* For |MO| integrals : <ij|kl> = <12|12>
Be aware that it might not be the same conventions for |MO| and |AO| integrals.
EZFIO parameters
----------------
.. option:: disk_access_mo_integrals_erf
Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ]
Default: None
Providers
---------
.. c:var:: core_energy_erf
.. code:: text
double precision :: core_energy_erf
File: :file:`core_quantities_erf.irp.f`
energy from the core : contains all core-core contributionswith the erf interaction
.. c:var:: core_fock_operator_erf
.. code:: text
double precision, allocatable :: core_fock_operator_erf (mo_tot_num,mo_tot_num)
File: :file:`core_quantities_erf.irp.f`
this is the contribution to the Fock operator from the core electrons with the erf interaction
.. c:var:: insert_into_mo_integrals_erf_map
.. code:: text
subroutine insert_into_mo_integrals_erf_map(n_integrals, &
buffer_i, buffer_values, thr)
File: :file:`map_integrals_erf.irp.f`
Create new entry into MO map, or accumulate in an existing entry
.. c:var:: int_erf_3_index
.. code:: text
double precision, allocatable :: int_erf_3_index (mo_tot_num,mo_tot_num,mo_tot_num)
double precision, allocatable :: int_erf_3_index_exc (mo_tot_num,mo_tot_num,mo_tot_num)
File: :file:`ints_erf_3_index.irp.f`
int_erf_3_index(i,j) = <ij|ij> = (ii|jj) with the erf interaction
int_erf_3_index_exc(i,j) = <ij|ji> = (ij|ij) with the erf interaction
.. c:var:: int_erf_3_index_exc
.. code:: text
double precision, allocatable :: int_erf_3_index (mo_tot_num,mo_tot_num,mo_tot_num)
double precision, allocatable :: int_erf_3_index_exc (mo_tot_num,mo_tot_num,mo_tot_num)
File: :file:`ints_erf_3_index.irp.f`
int_erf_3_index(i,j) = <ij|ij> = (ii|jj) with the erf interaction
int_erf_3_index_exc(i,j) = <ij|ji> = (ij|ij) with the erf interaction
.. c:var:: mo_bielec_integrals_erf_in_map
.. code:: text
logical :: mo_bielec_integrals_erf_in_map
File: :file:`mo_bi_integrals_erf.irp.f`
If True, the map of MO bielectronic integrals is provided
.. c:var:: mo_integrals_erf_cache
.. code:: text
double precision, allocatable :: mo_integrals_erf_cache (0:64*64*64*64)
File: :file:`map_integrals_erf.irp.f`
Cache of MO integrals for fast access
.. c:var:: mo_integrals_erf_cache_max
.. code:: text
integer :: mo_integrals_erf_cache_min
integer :: mo_integrals_erf_cache_max
File: :file:`map_integrals_erf.irp.f`
Min and max values of the MOs for which the integrals are in the cache
.. c:var:: mo_integrals_erf_cache_min
.. code:: text
integer :: mo_integrals_erf_cache_min
integer :: mo_integrals_erf_cache_max
File: :file:`map_integrals_erf.irp.f`
Min and max values of the MOs for which the integrals are in the cache
.. c:var:: mo_integrals_erf_map
.. code:: text
type(map_type) :: mo_integrals_erf_map
File: :file:`map_integrals_erf.irp.f`
MO integrals
.. c:var:: mo_two_e_int_erf_jj
.. code:: text
double precision, allocatable :: mo_two_e_int_erf_jj (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_tot_num,mo_tot_num)
File: :file:`mo_bi_integrals_erf.irp.f`
mo_bielec_integral_jj(i,j) = J_ij mo_bielec_integral_jj_exchange(i,j) = K_ij mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij
.. c:var:: mo_two_e_int_erf_jj_anti
.. code:: text
double precision, allocatable :: mo_two_e_int_erf_jj (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_tot_num,mo_tot_num)
File: :file:`mo_bi_integrals_erf.irp.f`
mo_bielec_integral_jj(i,j) = J_ij mo_bielec_integral_jj_exchange(i,j) = K_ij mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij
.. c:var:: mo_two_e_int_erf_jj_anti_from_ao
.. code:: text
double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_tot_num,mo_tot_num)
File: :file:`mo_bi_integrals_erf.irp.f`
mo_bielec_integral_jj_from_ao(i,j) = J_ij mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij
.. c:var:: mo_two_e_int_erf_jj_exchange
.. code:: text
double precision, allocatable :: mo_two_e_int_erf_jj (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_tot_num,mo_tot_num)
File: :file:`mo_bi_integrals_erf.irp.f`
mo_bielec_integral_jj(i,j) = J_ij mo_bielec_integral_jj_exchange(i,j) = K_ij mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij
.. c:var:: mo_two_e_int_erf_jj_exchange_from_ao
.. code:: text
double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_tot_num,mo_tot_num)
File: :file:`mo_bi_integrals_erf.irp.f`
mo_bielec_integral_jj_from_ao(i,j) = J_ij mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij
.. c:var:: mo_two_e_int_erf_jj_from_ao
.. code:: text
double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_tot_num,mo_tot_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_tot_num,mo_tot_num)
File: :file:`mo_bi_integrals_erf.irp.f`
mo_bielec_integral_jj_from_ao(i,j) = J_ij mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij
.. c:var:: read_mo_integrals_erf
.. code:: text
logical :: read_mo_integrals_erf
logical :: write_mo_integrals_erf
File: :file:`read_write_erf.irp.f`
Flag to read or write the |MO| erf integrals
.. c:var:: write_mo_integrals_erf
.. code:: text
logical :: read_mo_integrals_erf
logical :: write_mo_integrals_erf
File: :file:`read_write_erf.irp.f`
Flag to read or write the |MO| erf integrals
Subroutines / functions
-----------------------
.. c:function:: add_integrals_to_map_erf
.. code:: text
subroutine add_integrals_to_map_erf(mask_ijkl)
File: :file:`mo_bi_integrals_erf.irp.f`
Adds integrals to tha MO map according to some bitmask
.. c:function:: clear_mo_erf_map
.. code:: text
subroutine clear_mo_erf_map
File: :file:`mo_bi_integrals_erf.irp.f`
Frees the memory of the MO map
.. c:function:: get_mo_bielec_integral_erf
.. code:: text
double precision function get_mo_bielec_integral_erf(i,j,k,l,map)
File: :file:`map_integrals_erf.irp.f`
Returns one integral <ij|kl> in the MO basis
.. c:function:: get_mo_bielec_integrals_erf
.. code:: text
subroutine get_mo_bielec_integrals_erf(j,k,l,sze,out_val,map)
File: :file:`map_integrals_erf.irp.f`
Returns multiple integrals <ij|kl> in the MO basis, all i for j,k,l fixed.
.. c:function:: get_mo_bielec_integrals_erf_coulomb_ii
.. code:: text
subroutine get_mo_bielec_integrals_erf_coulomb_ii(k,l,sze,out_val,map)
File: :file:`map_integrals_erf.irp.f`
Returns multiple integrals <ki|li> k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed.
.. c:function:: get_mo_bielec_integrals_erf_exch_ii
.. code:: text
subroutine get_mo_bielec_integrals_erf_exch_ii(k,l,sze,out_val,map)
File: :file:`map_integrals_erf.irp.f`
Returns multiple integrals <ki|il> k(1)i(2) 1/r12 i(1)l(2) :: out_val(i1) for k,l fixed.
.. c:function:: get_mo_bielec_integrals_erf_i1j1
.. code:: text
subroutine get_mo_bielec_integrals_erf_i1j1(k,l,sze,out_array,map)
File: :file:`map_integrals_erf.irp.f`
Returns multiple integrals <ik|jl> in the MO basis, all i(1)j(1) erf(mu_erf * r12) /r12 k(2)l(2) i, j for k,l fixed.
.. c:function:: get_mo_bielec_integrals_erf_ij
.. code:: text
subroutine get_mo_bielec_integrals_erf_ij(k,l,sze,out_array,map)
File: :file:`map_integrals_erf.irp.f`
Returns multiple integrals <ij|kl> in the MO basis, all i(1)j(2) 1/r12 k(1)l(2) i, j for k,l fixed.
.. c:function:: get_mo_erf_map_size
.. code:: text
integer*8 function get_mo_erf_map_size()
File: :file:`map_integrals_erf.irp.f`
Return the number of elements in the MO map
.. c:function:: load_mo_integrals_erf
.. code:: text
integer function load_mo_integrals_erf(filename)
File: :file:`map_integrals_erf.irp.f`
Read from disk the $ao integrals
.. c:function:: mo_bielec_integral_erf
.. code:: text
double precision function mo_bielec_integral_erf(i,j,k,l)
File: :file:`map_integrals_erf.irp.f`
Returns one integral <ij|kl> in the MO basis
.. c:function:: mo_bielec_integrals_erf_index
.. code:: text
subroutine mo_bielec_integrals_erf_index(i,j,k,l,i1)
File: :file:`mo_bi_integrals_erf.irp.f`
Computes an unique index for i,j,k,l integrals
.. c:function:: provide_all_mo_integrals_erf
.. code:: text
subroutine provide_all_mo_integrals_erf
File: :file:`mo_bi_integrals_erf.irp.f`
.. c:function:: save_erf_bi_elec_integrals_mo
.. code:: text
subroutine save_erf_bi_elec_integrals_mo
File: :file:`routines_save_integrals_erf.irp.f`
.. c:function:: save_erf_bielec_ints_mo_into_ints_mo
.. code:: text
subroutine save_erf_bielec_ints_mo_into_ints_mo
File: :file:`routines_save_integrals_erf.irp.f`

View File

@ -0,0 +1,375 @@
.. _scf_utils:
.. program:: scf_utils
.. default-role:: option
=========
scf_utils
=========
The scf_utils module performs *Restricted* SCF calculations (the
spatial part of the |MOs| is common for alpha and beta spinorbitals) based on a single-determinant wave function.
This module does not produce any executable *and must not do*, but instead it contains everything one needs to perform an orbital optimization based on an Fock matrix.
The ``scf_utils`` module is included in the :file:`NEED` of the various single determinant SCF procedures, such as ``hartree_fock`` or ``kohn_sham``, where a specific definition of the Fock matrix is given (see :file:`hartree_fock fock_matrix_hf.irp.f` for an example).
All SCF programs perform the following actions:
#. 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 based on the definition of the Fock matrix
The main keywords/options are:
# :option:`scf_utils thresh_scf`
# :option:`scf_utils level_shift`
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
Maximum size of the DIIS extrapolation procedure
Default: 15
.. option:: threshold_diis
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.
Default: 0.
.. option:: thresh_scf
Threshold on the convergence of the Hartree Fock energy.
Default: 1.e-10
.. option:: n_it_scf_max
Maximum number of SCF iterations
Default: 500
.. option:: level_shift
Energy shift on the virtual MOs to improve SCF convergence
Default: 0.1
.. option:: scf_algorithm
Type of SCF algorithm used. Possible choices are [ Simple | DIIS]
Default: DIIS
.. option:: mo_guess_type
Initial MO guess. Can be [ Huckel | HCore ]
Default: Huckel
.. option:: energy
Calculated HF energy
.. option:: no_oa_or_av_opt
If true, leave the active orbitals untouched in the SCF procedure
Default: False
Providers
---------
.. c:var:: eigenvalues_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)
File: :file:`diis.irp.f`
Eigenvalues and eigenvectors of the Fock matrix over the AO basis
.. 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)
File: :file:`diis.irp.f`
Eigenvalues and eigenvectors of the Fock matrix over the AO basis
.. c:var:: eigenvectors_fock_matrix_mo
.. code:: text
double precision, allocatable :: eigenvectors_fock_matrix_mo (ao_num,mo_tot_num)
File: :file:`diagonalize_fock.irp.f`
Eigenvector of the Fock matrix in the MO basis obtained with level shift.
.. c:var:: extrapolate_fock_matrix
.. code:: text
subroutine extrapolate_Fock_matrix( &
error_matrix_DIIS,Fock_matrix_DIIS, &
Fock_matrix_AO_,size_Fock_matrix_AO, &
iteration_SCF,dim_DIIS &
)
File: :file:`roothaan_hall_scf.irp.f`
Compute the extrapolated Fock matrix using the DIIS procedure
.. c:var:: fock_matrix_ao
.. code:: text
double precision, allocatable :: fock_matrix_ao (ao_num,ao_num)
File: :file:`fock_matrix.irp.f`
Fock matrix in AO basis set
.. c:var:: fock_matrix_diag_mo
.. code:: text
double precision, allocatable :: fock_matrix_mo (mo_tot_num,mo_tot_num)
double precision, allocatable :: fock_matrix_diag_mo (mo_tot_num)
File: :file:`fock_matrix.irp.f`
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
.. c:var:: fock_matrix_mo
.. code:: text
double precision, allocatable :: fock_matrix_mo (mo_tot_num,mo_tot_num)
double precision, allocatable :: fock_matrix_diag_mo (mo_tot_num)
File: :file:`fock_matrix.irp.f`
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
.. c:var:: fock_matrix_mo_alpha
.. code:: text
double precision, allocatable :: fock_matrix_mo_alpha (mo_tot_num,mo_tot_num)
File: :file:`fock_matrix.irp.f`
Fock matrix on the MO basis
.. c:var:: fock_matrix_mo_beta
.. code:: text
double precision, allocatable :: fock_matrix_mo_beta (mo_tot_num,mo_tot_num)
File: :file:`fock_matrix.irp.f`
Fock matrix on the MO basis
.. c:var:: fps_spf_matrix_ao
.. code:: text
double precision, allocatable :: fps_spf_matrix_ao (AO_num,AO_num)
File: :file:`diis.irp.f`
Commutator FPS - SPF
.. c:var:: fps_spf_matrix_mo
.. code:: text
double precision, allocatable :: fps_spf_matrix_mo (mo_tot_num,mo_tot_num)
File: :file:`diis.irp.f`
Commutator FPS - SPF in MO basis
.. c:var:: scf_density_matrix_ao
.. code:: text
double precision, allocatable :: scf_density_matrix_ao (ao_num,ao_num)
File: :file:`scf_density_matrix_ao.irp.f`
S^{-1}.P.S^{-1} where P = C.C^t
.. c:var:: scf_density_matrix_ao_alpha
.. code:: text
double precision, allocatable :: scf_density_matrix_ao_alpha (ao_num,ao_num)
File: :file:`scf_density_matrix_ao.irp.f`
S^{-1}.P_alpha.S^{-1}
.. c:var:: scf_density_matrix_ao_beta
.. code:: text
double precision, allocatable :: scf_density_matrix_ao_beta (ao_num,ao_num)
File: :file:`scf_density_matrix_ao.irp.f`
S^{-1}.P_beta.S^{-1}
.. c:var:: scf_energy
.. code:: text
double precision :: scf_energy
File: :file:`fock_matrix.irp.f`
Hartree-Fock energy
.. c:var:: threshold_diis_nonzero
.. code:: text
double precision :: threshold_diis_nonzero
File: :file:`diis.irp.f`
If threshold_DIIS is zero, choose sqrt(thresh_scf)
Subroutines / functions
-----------------------
.. c:function:: damping_scf
.. code:: text
subroutine damping_SCF
File: :file:`damping_scf.irp.f`
.. 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
File: :file:`roothaan_hall_scf.irp.f`
Roothaan-Hall algorithm for SCF Hartree-Fock calculation

View File

@ -90,6 +90,20 @@ Subroutines / functions
.. c:function:: routine
.. code:: text
subroutine routine
File: :file:`write_integrals_erf.irp.f`
.. c:function:: save_natorb
.. code:: text
@ -104,6 +118,22 @@ Subroutines / functions
.. c:function:: save_one_body_dm
.. code:: text
subroutine save_one_body_dm
File: :file:`save_one_body_dm.irp.f`
programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities.
Then, the global variable data_one_body_alpha_dm_mo and data_one_body_beta_dm_mo will automatically read the density in a further calculation.
This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module).
.. c:function:: save_ortho_mos
.. code:: text

View File

@ -225,7 +225,6 @@ Index of Providers
* :c:data:`exchange_functional`
* :c:data:`expected_s2`
* :c:data:`extra_e_contrib_density`
* :c:data:`extra_energy_contrib_from_density`
* :c:data:`extrapolate_fock_matrix`
* :c:data:`extrapolated_energy`
* :c:data:`ezfio_filename`

1
src/dft_utils_two_body/.gitignore vendored Symbolic link
View File

@ -0,0 +1 @@
../../data/module_gitignore

1
src/fci/.gitignore vendored Symbolic link
View File

@ -0,0 +1 @@
../../data/module_gitignore

1
src/hartree_fock/.gitignore vendored Symbolic link
View File

@ -0,0 +1 @@
../../data/module_gitignore

1
src/kohn_sham/.gitignore vendored Symbolic link
View File

@ -0,0 +1 @@
../../data/module_gitignore

1
src/kohn_sham_rs/.gitignore vendored Symbolic link
View File

@ -0,0 +1 @@
../../data/module_gitignore

1
src/slave/.gitignore vendored Symbolic link
View File

@ -0,0 +1 @@
../../data/module_gitignore