10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-09-26 19:40:57 +02:00

A lot of renaming

This commit is contained in:
Anthony Scemama 2019-01-05 01:51:21 +01:00
parent af55bf49a1
commit a85f1212f3
139 changed files with 21782 additions and 663 deletions

View File

@ -36,4 +36,4 @@ python:
script:
- ./configure --install all --config ./config/travis.cfg
- source ./quantum_package.rc ; ninja -j 1 -v
- source ./quantum_package.rc ; qp_test -a -v
- source ./quantum_package.rc ; qp_test -a

View File

@ -8,7 +8,7 @@ Set of quantum chemistry programs and libraries.
For more information, you can visit the [wiki of the project](http://github.com/LCPQ/quantum_package/wiki), or below for the installation instructions.
The documentation is accessible [here](https://quantum-package-scemamamaster.readthedocs.io)
Demo
====

View File

@ -1,4 +1,5 @@
default:
./auto_generate.py
make -C ../ html
clean:
make -C ../ clean

View File

@ -0,0 +1,657 @@
.. _ao_basis:
.. program:: ao_basis
.. default-role:: option
========
ao_basis
========
This module describes the atomic orbitals basis set.
An |AO| :math:`\chi` centered on nucleus A is represented as:
.. math::
\chi_i({\bf r}) = (x-X_A)^a (y-Y_A)^b (z-Z_A)^c \sum_k c_{ki} e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2}
The |AO| coefficients are normalized as:
.. math::
{\tilde c}_{ki} = \frac{c_{ki}}{ \int \left( (x-X_A)^a (y-Y_A)^b (z-Z_A)^c e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} \right)^2 dr}
Warning: `ao_coef` contains the |AO| coefficients given in input. These do not
include the normalization constant of the |AO|. The `ao_coef_normalized` provider includes
this normalization factor.
The |AOs| are also sorted by increasing exponent to accelerate the calculation of
the two electron integrals.
EZFIO parameters
----------------
.. option:: ao_basis
Name of the |AO| basis set
.. option:: ao_num
Number of |AOs|
.. option:: ao_prim_num
Number of primitives per |AO|
.. option:: ao_prim_num_max
Maximum number of primitives
Default: =maxval(ao_basis.ao_prim_num)
.. option:: ao_nucl
Index of the nucleus on which the |AO| is centered
.. option:: ao_power
Powers of x, y and z for each |AO|
.. option:: ao_coef
Primitive coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs.
.. option:: ao_expo
Exponents for each primitive of each |AO|
.. option:: ao_md5
MD5 key, specific of the |AO| basis
.. option:: ao_cartesian
If |true|, use |AOs| in Cartesian coordinates (6d,10f,...)
Default: false
Providers
---------
.. c:var:: ao_coef_normalization_factor
.. code:: text
double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max)
double precision, allocatable :: ao_coef_normalization_factor (ao_num)
File: :file:`aos.irp.f`
Coefficients including the |AO| normalization
.. c:var:: ao_coef_normalization_libint_factor
.. code:: text
double precision, allocatable :: ao_coef_normalization_libint_factor (ao_num)
File: :file:`aos.irp.f`
|AO| normalization for interfacing with libint
.. c:var:: ao_coef_normalized
.. code:: text
double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max)
double precision, allocatable :: ao_coef_normalization_factor (ao_num)
File: :file:`aos.irp.f`
Coefficients including the |AO| normalization
.. c:var:: ao_coef_normalized_ordered
.. code:: text
double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max)
double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max)
File: :file:`aos.irp.f`
Sorted primitives to accelerate 4 index |MO| transformation
.. c:var:: ao_coef_normalized_ordered_transp
.. code:: text
double precision, allocatable :: ao_coef_normalized_ordered_transp (ao_prim_num_max,ao_num)
File: :file:`aos.irp.f`
Transposed :c:data:`ao_coef_normalized_ordered`
.. c:var:: ao_coef_normalized_ordered_transp_per_nucl
.. code:: text
double precision, allocatable :: ao_coef_normalized_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num)
File: :file:`aos_transp.irp.f`
.. c:var:: ao_expo_ordered
.. code:: text
double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max)
double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max)
File: :file:`aos.irp.f`
Sorted primitives to accelerate 4 index |MO| transformation
.. c:var:: ao_expo_ordered_transp
.. code:: text
double precision, allocatable :: ao_expo_ordered_transp (ao_prim_num_max,ao_num)
File: :file:`aos.irp.f`
Transposed :c:data:`ao_expo_ordered`
.. c:var:: ao_expo_ordered_transp_per_nucl
.. code:: text
double precision, allocatable :: ao_expo_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num)
File: :file:`aos_transp.irp.f`
.. c:var:: ao_l
.. code:: text
integer, allocatable :: ao_l (ao_num)
integer :: ao_l_max
character*(128), allocatable :: ao_l_char (ao_num)
File: :file:`aos.irp.f`
:math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c`
.. c:var:: ao_l_char
.. code:: text
integer, allocatable :: ao_l (ao_num)
integer :: ao_l_max
character*(128), allocatable :: ao_l_char (ao_num)
File: :file:`aos.irp.f`
:math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c`
.. c:var:: ao_l_char_space
.. code:: text
character*(4), allocatable :: ao_l_char_space (ao_num)
File: :file:`aos.irp.f`
Converts an l value to a string
.. c:var:: ao_l_max
.. code:: text
integer, allocatable :: ao_l (ao_num)
integer :: ao_l_max
character*(128), allocatable :: ao_l_char (ao_num)
File: :file:`aos.irp.f`
:math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c`
.. c:var:: ao_power_ordered_transp_per_nucl
.. code:: text
integer, allocatable :: ao_power_ordered_transp_per_nucl (3,N_AOs_max,nucl_num)
File: :file:`aos_transp.irp.f`
.. c:var:: ao_prim_num_max
.. code:: text
integer :: ao_prim_num_max
File: :file:`aos.irp.f`
Max number of primitives.
.. c:var:: cart_to_sphe_0
.. code:: text
double precision, allocatable :: cart_to_sphe_0 (1,1)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=0
.. c:var:: cart_to_sphe_1
.. code:: text
double precision, allocatable :: cart_to_sphe_1 (3,3)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=1
.. c:var:: cart_to_sphe_2
.. code:: text
double precision, allocatable :: cart_to_sphe_2 (6,5)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=2
.. c:var:: cart_to_sphe_3
.. code:: text
double precision, allocatable :: cart_to_sphe_3 (10,7)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=3
.. c:var:: cart_to_sphe_4
.. code:: text
double precision, allocatable :: cart_to_sphe_4 (15,9)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=4
.. c:var:: cart_to_sphe_5
.. code:: text
double precision, allocatable :: cart_to_sphe_5 (21,11)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=5
.. c:var:: cart_to_sphe_6
.. code:: text
double precision, allocatable :: cart_to_sphe_6 (28,13)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=6
.. c:var:: cart_to_sphe_7
.. code:: text
double precision, allocatable :: cart_to_sphe_7 (36,15)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=7
.. c:var:: cart_to_sphe_8
.. code:: text
double precision, allocatable :: cart_to_sphe_8 (45,17)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=8
.. c:var:: cart_to_sphe_9
.. code:: text
double precision, allocatable :: cart_to_sphe_9 (55,19)
File: :file:`spherical_to_cartesian.irp.f`
Spherical -> Cartesian Transformation matrix for l=9
.. c:var:: l_to_charater
.. code:: text
character*(128), allocatable :: l_to_charater (0:7)
File: :file:`aos.irp.f`
Character corresponding to the "l" value of an |AO|
.. c:var:: n_aos_max
.. code:: text
integer, allocatable :: nucl_n_aos (nucl_num)
integer :: n_aos_max
File: :file:`aos.irp.f`
Number of |AOs| per atom
.. c:var:: n_pt_max_i_x
.. code:: text
integer :: n_pt_max_integrals
integer :: n_pt_max_i_x
File: :file:`dimensions_integrals.irp.f`
Number of points used in the numerical integrations.
.. c:var:: n_pt_max_integrals
.. code:: text
integer :: n_pt_max_integrals
integer :: n_pt_max_i_x
File: :file:`dimensions_integrals.irp.f`
Number of points used in the numerical integrations.
.. c:var:: nucl_aos
.. code:: text
integer, allocatable :: nucl_aos (nucl_num,N_AOs_max)
File: :file:`aos.irp.f`
List of |AOs| centered on each atom
.. c:var:: nucl_aos_transposed
.. code:: text
integer, allocatable :: nucl_aos_transposed (N_AOs_max,nucl_num)
File: :file:`aos_transp.irp.f`
List of AOs attached on each atom
.. c:var:: nucl_list_shell_aos
.. code:: text
integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max)
integer, allocatable :: nucl_num_shell_aos (nucl_num)
File: :file:`aos.irp.f`
Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis
.. c:var:: nucl_n_aos
.. code:: text
integer, allocatable :: nucl_n_aos (nucl_num)
integer :: n_aos_max
File: :file:`aos.irp.f`
Number of |AOs| per atom
.. c:var:: nucl_num_shell_aos
.. code:: text
integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max)
integer, allocatable :: nucl_num_shell_aos (nucl_num)
File: :file:`aos.irp.f`
Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis
Subroutines / functions
-----------------------
.. c:function:: ao_power_index
.. code:: text
integer function ao_power_index(nx,ny,nz)
File: :file:`aos.irp.f`
Unique index given to a triplet of powers:
:math:`\frac{1}{2} (l-n_x) (l-n_x+1) + n_z + 1`
.. c:function:: ao_value
.. code:: text
double precision function ao_value(i,r)
File: :file:`aos_value.irp.f`
return the value of the ith ao at point r
.. c:function:: give_all_aos_and_grad_and_lapl_at_r
.. code:: text
subroutine give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array)
File: :file:`aos_value.irp.f`
input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r
.. c:function:: give_all_aos_and_grad_at_r
.. code:: text
subroutine give_all_aos_and_grad_at_r(r,aos_array,aos_grad_array)
File: :file:`aos_value.irp.f`
input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r
.. c:function:: give_all_aos_at_r
.. code:: text
subroutine give_all_aos_at_r(r,aos_array)
File: :file:`aos_value.irp.f`
input : r == r(1) = x and so on aos_array(i) = aos(i) evaluated in r
.. c:function:: give_all_aos_at_r_old
.. code:: text
subroutine give_all_aos_at_r_old(r,aos_array)
File: :file:`aos_value.irp.f`
gives the values of aos at a given point r
.. c:function:: primitive_value
.. code:: text
double precision function primitive_value(i,j,r)
File: :file:`aos_value.irp.f`
return the value of the jth primitive of ith ao at point r WITHOUT THE COEF

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,425 @@
.. _ao_two_e_erf_ints:
.. program:: ao_two_e_erf_ints
.. default-role:: option
======================
ao_two_e_erf_ints
======================
Here, all two-electron integrals (:math:`erf(\mu 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 main parameter of this module is :option:`ao_two_e_erf_ints mu_erf` which is the range-separation parameter.
To fetch an |AO| integral, use the
`get_ao_bielec_integral_erf(i,j,k,l,ao_integrals_erf_map)` function.
The conventions are:
* For |AO| integrals : (ij|kl) = (11|22) = <ik|jl> = <12|12>
EZFIO parameters
----------------
.. option:: io_ao_two_e_integrals_erf
Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ]
Default: None
.. option:: mu_erf
cutting of the interaction in the range separated model
Default: 0.5
Providers
---------
.. c:var:: ao_bielec_integral_erf_schwartz
.. code:: text
double precision, allocatable :: ao_bielec_integral_erf_schwartz (ao_num,ao_num)
File: :file:`providers_ao_erf.irp.f`
Needed to compute Schwartz inequalities
.. c:var:: ao_bielec_integrals_erf_in_map
.. code:: text
logical :: ao_bielec_integrals_erf_in_map
File: :file:`providers_ao_erf.irp.f`
Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2)
.. c:var:: ao_integrals_erf_cache
.. code:: text
double precision, allocatable :: ao_integrals_erf_cache (0:64*64*64*64)
File: :file:`map_integrals_erf.irp.f`
Cache of |AO| integrals for fast access
.. c:var:: ao_integrals_erf_cache_max
.. code:: text
integer :: ao_integrals_erf_cache_min
integer :: ao_integrals_erf_cache_max
File: :file:`map_integrals_erf.irp.f`
Min and max values of the AOs for which the integrals are in the cache
.. c:var:: ao_integrals_erf_cache_min
.. code:: text
integer :: ao_integrals_erf_cache_min
integer :: ao_integrals_erf_cache_max
File: :file:`map_integrals_erf.irp.f`
Min and max values of the AOs for which the integrals are in the cache
.. c:var:: ao_integrals_erf_map
.. code:: text
type(map_type) :: ao_integrals_erf_map
File: :file:`map_integrals_erf.irp.f`
|AO| integrals
.. c:var:: general_primitive_integral_erf
.. code:: text
double precision function general_primitive_integral_erf(dim, &
P_new,P_center,fact_p,p,p_inv,iorder_p, &
Q_new,Q_center,fact_q,q,q_inv,iorder_q)
File: :file:`two_e_integrals_erf.irp.f`
Computes the integral <pq|rs> where p,q,r,s are Gaussian primitives
Subroutines / functions
-----------------------
.. c:function:: ao_bielec_integral_erf
.. code:: text
double precision function ao_bielec_integral_erf(i,j,k,l)
File: :file:`two_e_integrals_erf.irp.f`
integral of the AO basis <ik|jl> or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2)
.. c:function:: ao_bielec_integral_schwartz_accel_erf
.. code:: text
double precision function ao_bielec_integral_schwartz_accel_erf(i,j,k,l)
File: :file:`two_e_integrals_erf.irp.f`
integral of the AO basis <ik|jl> or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2)
.. c:function:: ao_bielec_integrals_erf_in_map_collector
.. code:: text
subroutine ao_bielec_integrals_erf_in_map_collector(zmq_socket_pull)
File: :file:`integrals_erf_in_map_slave.irp.f`
Collects results from the AO integral calculation
.. c:function:: ao_bielec_integrals_erf_in_map_slave
.. code:: text
subroutine ao_bielec_integrals_erf_in_map_slave(thread,iproc)
File: :file:`integrals_erf_in_map_slave.irp.f`
Computes a buffer of integrals
.. c:function:: ao_bielec_integrals_erf_in_map_slave_inproc
.. code:: text
subroutine ao_bielec_integrals_erf_in_map_slave_inproc(i)
File: :file:`integrals_erf_in_map_slave.irp.f`
Computes a buffer of integrals. i is the ID of the current thread.
.. c:function:: ao_bielec_integrals_erf_in_map_slave_tcp
.. code:: text
subroutine ao_bielec_integrals_erf_in_map_slave_tcp(i)
File: :file:`integrals_erf_in_map_slave.irp.f`
Computes a buffer of integrals. i is the ID of the current thread.
.. c:function:: clear_ao_erf_map
.. code:: text
subroutine clear_ao_erf_map
File: :file:`map_integrals_erf.irp.f`
Frees the memory of the |AO| map
.. c:function:: compute_ao_bielec_integrals_erf
.. code:: text
subroutine compute_ao_bielec_integrals_erf(j,k,l,sze,buffer_value)
File: :file:`two_e_integrals_erf.irp.f`
Compute AO 1/r12 integrals for all i and fixed j,k,l
.. c:function:: compute_ao_integrals_erf_jl
.. code:: text
subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value)
File: :file:`two_e_integrals_erf.irp.f`
Parallel client for AO integrals
.. c:function:: dump_ao_integrals_erf
.. code:: text
subroutine dump_ao_integrals_erf(filename)
File: :file:`map_integrals_erf.irp.f`
Save to disk the |AO| erf integrals
.. c:function:: eri_erf
.. code:: text
double precision function ERI_erf(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z)
File: :file:`two_e_integrals_erf.irp.f`
ATOMIC PRIMTIVE bielectronic integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2)
.. c:function:: get_ao_bielec_integral_erf
.. code:: text
double precision function get_ao_bielec_integral_erf(i,j,k,l,map) result(result)
File: :file:`map_integrals_erf.irp.f`
Gets one |AO| two-electron integral from the |AO| map
.. c:function:: get_ao_bielec_integrals_erf
.. code:: text
subroutine get_ao_bielec_integrals_erf(j,k,l,sze,out_val)
File: :file:`map_integrals_erf.irp.f`
Gets multiple |AO| two-electron integral from the |AO| map . All i are retrieved for j,k,l fixed.
.. c:function:: get_ao_bielec_integrals_erf_non_zero
.. code:: text
subroutine get_ao_bielec_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int)
File: :file:`map_integrals_erf.irp.f`
Gets multiple |AO| two-electron integrals from the |AO| map . All non-zero i are retrieved for j,k,l fixed.
.. c:function:: get_ao_erf_map_size
.. code:: text
function get_ao_erf_map_size()
File: :file:`map_integrals_erf.irp.f`
Returns the number of elements in the |AO| map
.. c:function:: insert_into_ao_integrals_erf_map
.. code:: text
subroutine insert_into_ao_integrals_erf_map(n_integrals,buffer_i, buffer_values)
File: :file:`map_integrals_erf.irp.f`
Create new entry into |AO| map
.. c:function:: integrale_new_erf
.. code:: text
subroutine integrale_new_erf(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt)
File: :file:`two_e_integrals_erf.irp.f`
calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1)
.. c:function:: load_ao_integrals_erf
.. code:: text
integer function load_ao_integrals_erf(filename)
File: :file:`map_integrals_erf.irp.f`
Read from disk the |AO| erf integrals
.. c:function:: save_erf_bi_elec_integrals_ao
.. code:: text
subroutine save_erf_bi_elec_integrals_ao
File: :file:`routines_save_integrals_erf.irp.f`
.. c:function:: save_erf_bielec_ints_ao_into_ints_ao
.. code:: text
subroutine save_erf_bielec_ints_ao_into_ints_ao
File: :file:`routines_save_integrals_erf.irp.f`

View File

@ -0,0 +1,619 @@
.. _ao_two_e_ints:
.. program:: ao_two_e_ints
.. default-role:: option
==================
ao_two_e_ints
==================
Here, all two-electron integrals (:math:`1/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`.
To fetch an |AO| integral, use the
`get_ao_bielec_integral(i,j,k,l,ao_integrals_map)` function.
The conventions are:
* For |AO| integrals : (ij|kl) = (11|22) = <ik|jl> = <12|12>
EZFIO parameters
----------------
.. option:: io_ao_two_e_integrals
Read/Write |AO| integrals from/to disk [ Write | Read | None ]
Default: None
.. option:: ao_integrals_threshold
If | (pq|rs) | < `ao_integrals_threshold` then (pq|rs) is zero
Default: 1.e-15
.. option:: do_direct_integrals
Compute integrals on the fly (very slow, only for debugging)
Default: False
Providers
---------
.. c:var:: ao_bielec_integral_schwartz
.. code:: text
double precision, allocatable :: ao_bielec_integral_schwartz (ao_num,ao_num)
File: :file:`two_e_integrals.irp.f`
Needed to compute Schwartz inequalities
.. c:var:: ao_bielec_integrals_in_map
.. code:: text
logical :: ao_bielec_integrals_in_map
File: :file:`two_e_integrals.irp.f`
Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2)
.. c:var:: ao_integrals_cache
.. code:: text
double precision, allocatable :: ao_integrals_cache (0:64*64*64*64)
File: :file:`map_integrals.irp.f`
Cache of AO integrals for fast access
.. c:var:: ao_integrals_cache_max
.. code:: text
integer :: ao_integrals_cache_min
integer :: ao_integrals_cache_max
File: :file:`map_integrals.irp.f`
Min and max values of the AOs for which the integrals are in the cache
.. c:var:: ao_integrals_cache_min
.. code:: text
integer :: ao_integrals_cache_min
integer :: ao_integrals_cache_max
File: :file:`map_integrals.irp.f`
Min and max values of the AOs for which the integrals are in the cache
.. c:var:: ao_integrals_map
.. code:: text
type(map_type) :: ao_integrals_map
File: :file:`map_integrals.irp.f`
AO integrals
.. c:var:: gauleg_t2
.. code:: text
double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2)
double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2)
File: :file:`gauss_legendre.irp.f`
t_w(i,1,k) = w(i) t_w(i,2,k) = t(i)
.. c:var:: gauleg_w
.. code:: text
double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2)
double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2)
File: :file:`gauss_legendre.irp.f`
t_w(i,1,k) = w(i) t_w(i,2,k) = t(i)
.. c:var:: general_primitive_integral
.. code:: text
double precision function general_primitive_integral(dim, &
P_new,P_center,fact_p,p,p_inv,iorder_p, &
Q_new,Q_center,fact_q,q,q_inv,iorder_q)
File: :file:`two_e_integrals.irp.f`
Computes the integral <pq|rs> where p,q,r,s are Gaussian primitives
.. c:var:: i_x1_new
.. code:: text
recursive subroutine I_x1_new(a,c,B_10,B_01,B_00,res,n_pt)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
.. c:var:: i_x1_pol_mult_a1
.. code:: text
recursive subroutine I_x1_pol_mult_a1(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
.. c:var:: i_x1_pol_mult_a2
.. code:: text
recursive subroutine I_x1_pol_mult_a2(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
.. c:var:: i_x1_pol_mult_recurs
.. code:: text
recursive subroutine I_x1_pol_mult_recurs(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
.. c:var:: i_x2_new
.. code:: text
recursive subroutine I_x2_new(c,B_10,B_01,B_00,res,n_pt)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
.. c:var:: i_x2_pol_mult
.. code:: text
recursive subroutine I_x2_pol_mult(c,B_10,B_01,B_00,C_00,D_00,d,nd,dim)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
Subroutines / functions
-----------------------
.. c:function:: ao_bielec_integral
.. code:: text
double precision function ao_bielec_integral(i,j,k,l)
File: :file:`two_e_integrals.irp.f`
integral of the AO basis <ik|jl> or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2)
.. c:function:: ao_bielec_integral_schwartz_accel
.. code:: text
double precision function ao_bielec_integral_schwartz_accel(i,j,k,l)
File: :file:`two_e_integrals.irp.f`
integral of the AO basis <ik|jl> or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2)
.. c:function:: ao_bielec_integrals_in_map_collector
.. code:: text
subroutine ao_bielec_integrals_in_map_collector(zmq_socket_pull)
File: :file:`integrals_in_map_slave.irp.f`
Collects results from the AO integral calculation
.. c:function:: ao_bielec_integrals_in_map_slave
.. code:: text
subroutine ao_bielec_integrals_in_map_slave(thread,iproc)
File: :file:`integrals_in_map_slave.irp.f`
Computes a buffer of integrals
.. c:function:: ao_bielec_integrals_in_map_slave_inproc
.. code:: text
subroutine ao_bielec_integrals_in_map_slave_inproc(i)
File: :file:`integrals_in_map_slave.irp.f`
Computes a buffer of integrals. i is the ID of the current thread.
.. c:function:: ao_bielec_integrals_in_map_slave_tcp
.. code:: text
subroutine ao_bielec_integrals_in_map_slave_tcp(i)
File: :file:`integrals_in_map_slave.irp.f`
Computes a buffer of integrals. i is the ID of the current thread.
.. c:function:: ao_l4
.. code:: text
integer function ao_l4(i,j,k,l)
File: :file:`two_e_integrals.irp.f`
Computes the product of l values of i,j,k,and l
.. c:function:: bielec_integrals_index
.. code:: text
subroutine bielec_integrals_index(i,j,k,l,i1)
File: :file:`map_integrals.irp.f`
.. c:function:: bielec_integrals_index_reverse
.. code:: text
subroutine bielec_integrals_index_reverse(i,j,k,l,i1)
File: :file:`map_integrals.irp.f`
.. c:function:: clear_ao_map
.. code:: text
subroutine clear_ao_map
File: :file:`map_integrals.irp.f`
Frees the memory of the AO map
.. c:function:: compute_ao_bielec_integrals
.. code:: text
subroutine compute_ao_bielec_integrals(j,k,l,sze,buffer_value)
File: :file:`two_e_integrals.irp.f`
Compute AO 1/r12 integrals for all i and fixed j,k,l
.. c:function:: compute_ao_integrals_jl
.. code:: text
subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value)
File: :file:`two_e_integrals.irp.f`
Parallel client for AO integrals
.. c:function:: dump_ao_integrals
.. code:: text
subroutine dump_ao_integrals(filename)
File: :file:`map_integrals.irp.f`
Save to disk the |AO| integrals
.. c:function:: eri
.. code:: text
double precision function ERI(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z)
File: :file:`two_e_integrals.irp.f`
ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2)
.. c:function:: gauleg
.. code:: text
subroutine gauleg(x1,x2,x,w,n)
File: :file:`gauss_legendre.irp.f`
Gauss-Legendre
.. c:function:: get_ao_bielec_integral
.. code:: text
double precision function get_ao_bielec_integral(i,j,k,l,map) result(result)
File: :file:`map_integrals.irp.f`
Gets one AO bi-electronic integral from the AO map
.. c:function:: get_ao_bielec_integrals
.. code:: text
subroutine get_ao_bielec_integrals(j,k,l,sze,out_val)
File: :file:`map_integrals.irp.f`
Gets multiple AO bi-electronic integral from the AO map . All i are retrieved for j,k,l fixed.
.. c:function:: get_ao_bielec_integrals_non_zero
.. code:: text
subroutine get_ao_bielec_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int)
File: :file:`map_integrals.irp.f`
Gets multiple AO bi-electronic integral from the AO map . All non-zero i are retrieved for j,k,l fixed.
.. c:function:: get_ao_map_size
.. code:: text
function get_ao_map_size()
File: :file:`map_integrals.irp.f`
Returns the number of elements in the AO map
.. c:function:: give_polynom_mult_center_x
.. code:: text
subroutine give_polynom_mult_center_x(P_center,Q_center,a_x,d_x,p,q,n_pt_in,pq_inv,pq_inv_2,p10_1,p01_1,p10_2,p01_2,d,n_pt_out)
File: :file:`two_e_integrals.irp.f`
subroutine that returns the explicit polynom in term of the "t" variable of the following polynomw : I_x1(a_x, d_x,p,q) * I_x1(a_y, d_y,p,q) * I_x1(a_z, d_z,p,q)
.. c:function:: i_x1_pol_mult
.. code:: text
subroutine I_x1_pol_mult(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
File: :file:`two_e_integrals.irp.f`
recursive function involved in the two-electron integral
.. c:function:: insert_into_ao_integrals_map
.. code:: text
subroutine insert_into_ao_integrals_map(n_integrals,buffer_i, buffer_values)
File: :file:`map_integrals.irp.f`
Create new entry into AO map
.. c:function:: integrale_new
.. code:: text
subroutine integrale_new(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt)
File: :file:`two_e_integrals.irp.f`
calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1)
.. c:function:: load_ao_integrals
.. code:: text
integer function load_ao_integrals(filename)
File: :file:`map_integrals.irp.f`
Read from disk the |AO| integrals
.. c:function:: n_pt_sup
.. code:: text
integer function n_pt_sup(a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z)
File: :file:`two_e_integrals.irp.f`
Returns the upper boundary of the degree of the polynomial involved in the bielctronic integral : Ix(a_x,b_x,c_x,d_x) * Iy(a_y,b_y,c_y,d_y) * Iz(a_z,b_z,c_z,d_z)
.. c:function:: push_integrals
.. code:: text
subroutine push_integrals(zmq_socket_push, n_integrals, buffer_i, buffer_value, task_id)
File: :file:`integrals_in_map_slave.irp.f`
Push integrals in the push socket

View File

@ -0,0 +1,52 @@
.. _aux_quantities:
.. program:: aux_quantities
.. default-role:: option
==============
aux_quantities
==============
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 |RSDFT| calculations, this can be done to perform damping
on the density in order to speed up convergence.
The main providers of that module are:
* `data_one_body_alpha_dm_mo` and `data_one_body_beta_dm_mo` which are the
one-body alpha and beta densities which are necessary read from the EZFIO
folder.
Thanks to these providers you can use any density matrix that does not
necessary corresponds to that of the current wave function.
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

View File

@ -0,0 +1,454 @@
.. _becke_numerical_grid:
.. program:: becke_numerical_grid
.. default-role:: option
====================
becke_numerical_grid
====================
This module contains all quantities needed to build the Becke's grid used in general for DFT integration. Note that it can be used for whatever integration in R^3 as long as the functions to be integrated are mostly concentrated near the atomic regions.
This grid is built as the reunion of a spherical grid around each atom. Each spherical grid contains
a certain number of radial and angular points. No pruning is done on the angular part of the grid.
The main keyword for that modue is:
* :option:`becke_numerical_grid grid_type_sgn` which controls the precision of the grid according the standard **SG-n** grids. This keyword controls the two providers `n_points_integration_angular` `n_points_radial_grid`.
The main providers of that module are:
* `n_points_integration_angular` which is the number of angular integration points. WARNING: it obeys to specific rules so it cannot be any integer number. Some of the possible values are [ 50 | 74 | 170 | 194 | 266 | 302 | 590 | 1202 | 2030 | 5810 ] for instance. See :file:`angular.f` for more details.
* `n_points_radial_grid` which is the number of radial angular points. This can be any strictly positive integer. Nevertheless, a minimum of 50 is in general necessary.
* `final_grid_points` which are the (x,y,z) coordinates of the grid points.
* `final_weight_at_r_vector` which are the weights at each grid point
For a simple example of how to use the grid, see :file:`example.irp.f`.
The spherical integration uses Lebedev-Laikov grids, which was used from the code distributed through CCL (http://www.ccl.net/).
See next section for explanations and citation policies.
.. code-block:: text
This subroutine is part of a set of subroutines that generate
Lebedev grids [1-6] for integration on a sphere. The original
C-code [1] was kindly provided by Dr. Dmitri N. Laikov and
translated into fortran by Dr. Christoph van Wuellen.
This subroutine was translated using a C to fortran77 conversion
tool written by Dr. Christoph van Wuellen.
Users of this code are asked to include reference [1] in their
publications, and in the user- and programmers-manuals
describing their codes.
This code was distributed through CCL (http://www.ccl.net/).
[1] V.I. Lebedev, and D.N. Laikov
"A quadrature formula for the sphere of the 131st
algebraic order of accuracy"
Doklady Mathematics, Vol. 59, No. 3, 1999, pp. 477-481.
[2] V.I. Lebedev
"A quadrature formula for the sphere of 59th algebraic
order of accuracy"
Russian Acad. Sci. Dokl. Math., Vol. 50, 1995, pp. 283-286.
[3] V.I. Lebedev, and A.L. Skorokhodov
"Quadrature formulas of orders 41, 47, and 53 for the sphere"
Russian Acad. Sci. Dokl. Math., Vol. 45, 1992, pp. 587-592.
[4] V.I. Lebedev
"Spherical quadrature formulas exact to orders 25-29"
Siberian Mathematical Journal, Vol. 18, 1977, pp. 99-107.
[5] V.I. Lebedev
"Quadratures on a sphere"
Computational Mathematics and Mathematical Physics, Vol. 16,
1976, pp. 10-24.
[6] V.I. Lebedev
"Values of the nodes and weights of ninth to seventeenth
order Gauss-Markov quadrature formulae invariant under the
octahedron group with inversion"
Computational Mathematics and Mathematical Physics, Vol. 15,
1975, pp. 44-51.
EZFIO parameters
----------------
.. option:: grid_type_sgn
Type of grid used for the Becke's numerical grid. Can be, by increasing accuracy: [ 0 | 1 | 2 | 3 ]
Default: 2
Providers
---------
.. c:var:: alpha_knowles
.. code:: text
double precision, allocatable :: alpha_knowles (100)
File: :file:`integration_radial.irp.f`
Recommended values for the alpha parameters according to the paper of Knowles (JCP, 104, 1996) as a function of the nuclear charge
.. c:var:: angular_quadrature_points
.. code:: text
double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3)
double precision, allocatable :: weights_angular_points (n_points_integration_angular)
File: :file:`grid_becke.irp.f`
weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme
.. c:var:: dr_radial_integral
.. code:: text
double precision, allocatable :: grid_points_radial (n_points_radial_grid)
double precision :: dr_radial_integral
File: :file:`grid_becke.irp.f`
points in [0,1] to map the radial integral [0,\infty]
.. c:var:: final_grid_points
.. code:: text
double precision, allocatable :: final_grid_points (3,n_points_final_grid)
double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid)
integer, allocatable :: index_final_points (3,n_points_final_grid)
integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke_vector.irp.f`
final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point
final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions
index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point
index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices
.. c:var:: final_weight_at_r
.. code:: text
double precision, allocatable :: final_weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke.irp.f`
Total weight on each grid point which takes into account all Lebedev, Voronoi and radial weights.
.. c:var:: final_weight_at_r_vector
.. code:: text
double precision, allocatable :: final_grid_points (3,n_points_final_grid)
double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid)
integer, allocatable :: index_final_points (3,n_points_final_grid)
integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke_vector.irp.f`
final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point
final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions
index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point
index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices
.. c:var:: grid_points_per_atom
.. code:: text
double precision, allocatable :: grid_points_per_atom (3,n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke.irp.f`
x,y,z coordinates of grid points used for integration in 3d space
.. c:var:: grid_points_radial
.. code:: text
double precision, allocatable :: grid_points_radial (n_points_radial_grid)
double precision :: dr_radial_integral
File: :file:`grid_becke.irp.f`
points in [0,1] to map the radial integral [0,\infty]
.. c:var:: index_final_points
.. code:: text
double precision, allocatable :: final_grid_points (3,n_points_final_grid)
double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid)
integer, allocatable :: index_final_points (3,n_points_final_grid)
integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke_vector.irp.f`
final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point
final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions
index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point
index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices
.. c:var:: index_final_points_reverse
.. code:: text
double precision, allocatable :: final_grid_points (3,n_points_final_grid)
double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid)
integer, allocatable :: index_final_points (3,n_points_final_grid)
integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke_vector.irp.f`
final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point
final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions
index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point
index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices
.. c:var:: m_knowles
.. code:: text
integer :: m_knowles
File: :file:`grid_becke.irp.f`
value of the "m" parameter in the equation (7) of the paper of Knowles (JCP, 104, 1996)
.. c:var:: n_points_final_grid
.. code:: text
integer :: n_points_final_grid
File: :file:`grid_becke_vector.irp.f`
Number of points which are non zero
.. c:var:: n_points_grid_per_atom
.. code:: text
integer :: n_points_grid_per_atom
File: :file:`grid_becke.irp.f`
Number of grid points per atom
.. c:var:: n_points_integration_angular
.. code:: text
integer :: n_points_radial_grid
integer :: n_points_integration_angular
File: :file:`grid_becke.irp.f`
n_points_radial_grid = number of radial grid points per atom
n_points_integration_angular = number of angular grid points per atom
These numbers are automatically set by setting the grid_type_sgn parameter
.. c:var:: n_points_radial_grid
.. code:: text
integer :: n_points_radial_grid
integer :: n_points_integration_angular
File: :file:`grid_becke.irp.f`
n_points_radial_grid = number of radial grid points per atom
n_points_integration_angular = number of angular grid points per atom
These numbers are automatically set by setting the grid_type_sgn parameter
.. c:var:: weight_at_r
.. code:: text
double precision, allocatable :: weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num)
File: :file:`grid_becke.irp.f`
Weight function at grid points : w_n(r) according to the equation (22) of Becke original paper (JCP, 88, 1988)
The "n" discrete variable represents the nucleis which in this array is represented by the last dimension and the points are labelled by the other dimensions.
.. c:var:: weights_angular_points
.. code:: text
double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3)
double precision, allocatable :: weights_angular_points (n_points_integration_angular)
File: :file:`grid_becke.irp.f`
weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme
Subroutines / functions
-----------------------
.. c:function:: cell_function_becke
.. code:: text
double precision function cell_function_becke(r,atom_number)
File: :file:`step_function_becke.irp.f`
atom_number :: atom on which the cell function of Becke (1988, JCP,88(4)) r(1:3) :: x,y,z coordinantes of the current point
.. c:function:: derivative_knowles_function
.. code:: text
double precision function derivative_knowles_function(alpha,m,x)
File: :file:`integration_radial.irp.f`
Derivative of the function proposed by Knowles (JCP, 104, 1996) for distributing the radial points
.. c:function:: example_becke_numerical_grid
.. code:: text
subroutine example_becke_numerical_grid
File: :file:`example.irp.f`
subroutine that illustrates the main features available in becke_numerical_grid
.. c:function:: f_function_becke
.. code:: text
double precision function f_function_becke(x)
File: :file:`step_function_becke.irp.f`
.. c:function:: knowles_function
.. code:: text
double precision function knowles_function(alpha,m,x)
File: :file:`integration_radial.irp.f`
Function proposed by Knowles (JCP, 104, 1996) for distributing the radial points : the Log "m" function ( equation (7) in the paper )
.. c:function:: step_function_becke
.. code:: text
double precision function step_function_becke(x)
File: :file:`step_function_becke.irp.f`
Step function of the Becke paper (1988, JCP,88(4))

File diff suppressed because it is too large Load Diff

117
docs/source/modules/cis.rst Normal file
View File

@ -0,0 +1,117 @@
.. _cis:
.. program:: cis
.. default-role:: option
===
cis
===
This module contains a CIS program, built by setting the following rules:
* The only generator determinant is the Hartree-Fock (single-reference method)
* All generated singly excited determinants are included in the wave function (no perturbative
selection)
These rules are set in the ``H_apply.irp.f`` file.
EZFIO parameters
----------------
.. option:: energy
Variational |CIS| energy
Subroutines / functions
-----------------------
.. c:function:: cis
.. code:: text
subroutine cis
File: :file:`cis.irp.f`
Configuration Interaction with Single excitations.
.. c:function:: h_apply_cis
.. code:: text
subroutine H_apply_cis()
File: :file:`h_apply.irp.f_shell_8`
Calls H_apply on the |HF| determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
.. c:function:: h_apply_cis_diexc
.. code:: text
subroutine H_apply_cis_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in )
File: :file:`h_apply.irp.f_shell_8`
.. c:function:: h_apply_cis_diexcorg
.. code:: text
subroutine H_apply_cis_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in )
File: :file:`h_apply.irp.f_shell_8`
Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided.
.. c:function:: h_apply_cis_diexcp
.. code:: text
subroutine H_apply_cis_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in )
File: :file:`h_apply.irp.f_shell_8`
.. c:function:: h_apply_cis_monoexc
.. code:: text
subroutine H_apply_cis_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in )
File: :file:`h_apply.irp.f_shell_8`
Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided.

View File

@ -0,0 +1,117 @@
.. _cisd:
.. program:: cisd
.. default-role:: option
====
cisd
====
This module contains a CISD program, built by setting the following rules:
* The only generator determinant is the Hartree-Fock (single-reference method)
* All generated determinants are included in the wave function (no perturbative
selection)
These rules are set in the ``H_apply.irp.f`` file.
EZFIO parameters
----------------
.. option:: energy
Variational |CISD| energy
Subroutines / functions
-----------------------
.. c:function:: cisd
.. code:: text
subroutine cisd
File: :file:`cisd.irp.f`
Configuration Interaction with Single and Double excitations.
.. c:function:: h_apply_cisd
.. code:: text
subroutine H_apply_cisd()
File: :file:`h_apply.irp.f_shell_8`
Calls H_apply on the |HF| determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
.. c:function:: h_apply_cisd_diexc
.. code:: text
subroutine H_apply_cisd_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in )
File: :file:`h_apply.irp.f_shell_8`
.. c:function:: h_apply_cisd_diexcorg
.. code:: text
subroutine H_apply_cisd_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in )
File: :file:`h_apply.irp.f_shell_8`
Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided.
.. c:function:: h_apply_cisd_diexcp
.. code:: text
subroutine H_apply_cisd_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in )
File: :file:`h_apply.irp.f_shell_8`
.. c:function:: h_apply_cisd_monoexc
.. code:: text
subroutine H_apply_cisd_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in )
File: :file:`h_apply.irp.f_shell_8`
Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided.

View File

@ -0,0 +1,720 @@
.. _davidson:
.. program:: davidson
.. default-role:: option
========
davidson
========
Abstract module for Davidson's diagonalization.
It contains everything required for the Davidson algorithm, dressed or not. If
a dressing is used, the dressing column should be defined and the
:ref:`davidson_dressed` module should be used. If no dressing is required,
the :ref:`davidson` module should be used, and it has a default zero dressing vector.
The important providers for that module are:
# `psi_energy` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the Hamiltonian, dressed or not. It uses the general subroutine `u_0_H_u_0`.
# `psi_energy_bielec` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the standard two-electrons coulomb operator. It uses the general routine `u_0_H_u_0_bielec`.
EZFIO parameters
----------------
.. option:: threshold_davidson
Thresholds of Davidson's algorithm
Default: 1.e-10
.. option:: n_states_diag
Number of states to consider during the Davdison diagonalization
Default: 4
.. option:: davidson_sze_max
Number of micro-iterations before re-contracting
Default: 8
.. option:: state_following
If |true|, the states are re-ordered to match the input states
Default: False
.. option:: disk_based_davidson
If |true|, disk space is used to store the vectors
Default: False
.. option:: distributed_davidson
If |true|, use the distributed algorithm
Default: True
.. option:: only_expected_s2
If |true|, use filter out all vectors with bad |S^2| values
Default: True
Providers
---------
.. c:var:: ci_eigenvectors
.. code:: text
double precision, allocatable :: ci_electronic_energy (N_states_diag)
double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag)
double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag)
File: :file:`diagonalize_ci.irp.f`
Eigenvectors/values of the |CI| matrix
.. c:var:: ci_eigenvectors_s2
.. code:: text
double precision, allocatable :: ci_electronic_energy (N_states_diag)
double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag)
double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag)
File: :file:`diagonalize_ci.irp.f`
Eigenvectors/values of the |CI| matrix
.. c:var:: ci_electronic_energy
.. code:: text
double precision, allocatable :: ci_electronic_energy (N_states_diag)
double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag)
double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag)
File: :file:`diagonalize_ci.irp.f`
Eigenvectors/values of the |CI| matrix
.. c:var:: ci_energy
.. code:: text
double precision, allocatable :: ci_energy (N_states_diag)
File: :file:`diagonalize_ci.irp.f`
:c:data:`n_states` lowest eigenvalues of the |CI| matrix
.. c:var:: davidson_criterion
.. code:: text
character(64) :: davidson_criterion
File: :file:`parameters.irp.f`
Can be : [ energy | residual | both | wall_time | cpu_time | iterations ]
.. c:var:: dressed_column_idx
.. code:: text
integer, allocatable :: dressed_column_idx (N_states)
File: :file:`diagonalization_hs2_dressed.irp.f`
Index of the dressed columns
.. c:var:: n_states_diag
.. code:: text
integer :: n_states_diag
File: :file:`input.irp.f`
Number of states to consider during the Davdison diagonalization
.. c:var:: nthreads_davidson
.. code:: text
integer :: nthreads_davidson
File: :file:`davidson_parallel.irp.f`
Number of threads for Davidson
.. c:var:: psi_energy
.. code:: text
double precision, allocatable :: psi_energy (N_states)
File: :file:`u0_h_u0.irp.f`
Electronic energy of the current wave function
.. c:var:: psi_energy_bielec
.. code:: text
double precision, allocatable :: psi_energy_bielec (N_states)
File: :file:`u0_wee_u0.irp.f`
Energy of the current wave function
.. c:var:: psi_energy_with_nucl_rep
.. code:: text
double precision, allocatable :: psi_energy_with_nucl_rep (N_states)
File: :file:`u0_h_u0.irp.f`
Energy of the wave function with the nuclear repulsion energy.
Subroutines / functions
-----------------------
.. c:function:: davidson_collector
.. code:: text
subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze, N_st)
File: :file:`davidson_parallel.irp.f`
Routine collecting the results of the workers in Davidson's algorithm.
.. c:function:: davidson_converged
.. code:: text
subroutine davidson_converged(energy,residual,wall,iterations,cpu,N_st,converged)
File: :file:`parameters.irp.f`
True if the Davidson algorithm is converged
.. c:function:: davidson_diag_hjj_sjj
.. code:: text
subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged)
File: :file:`diagonalization_hs2_dressed.irp.f`
Davidson diagonalization with specific diagonal elements of the H matrix
H_jj : specific diagonal H matrix elements to diagonalize de Davidson
S2_out : Output : s^2
dets_in : bitmasks corresponding to determinants
u_in : guess coefficients on the various states. Overwritten on exit
dim_in : leftmost dimension of u_in
sze : Number of determinants
N_st : Number of eigenstates
N_st_diag : Number of states in which H is diagonalized. Assumed > sze
Initial guess vectors are not necessarily orthonormal
.. c:function:: davidson_diag_hs2
.. code:: text
subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_diag,Nint,dressing_state,converged)
File: :file:`diagonalization_hs2_dressed.irp.f`
Davidson diagonalization.
dets_in : bitmasks corresponding to determinants
u_in : guess coefficients on the various states. Overwritten on exit
dim_in : leftmost dimension of u_in
sze : Number of determinants
N_st : Number of eigenstates
Initial guess vectors are not necessarily orthonormal
.. c:function:: davidson_pull_results
.. code:: text
subroutine davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id)
File: :file:`davidson_parallel.irp.f`
Pull the results of :math:`H|U \rangle` on the master.
.. c:function:: davidson_push_results
.. code:: text
subroutine davidson_push_results(zmq_socket_push, v_t, s_t, imin, imax, task_id)
File: :file:`davidson_parallel.irp.f`
Push the results of :math:`H|U \rangle` from a worker to the master.
.. c:function:: davidson_run_slave
.. code:: text
subroutine davidson_run_slave(thread,iproc)
File: :file:`davidson_parallel.irp.f`
Slave routine for Davidson's diagonalization.
.. c:function:: davidson_slave_inproc
.. code:: text
subroutine davidson_slave_inproc(i)
File: :file:`davidson_parallel.irp.f`
.. c:function:: davidson_slave_tcp
.. code:: text
subroutine davidson_slave_tcp(i)
File: :file:`davidson_parallel.irp.f`
.. c:function:: davidson_slave_work
.. code:: text
subroutine davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_st, sze, worker_id)
File: :file:`davidson_parallel.irp.f`
.. c:function:: diagonalize_ci
.. code:: text
subroutine diagonalize_CI
File: :file:`diagonalize_ci.irp.f`
Replace the coefficients of the |CI| states by the coefficients of the eigenstates of the |CI| matrix.
.. c:function:: h_s2_u_0_bielec_nstates_openmp
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp(v_0,s_0,u_0,N_st,sze)
File: :file:`u0_wee_u0.irp.f`
Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle`
Assumes that the determinants are in psi_det
istart, iend, ishift, istep are used in ZMQ parallelization.
.. c:function:: h_s2_u_0_bielec_nstates_openmp_work
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_wee_u0.irp.f`
Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_bielec_nstates_openmp_work_1
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_wee_u0.irp.f_template_457`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_bielec_nstates_openmp_work_2
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_wee_u0.irp.f_template_457`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_bielec_nstates_openmp_work_3
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_wee_u0.irp.f_template_457`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_bielec_nstates_openmp_work_4
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_wee_u0.irp.f_template_457`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_bielec_nstates_openmp_work_n_int
.. code:: text
subroutine H_S2_u_0_bielec_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_wee_u0.irp.f_template_457`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_openmp
.. code:: text
subroutine H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze)
File: :file:`u0_h_u0.irp.f`
Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` .
Assumes that the determinants are in psi_det
istart, iend, ishift, istep are used in ZMQ parallelization.
.. c:function:: h_s2_u_0_nstates_openmp_work
.. code:: text
subroutine H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_h_u0.irp.f`
Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_openmp_work_1
.. code:: text
subroutine H_S2_u_0_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_h_u0.irp.f_template_468`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_openmp_work_2
.. code:: text
subroutine H_S2_u_0_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_h_u0.irp.f_template_468`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_openmp_work_3
.. code:: text
subroutine H_S2_u_0_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_h_u0.irp.f_template_468`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_openmp_work_4
.. code:: text
subroutine H_S2_u_0_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_h_u0.irp.f_template_468`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_openmp_work_n_int
.. code:: text
subroutine H_S2_u_0_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep)
File: :file:`u0_h_u0.irp.f_template_468`
Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle`
Default should be 1,N_det,0,1
.. c:function:: h_s2_u_0_nstates_zmq
.. code:: text
subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze)
File: :file:`davidson_parallel.irp.f`
Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle`
n : number of determinants
H_jj : array of :math:`\langle j|H|j \rangle`
S2_jj : array of :math:`\langle j|S^2|j \rangle`
.. c:function:: u_0_h_u_0
.. code:: text
subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze)
File: :file:`u0_h_u0.irp.f`
Computes :math:`E_0 = \frac{\langle u_0|H|u_0 \rangle}{\langle u_0|u_0 \rangle}`
n : number of determinants
.. c:function:: u_0_h_u_0_bielec
.. code:: text
subroutine u_0_H_u_0_bielec(e_0,u_0,n,keys_tmp,Nint,N_st,sze)
File: :file:`u0_wee_u0.irp.f`
Computes :math:`E_0 = \frac{ \langle u_0|H|u_0\rangle}{\langle u_0|u_0 \rangle}` .
n : number of determinants
.. c:function:: zmq_get_n_states_diag
.. code:: text
integer function zmq_get_N_states_diag(zmq_to_qp_run_socket, worker_id)
File: :file:`davidson_parallel.irp.f`
Get N_states_diag from the qp_run scheduler
.. c:function:: zmq_put_n_states_diag
.. code:: text
integer function zmq_put_N_states_diag(zmq_to_qp_run_socket,worker_id)
File: :file:`davidson_parallel.irp.f`
Put N_states_diag on the qp_run scheduler

View File

@ -0,0 +1,13 @@
.. _davidson_dressed:
.. program:: davidson_dressed
.. default-role:: option
================
davidson_dressed
================
Davidson with single-column dressing.

View File

@ -0,0 +1,45 @@
.. _davidson_undressed:
.. program:: davidson_undressed
.. default-role:: option
==================
davidson_undressed
==================
Module for main files Davidson's algorithm with no dressing.
Providers
---------
.. c:var:: dressing_column_h
.. code:: text
double precision, allocatable :: dressing_column_h (N_det,N_states)
double precision, allocatable :: dressing_column_s (N_det,N_states)
File: :file:`null_dressing_vector.irp.f`
Null dressing vectors
.. c:var:: dressing_column_s
.. code:: text
double precision, allocatable :: dressing_column_h (N_det,N_states)
double precision, allocatable :: dressing_column_s (N_det,N_states)
File: :file:`null_dressing_vector.irp.f`
Null dressing vectors

View File

@ -0,0 +1,119 @@
.. _density_for_dft:
.. program:: density_for_dft
.. default-role:: option
===============
density_for_dft
===============
This module defines the *provider* of the density used for the DFT related calculations.
This definition is done through the keyword :option:`density_for_dft density_for_dft`.
The density can be:
* WFT : the density is computed with a potentially multi determinant wave function (see variables `psi_det` and `psi_det`)# input_density : the density is set to a density previously stored in the |EZFIO| folder (see ``aux_quantities``)
* damping_rs_dft : the density is damped between the input_density and the WFT density, with a damping factor of :option:`density_for_dft damping_for_rs_dft`
EZFIO parameters
----------------
.. option:: density_for_dft
Type of density used for DFT calculation. If set to WFT , it uses the density of the wave function stored in (psi_det,psi_coef). If set to input_density it uses the one-body dm stored in aux_quantities/ . If set to damping_rs_dft it uses the damped density between WFT and input_density. In the ks_scf and rs_ks_scf programs, it is set to WFT.
Default: WFT
.. option:: damping_for_rs_dft
damping factor for the density used in RSFT.
Default: 0.5
Providers
---------
.. c:var:: one_body_dm_alpha_ao_for_dft
.. code:: text
double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states)
double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states)
File: :file:`density_for_dft.irp.f`
one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft
.. c:var:: one_body_dm_average_mo_for_dft
.. code:: text
double precision, allocatable :: one_body_dm_average_mo_for_dft (mo_num,mo_num)
File: :file:`density_for_dft.irp.f`
.. c:var:: one_body_dm_beta_ao_for_dft
.. code:: text
double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states)
double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states)
File: :file:`density_for_dft.irp.f`
one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft
.. c:var:: one_body_dm_mo_alpha_for_dft
.. code:: text
double precision, allocatable :: one_body_dm_mo_alpha_for_dft (mo_num,mo_num,N_states)
File: :file:`density_for_dft.irp.f`
density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density
.. c:var:: one_body_dm_mo_beta_for_dft
.. code:: text
double precision, allocatable :: one_body_dm_mo_beta_for_dft (mo_num,mo_num,N_states)
File: :file:`density_for_dft.irp.f`
density matrix for beta electrons in the MO basis used for all DFT calculations based on the density
.. c:var:: one_body_dm_mo_for_dft
.. code:: text
double precision, allocatable :: one_body_dm_mo_for_dft (mo_num,mo_num,N_states)
File: :file:`density_for_dft.irp.f`

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
.. _dft_keywords:
.. program:: dft_keywords
.. default-role:: option
============
dft_keywords
============
This module contains the main keywords related to a DFT calculation or RS-DFT calculation, such as:
* :option:`dft_keywords exchange_functional`
* :option:`dft_keywords correlation_functional`
* :option:`dft_keywords HF_exchange` : only relevent for the :c:func:`rs_ks_scf` program
The keyword for the **range separation parameter** :math:`\mu` is the :option:`ao_two_e_erf_ints mu_erf` keyword.
The keyword for the type of density used in RS-DFT calculation with a multi-configurational wave function is the :option:`density_for_dft density_for_dft` keyword.
EZFIO parameters
----------------
.. option:: exchange_functional
name of the exchange functional
Default: short_range_LDA
.. option:: correlation_functional
name of the correlation functional
Default: short_range_LDA
.. option:: HF_exchange
Percentage of HF exchange in the DFT model
Default: 0.
Providers
---------
.. c:var:: dft_type
.. code:: text
character*(32) :: dft_type
File: :file:`keywords.irp.f`
defines the type of DFT applied: LDA, GGA etc ...

View File

@ -0,0 +1,361 @@
.. _dft_utils_in_r:
.. program:: dft_utils_in_r
.. default-role:: option
==============
dft_utils_in_r
==============
This module contains most of the fundamental quantities (AOs, MOs or density derivatives) evaluated in real-space representation that are needed for the various DFT modules.
As these quantities might be used and re-used, the values at each point of the grid are stored (see ``becke_numerical_grid`` for more information on the grid).
The main providers for this module are:
* `aos_in_r_array`: values of the |AO| basis on the grid point.
* `mos_in_r_array`: values of the |MO| basis on the grid point.
* `one_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points.
Providers
---------
.. c:var:: aos_grad_in_r_array
.. code:: text
double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3)
double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3)
File: :file:`ao_in_r.irp.f`
aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point
aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point
k = 1 : x, k= 2, y, k 3, z
.. c:var:: aos_grad_in_r_array_transp
.. code:: text
double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3)
double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3)
File: :file:`ao_in_r.irp.f`
aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point
aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point
k = 1 : x, k= 2, y, k 3, z
.. c:var:: aos_in_r_array
.. code:: text
double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid)
double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num)
File: :file:`ao_in_r.irp.f`
aos_in_r_array(i,j) = value of the ith ao on the jth grid point
aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point
.. c:var:: aos_in_r_array_transp
.. code:: text
double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid)
double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num)
File: :file:`ao_in_r.irp.f`
aos_in_r_array(i,j) = value of the ith ao on the jth grid point
aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point
.. c:var:: aos_lapl_in_r_array
.. code:: text
double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3)
double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3)
File: :file:`ao_in_r.irp.f`
aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point
aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point
k = 1 : x, k= 2, y, k 3, z
.. c:var:: aos_lapl_in_r_array_transp
.. code:: text
double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3)
double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3)
File: :file:`ao_in_r.irp.f`
aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point
aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point
k = 1 : x, k= 2, y, k 3, z
.. c:var:: mos_grad_in_r_array
.. code:: text
double precision, allocatable :: mos_grad_in_r_array (mo_num,n_points_final_grid,3)
File: :file:`mo_in_r.irp.f`
mos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith mo on the jth grid point
mos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth mo on the ith grid point
k = 1 : x, k= 2, y, k 3, z
.. c:var:: mos_in_r_array
.. code:: text
double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid)
double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num)
File: :file:`mo_in_r.irp.f`
mos_in_r_array(i,j) = value of the ith mo on the jth grid point
mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point
.. c:var:: mos_in_r_array_transp
.. code:: text
double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid)
double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num)
File: :file:`mo_in_r.irp.f`
mos_in_r_array(i,j) = value of the ith mo on the jth grid point
mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point
.. c:var:: mos_lapl_in_r_array
.. code:: text
double precision, allocatable :: mos_lapl_in_r_array (mo_num,n_points_final_grid,3)
File: :file:`mo_in_r.irp.f`
mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point
mos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth mo on the ith grid point
k = 1 : x, k= 2, y, k 3, z
.. c:var:: one_body_dm_alpha_at_r
.. code:: text
double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number
.. c:var:: one_body_dm_beta_at_r
.. code:: text
double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number
.. c:var:: one_body_grad_2_dm_alpha_at_r
.. code:: text
double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number
.. c:var:: one_body_grad_2_dm_beta_at_r
.. code:: text
double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number
.. c:var:: one_dm_alpha_in_r
.. code:: text
double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states)
double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states)
File: :file:`dm_in_r.irp.f`
.. c:var:: one_dm_and_grad_alpha_in_r
.. code:: text
double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number
.. c:var:: one_dm_and_grad_beta_in_r
.. code:: text
double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number
.. c:var:: one_dm_beta_in_r
.. code:: text
double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states)
double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states)
File: :file:`dm_in_r.irp.f`
Subroutines / functions
-----------------------
.. c:function:: density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r
.. code:: text
subroutine density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r(r,dm_a,dm_b, grad_dm_a, grad_dm_b, aos_array, grad_aos_array)
File: :file:`dm_in_r.irp.f`
input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r : dm_b = beta density evaluated at r : aos_array(i) = ao(i) evaluated at r : grad_dm_a(1) = X gradient of the alpha density evaluated in r : grad_dm_a(1) = X gradient of the beta density evaluated in r : grad_aos_array(1) = X gradient of the aos(i) evaluated at r
.. c:function:: dm_dft_alpha_beta_and_all_aos_at_r
.. code:: text
subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array)
File: :file:`dm_in_r.irp.f`
input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r output : dm_b = beta density evaluated at r output : aos_array(i) = ao(i) evaluated at r
.. c:function:: dm_dft_alpha_beta_at_r
.. code:: text
subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b)
File: :file:`dm_in_r.irp.f`
input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r(3) output : dm_b = beta density evaluated at r(3)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
.. _dressing:
.. program:: dressing
.. default-role:: option
=========
dress_zmq
=========
Module to facilitate the construction of modules using dressed
Hamiltonians, parallelized with |ZeroMQ|.
EZFIO parameters
----------------
.. option:: thresh_dressed_ci
Threshold on the convergence of the dressed |CI| energy
Default: 1.e-5
.. option:: n_it_max_dressed_ci
Maximum number of dressed |CI| iterations
Default: 10
.. option:: dress_relative_error
Stop stochastic dressing when the relative error is smaller than :option:`perturbation PT2_relative_error`
Default: 0.001

View File

@ -0,0 +1,76 @@
.. _electrons:
.. program:: electrons
.. default-role:: option
=========
electrons
=========
Describes the electrons. For the moment, only the number of alpha
and beta electrons are provided by this module.
Assumptions
===========
* `elec_num` >= 0
* `elec_alpha_num` >= 0
* `elec_beta_num` >= 0
* `elec_alpha_num` >= `elec_beta_num`
EZFIO parameters
----------------
.. option:: elec_alpha_num
Numbers of electrons alpha ("up")
.. option:: elec_beta_num
Numbers of electrons beta ("down")
.. option:: elec_num
Numbers total of electrons (alpha + beta)
Default: = electrons.elec_alpha_num + electrons.elec_beta_num
Providers
---------
.. c:var:: elec_num
.. code:: text
integer :: elec_num
integer, allocatable :: elec_num_tab (2)
File: :file:`electrons.irp.f`
Numbers of alpha ("up") , beta ("down") and total electrons
.. c:var:: elec_num_tab
.. code:: text
integer :: elec_num
integer, allocatable :: elec_num_tab (2)
File: :file:`electrons.irp.f`
Numbers of alpha ("up") , beta ("down") and total electrons

View File

@ -0,0 +1,151 @@
.. _ezfio_files:
.. program:: ezfio_files
.. default-role:: option
===========
ezfio_files
===========
This modules essentially contains the name of the |EZFIO| directory in the
:c:data:`ezfio_filename` variable. This is read as the first argument of the
command-line, or as the :envvar:`QP_INPUT` environment variable.
Providers
---------
.. c:var:: ezfio_filename
.. code:: text
character*(128) :: ezfio_filename
File: :file:`ezfio.irp.f`
Name of EZFIO file. It is obtained from the QPACKAGE_INPUT environment variable if it is set, or as the 1st argument of the command line.
.. c:var:: ezfio_work_dir
.. code:: text
character*(128) :: ezfio_work_dir
File: :file:`ezfio.irp.f`
EZFIO/work/
.. c:var:: output_cpu_time_0
.. code:: text
double precision :: output_wall_time_0
double precision :: output_cpu_time_0
File: :file:`output.irp.f`
Initial CPU and wall times when printing in the output files
.. c:var:: output_wall_time_0
.. code:: text
double precision :: output_wall_time_0
double precision :: output_cpu_time_0
File: :file:`output.irp.f`
Initial CPU and wall times when printing in the output files
Subroutines / functions
-----------------------
.. c:function:: getunitandopen
.. code:: text
integer function getUnitAndOpen(f,mode)
File: :file:`get_unit_and_open.irp.f`
:f: file name
:mode: 'R' : READ, UNFORMATTED 'W' : WRITE, UNFORMATTED 'r' : READ, FORMATTED 'w' : WRITE, FORMATTED 'a' : APPEND, FORMATTED 'x' : READ/WRITE, FORMATTED
.. c:function:: write_bool
.. code:: text
subroutine write_bool(iunit,value,label)
File: :file:`output.irp.f`
Write an logical value in output
.. c:function:: write_double
.. code:: text
subroutine write_double(iunit,value,label)
File: :file:`output.irp.f`
Write a double precision value in output
.. c:function:: write_int
.. code:: text
subroutine write_int(iunit,value,label)
File: :file:`output.irp.f`
Write an integer value in output
.. c:function:: write_time
.. code:: text
subroutine write_time(iunit)
File: :file:`output.irp.f`
Write a time stamp in the output for chronological reconstruction

921
docs/source/modules/fci.rst Normal file
View File

@ -0,0 +1,921 @@
.. _fci:
.. program:: fci
.. default-role:: option
===
fci
===
Selected Full Configuration Interaction.
The :command:`FCI` program starts with a single determinant, or with the wave
function in the |EZFIO| database if :option:`determinants read_wf` is |true|.
Then, it will iteratively:
* Select the most important determinants from the external space and add them to the
internal space
* If :option:`determinants s2_eig` is |true|, add all the necessary
determinants to allow the eigenstates of |H| to be eigenstates of |S^2|
* Diagonalize |H| in the enlarged internal space
* Compute (stochastically) the second-order perturbative contribution to the energy
* Extrapolate the variational energy by fitting
:math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}`
The number of selected determinants at each iteration will be such that the
size of the wave function will double at every iteration. If :option:`determinants
s2_eig` is |true|, then the number of selected determinants will be 1.5x the
current number, and then all the additional determinants will be added.
By default, the program will stop when more than one million determinants have
been selected, or when the |PT2| energy is below :math:`10^{-4}`.
The variational and |PT2| energies of the iterations are stored in the
|EZFIO| database, in the :ref:`iterations` module.
Computation of the |PT2| energy
-------------------------------
At each iteration, the |PT2| energy is computed considering the Epstein-Nesbet
zeroth-order Hamiltonian:
.. math::
E_{\text{PT2}} = \sum_{ \alpha }
\frac{|\langle \Psi_S | \hat{H} | \alpha \rangle|^2}
{E - \langle \alpha | \hat{H} | \alpha \rangle}
where the |kalpha| determinants are generated by applying all the single and
double excitation operators to all the determinants of the wave function
:math:`\Psi_G`.
When the hybrid-deterministic/stochastic algorithm is chosen
(default), :math:`Psi_G = \Psi_S = \Psi`, the full wavefunction expanded in the
internal space.
When the deterministic algorithm is chosen (:option:`perturbation do_pt2`
is set to |false|), :math:`Psi_G` is a truncation of |Psi| using
:option:`determinants threshold_generators`, and :math:`Psi_S` is a truncation
of |Psi| using :option:`determinants threshold_selectors`, and re-weighted
by :math:`1/\langle \Psi_s | \Psi_s \rangle`.
At every iteration, while computing the |PT2|, the variance of the wave
function is also computed:
.. math::
\sigma^2 & = \langle \Psi | \hat{H}^2 | \Psi \rangle -
\langle \Psi | \hat{H} | \Psi \rangle^2 \\
& = \sum_{i \in \text{FCI}}
\langle \Psi | \hat{H} | i \rangle
\langle i | \hat{H} | \Psi \rangle -
\langle \Psi | \hat{H} | \Psi \rangle^2 \\
& = \sum_{ \alpha }
\langle |\Psi | \hat{H} | \alpha \rangle|^2.
The expression of the variance is the same as the expression of the |PT2|, with
a denominator of 1. It measures how far the wave function is from the |FCI|
solution. Note that the absence of denominator in the Heat-Bath selected |CI|
method is selection method by minimization of the variance, whereas |CIPSI| is
a selection method by minimization of the energy.
If :option:`perturbation do_pt2` is set to |false|, then the stochastic
|PT2| is not computed, and an approximate value is obtained from the |CIPSI|
selection. The calculation is faster, but the extrapolated |FCI| value is
less accurate. This way of running the code should be used when the only
goal is to generate a wave function, as for using |CIPSI| wave functions as
trial wave functions of |QMC| calculations for example.
The :command:`PT2` program reads the wave function of the |EZFIO| database
and computes the energy and the |PT2| contribution.
State-averaging
---------------
Extrapolated |FCI| energy
-------------------------
An estimate of the |FCI| energy is computed by extrapolating
.. math::
E=E_\text{FCI} - \alpha\, E_\text{PT2}
This extrapolation is done for all the requested states, and excitation
energies are printed as energy differences between the extrapolated
energies of the excited states and the extrapolated energy of the ground
state.
The extrapolations are given considering the 2 last points, the 3 last points, ...,
the 7 last points. The extrapolated value should be chosen such that the extrpolated
value is stable with the number of points.
EZFIO parameters
----------------
.. option:: energy
Calculated Selected |FCI| energy
.. option:: energy_pt2
Calculated |FCI| energy + |PT2|
Providers
---------
.. c:var:: initialize_pt2_e0_denominator
.. code:: text
logical :: initialize_pt2_e0_denominator
File: :file:`energy.irp.f`
If true, initialize pt2_E0_denominator
.. c:var:: pt2_cw
.. code:: text
double precision, allocatable :: pt2_w (N_det_generators)
double precision, allocatable :: pt2_cw (0:N_det_generators)
double precision :: pt2_w_t
double precision :: pt2_u_0
integer, allocatable :: pt2_n_0 (pt2_N_teeth+1)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_e0_denominator
.. code:: text
double precision, allocatable :: pt2_e0_denominator (N_states)
File: :file:`energy.irp.f`
E0 in the denominator of the PT2
.. c:var:: pt2_f
.. code:: text
integer, allocatable :: pt2_f (N_det_generators)
integer :: pt2_n_tasks_max
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_j
.. code:: text
integer, allocatable :: pt2_j (N_det_generators)
integer, allocatable :: pt2_r (N_det_generators)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_mindetinfirstteeth
.. code:: text
integer :: pt2_n_teeth
integer :: pt2_mindetinfirstteeth
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_n_0
.. code:: text
double precision, allocatable :: pt2_w (N_det_generators)
double precision, allocatable :: pt2_cw (0:N_det_generators)
double precision :: pt2_w_t
double precision :: pt2_u_0
integer, allocatable :: pt2_n_0 (pt2_N_teeth+1)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_n_tasks
.. code:: text
integer :: pt2_n_tasks
File: :file:`pt2_stoch_routines.irp.f`
Number of parallel tasks for the Monte Carlo
.. c:var:: pt2_n_tasks_max
.. code:: text
integer, allocatable :: pt2_f (N_det_generators)
integer :: pt2_n_tasks_max
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_n_teeth
.. code:: text
integer :: pt2_n_teeth
integer :: pt2_mindetinfirstteeth
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_r
.. code:: text
integer, allocatable :: pt2_j (N_det_generators)
integer, allocatable :: pt2_r (N_det_generators)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_stoch_istate
.. code:: text
integer :: pt2_stoch_istate
File: :file:`pt2_stoch_routines.irp.f`
State for stochatsic PT2
.. c:var:: pt2_u
.. code:: text
double precision, allocatable :: pt2_u (N_det_generators)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_u_0
.. code:: text
double precision, allocatable :: pt2_w (N_det_generators)
double precision, allocatable :: pt2_cw (0:N_det_generators)
double precision :: pt2_w_t
double precision :: pt2_u_0
integer, allocatable :: pt2_n_0 (pt2_N_teeth+1)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_w
.. code:: text
double precision, allocatable :: pt2_w (N_det_generators)
double precision, allocatable :: pt2_cw (0:N_det_generators)
double precision :: pt2_w_t
double precision :: pt2_u_0
integer, allocatable :: pt2_n_0 (pt2_N_teeth+1)
File: :file:`pt2_stoch_routines.irp.f`
.. c:var:: pt2_w_t
.. code:: text
double precision, allocatable :: pt2_w (N_det_generators)
double precision, allocatable :: pt2_cw (0:N_det_generators)
double precision :: pt2_w_t
double precision :: pt2_u_0
integer, allocatable :: pt2_n_0 (pt2_N_teeth+1)
File: :file:`pt2_stoch_routines.irp.f`
Subroutines / functions
-----------------------
.. c:function:: add_to_selection_buffer
.. code:: text
subroutine add_to_selection_buffer(b, det, val)
File: :file:`selection_buffer.irp.f`
.. c:function:: bitstring_to_list_in_selection
.. code:: text
subroutine bitstring_to_list_in_selection( string, list, n_elements, Nint)
File: :file:`selection.irp.f`
Gives the inidices(+1) of the bits set to 1 in the bit string
.. c:function:: create_selection_buffer
.. code:: text
subroutine create_selection_buffer(N, siz_, res)
File: :file:`selection_buffer.irp.f`
.. c:function:: delete_selection_buffer
.. code:: text
subroutine delete_selection_buffer(b)
File: :file:`selection_buffer.irp.f`
.. c:function:: fci
.. code:: text
subroutine fci
File: :file:`fci.irp.f`
Selected Full Configuration Interaction.
.. c:function:: fill_buffer_double
.. code:: text
subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, variance, norm, mat, buf)
File: :file:`selection.irp.f`
.. c:function:: get_d0
.. code:: text
subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
File: :file:`selection.irp.f`
.. c:function:: get_d1
.. code:: text
subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
File: :file:`selection.irp.f`
.. c:function:: get_d2
.. code:: text
subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
File: :file:`selection.irp.f`
.. c:function:: get_m0
.. code:: text
subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs)
File: :file:`selection.irp.f`
.. c:function:: get_m1
.. code:: text
subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs)
File: :file:`selection.irp.f`
.. c:function:: get_m2
.. code:: text
subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs)
File: :file:`selection.irp.f`
.. c:function:: get_mask_phase
.. code:: text
subroutine get_mask_phase(det1, pm, Nint)
File: :file:`selection.irp.f`
.. c:function:: get_phase_bi
.. code:: text
double precision function get_phase_bi(phasemask, s1, s2, h1, p1, h2, p2, Nint)
File: :file:`selection.irp.f`
.. c:function:: make_selection_buffer_s2
.. code:: text
subroutine make_selection_buffer_s2(b)
File: :file:`selection_buffer.irp.f`
.. c:function:: merge_selection_buffers
.. code:: text
subroutine merge_selection_buffers(b1, b2)
File: :file:`selection_buffer.irp.f`
Merges the selection buffers b1 and b2 into b2
.. c:function:: past_d1
.. code:: text
subroutine past_d1(bannedOrb, p)
File: :file:`selection.irp.f`
.. c:function:: past_d2
.. code:: text
subroutine past_d2(banned, p, sp)
File: :file:`selection.irp.f`
.. c:function:: pt2
.. code:: text
subroutine pt2
File: :file:`pt2.irp.f`
Second order perturbative correction to the wave function contained in the EZFIO directory.
.. c:function:: pt2_collector
.. code:: text
subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, variance, norm)
File: :file:`pt2_stoch_routines.irp.f`
.. c:function:: pt2_find_sample
.. code:: text
integer function pt2_find_sample(v, w)
File: :file:`pt2_stoch_routines.irp.f`
.. c:function:: pt2_find_sample_lr
.. code:: text
integer function pt2_find_sample_lr(v, w, l_in, r_in)
File: :file:`pt2_stoch_routines.irp.f`
.. c:function:: pt2_slave_inproc
.. code:: text
subroutine pt2_slave_inproc(i)
File: :file:`pt2_stoch_routines.irp.f`
.. c:function:: pull_pt2_results
.. code:: text
subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks)
File: :file:`run_pt2_slave.irp.f`
.. c:function:: pull_selection_results
.. code:: text
subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det, N, task_id, ntask)
File: :file:`run_selection_slave.irp.f`
.. c:function:: push_pt2_results
.. code:: text
subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, task_id, n_tasks)
File: :file:`run_pt2_slave.irp.f`
.. c:function:: push_selection_results
.. code:: text
subroutine push_selection_results(zmq_socket_push, pt2, variance, norm, b, task_id, ntask)
File: :file:`run_selection_slave.irp.f`
.. c:function:: run_pt2_slave
.. code:: text
subroutine run_pt2_slave(thread,iproc,energy)
File: :file:`run_pt2_slave.irp.f`
.. c:function:: run_selection_slave
.. code:: text
subroutine run_selection_slave(thread,iproc,energy)
File: :file:`run_selection_slave.irp.f`
.. c:function:: select_connected
.. code:: text
subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset)
File: :file:`selection.irp.f`
.. c:function:: select_singles_and_doubles
.. code:: text
subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,buf,subset,csubset)
File: :file:`selection.irp.f`
WARNING /!\ : It is assumed that the generators and selectors are psi_det_sorted
.. c:function:: selection_collector
.. code:: text
subroutine selection_collector(zmq_socket_pull, b, N, pt2, variance, norm)
File: :file:`zmq_selection.irp.f`
.. c:function:: selection_slave_inproc
.. code:: text
subroutine selection_slave_inproc(i)
File: :file:`zmq_selection.irp.f`
.. c:function:: sort_selection_buffer
.. code:: text
subroutine sort_selection_buffer(b)
File: :file:`selection_buffer.irp.f`
.. c:function:: splash_pq
.. code:: text
subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, interesting)
File: :file:`selection.irp.f`
.. c:function:: spot_isinwf
.. code:: text
subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting)
File: :file:`selection.irp.f`
.. c:function:: testteethbuilding
.. code:: text
logical function testTeethBuilding(minF, N)
File: :file:`pt2_stoch_routines.irp.f`
.. c:function:: zmq_pt2
.. code:: text
subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm)
File: :file:`pt2_stoch_routines.irp.f`
.. c:function:: zmq_selection
.. code:: text
subroutine ZMQ_selection(N_in, pt2, variance, norm)
File: :file:`zmq_selection.irp.f`

View File

@ -0,0 +1,19 @@
.. _generators_cas:
.. program:: generators_cas
.. default-role:: option
==============
generators_cas
==============
Module defining the generator determinants as those belonging to a |CAS|.
The |MOs| belonging to the |CAS| are those which were set as active with
the :ref:`qp_set_mo_class` command.
This module is intended to be included in the :file:`NEED` file to define
the generators as the |CAS| determinants, which can be useful to define post-CAS approaches (see cassd module for instance).

View File

@ -0,0 +1,145 @@
.. _generators_full:
.. program:: generators_full
.. default-role:: option
===============
generators_full
===============
Module defining the generator determinants as all the determinants of the
variational space.
This module is intended to be included in the :file:`NEED` file to define
a full set of generators.
Providers
---------
.. c:var:: degree_max_generators
.. code:: text
integer :: degree_max_generators
File: :file:`generators.irp.f`
Max degree of excitation (respect to HF) of the generators
.. c:var:: n_det_generators
.. code:: text
integer :: n_det_generators
File: :file:`generators.irp.f`
For Single reference wave functions, the number of generators is 1 : the Hartree-Fock determinant
.. c:var:: psi_coef_generators
.. code:: text
integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size)
double precision, allocatable :: psi_coef_generators (psi_det_size,N_states)
File: :file:`generators.irp.f`
For Single reference wave functions, the generator is the Hartree-Fock determinant
.. c:var:: psi_coef_sorted_gen
.. code:: text
integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size)
double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states)
integer, allocatable :: psi_det_sorted_gen_order (psi_det_size)
File: :file:`generators.irp.f`
For Single reference wave functions, the generator is the Hartree-Fock determinant
.. c:var:: psi_det_generators
.. code:: text
integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size)
double precision, allocatable :: psi_coef_generators (psi_det_size,N_states)
File: :file:`generators.irp.f`
For Single reference wave functions, the generator is the Hartree-Fock determinant
.. c:var:: psi_det_sorted_gen
.. code:: text
integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size)
double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states)
integer, allocatable :: psi_det_sorted_gen_order (psi_det_size)
File: :file:`generators.irp.f`
For Single reference wave functions, the generator is the Hartree-Fock determinant
.. c:var:: psi_det_sorted_gen_order
.. code:: text
integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size)
double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states)
integer, allocatable :: psi_det_sorted_gen_order (psi_det_size)
File: :file:`generators.irp.f`
For Single reference wave functions, the generator is the Hartree-Fock determinant
.. c:var:: select_max
.. code:: text
double precision, allocatable :: select_max (size_select_max)
File: :file:`generators.irp.f`
Memo to skip useless selectors
.. c:var:: size_select_max
.. code:: text
integer :: size_select_max
File: :file:`generators.irp.f`
Size of the select_max array

View File

@ -0,0 +1,233 @@
.. _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 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:`hartree_fock fock_matrix_hf.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
EZFIO parameters
----------------
.. option:: energy
Energy HF
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_hf.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_hf.irp.f`
Alpha Fock matrix in AO basis set
.. c:var:: extra_e_contrib_density
.. code:: text
double precision :: extra_e_contrib_density
File: :file:`hf_energy.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 - trace of the V_xc potential
.. 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_hf.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_hf.irp.f`
Alpha Fock matrix in AO basis set
.. c:var:: hf_energy
.. code:: text
double precision :: hf_energy
double precision :: hf_two_electron_energy
double precision :: hf_one_electron_energy
File: :file:`hf_energy.irp.f`
Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components.
.. c:var:: hf_one_electron_energy
.. code:: text
double precision :: hf_energy
double precision :: hf_two_electron_energy
double precision :: hf_one_electron_energy
File: :file:`hf_energy.irp.f`
Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components.
.. c:var:: hf_two_electron_energy
.. code:: text
double precision :: hf_energy
double precision :: hf_two_electron_energy
double precision :: hf_one_electron_energy
File: :file:`hf_energy.irp.f`
Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components.
Subroutines / functions
-----------------------
.. c:function:: create_guess
.. code:: text
subroutine create_guess
File: :file:`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:`scf.irp.f`
Run SCF calculation
.. c:function:: scf
.. code:: text
subroutine scf
File: :file:`scf.irp.f`
Produce `Hartree_Fock` |MOs|
output: mo_basis.mo_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

View File

@ -0,0 +1,114 @@
.. _iterations:
.. program:: iterations
.. default-role:: option
==========
iterations
==========
Module which saves the computed energies for an extrapolation to
the |FCI| limit.
EZFIO parameters
----------------
.. option:: n_iter
Number of saved iterations
Default: 1
.. option:: n_det_iterations
Number of determinants at each iteration
.. option:: energy_iterations
The variational energy at each iteration
.. option:: pt2_iterations
The |PT2| correction at each iteration
Providers
---------
.. c:var:: extrapolated_energy
.. code:: text
double precision, allocatable :: extrapolated_energy (N_iter,N_states)
File: :file:`iterations.irp.f`
Extrapolated energy, using E_var = f(PT2) where PT2=0
.. c:var:: n_iter
.. code:: text
integer :: n_iter
File: :file:`io.irp.f`
number of iterations
Subroutines / functions
-----------------------
.. c:function:: print_extrapolated_energy
.. code:: text
subroutine print_extrapolated_energy(e_,pt2_)
File: :file:`print_extrapolation.irp.f`
Print the extrapolated energy in the output
.. c:function:: print_summary
.. code:: text
subroutine print_summary(e_,pt2_,error_,variance_,norm_)
File: :file:`print_summary.irp.f`
Print the extrapolated energy in the output
.. c:function:: save_iterations
.. code:: text
subroutine save_iterations(e_, pt2_,n_)
File: :file:`iterations.irp.f`
Update the energy in the EZFIO file.

View File

@ -0,0 +1,87 @@
.. _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:: 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.
Subroutines / functions
-----------------------
.. 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_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,259 @@
.. _kohn_sham_rs:
.. program:: kohn_sham_rs
.. default-role:: option
============
kohn_sham_rs
============
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_ints 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
EZFIO parameters
----------------
.. option:: energy
Energy range separated hybrid
Providers
---------
.. 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:: 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_rs_ks.irp.f`
Mono electronic an Coulomb 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_rs_ks.irp.f`
Mono electronic an Coulomb matrix in AO basis set
.. c:var:: fock_matrix_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.
.. c:var:: one_electron_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.
.. 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.
.. c:var:: trace_potential_xc
.. 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.
.. c:var:: two_electron_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.
Subroutines / functions
-----------------------
.. c:function:: check_coherence_functional
.. code:: text
subroutine check_coherence_functional
File: :file:`rs_ks_scf.irp.f`
.. c:function:: rs_ks_scf
.. code:: text
subroutine rs_ks_scf
File: :file:`rs_ks_scf.irp.f`
Produce `Range_separated_Kohn_Sham` MO orbital output: mo_basis.mo_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,370 @@
.. _mo_basis:
.. program:: mo_basis
.. default-role:: option
========
mo_basis
========
Molecular orbitals are expressed as
.. math::
\phi_k({\bf r}) = \sum_i C_{ik} \chi_k({\bf r})
where :math:`\chi_k` are *normalized* atomic basis functions.
The current set of |MOs| has a label `mo_label`.
When the orbitals are modified, the label should also be updated to keep
everything consistent.
When saving the |MOs|, the :file:`mo_basis` directory of the |EZFIO| database
is copied in the :file:`save` directory, named by the current `mo_label`. All
this is done with the script named :file:`save_current_mos.sh` in the
:file:`$QP_ROOT/scripts` directory.
EZFIO parameters
----------------
.. option:: mo_num
Total number of |MOs|
.. option:: mo_coef
Coefficient of the i-th |AO| on the j-th |MO|
.. option:: mo_label
Label characterizing the MOS (Local, Canonical, Natural, *etc*)
.. option:: mo_occ
|MO| occupation numbers
.. option:: mo_class
[ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class`
.. option:: ao_md5
MD5 checksum characterizing the |AO| basis set.
Providers
---------
.. c:var:: mo_coef
.. code:: text
double precision, allocatable :: mo_coef (ao_num,mo_num)
File: :file:`mos.irp.f`
Molecular orbital coefficients on |AO| basis set
mo_coef(i,j) = coefficient of the i-th |AO| on the jth mo
mo_label : Label characterizing the MOS (local, canonical, natural, etc)
.. c:var:: mo_coef_begin_iteration
.. code:: text
double precision, allocatable :: mo_coef_begin_iteration (ao_num,mo_num)
File: :file:`track_orb.irp.f`
Void provider to store the coefficients of the |MO| basis at the beginning of the SCF iteration
Usefull to track some orbitals
.. c:var:: mo_coef_in_ao_ortho_basis
.. code:: text
double precision, allocatable :: mo_coef_in_ao_ortho_basis (ao_num,mo_num)
File: :file:`mos.irp.f`
|MO| coefficients in orthogonalized |AO| basis
:math:`C^{-1}.C_{mo}`
.. c:var:: mo_coef_transp
.. code:: text
double precision, allocatable :: mo_coef_transp (mo_num,ao_num)
File: :file:`mos.irp.f`
|MO| coefficients on |AO| basis set
.. c:var:: mo_label
.. code:: text
character*(64) :: mo_label
File: :file:`mos.irp.f`
|MO| coefficients on |AO| basis set
mo_coef(i,j) = coefficient of the i-th |AO| on the j-th |MO|
mo_label : Label characterizing the |MOs| (local, canonical, natural, etc)
.. c:var:: mo_num
.. code:: text
integer :: mo_num
File: :file:`mos.irp.f`
Number of MOs
.. c:var:: mo_occ
.. code:: text
double precision, allocatable :: mo_occ (mo_num)
File: :file:`mos.irp.f`
|MO| occupation numbers
Subroutines / functions
-----------------------
.. c:function:: ao_ortho_cano_to_ao
.. code:: text
subroutine ao_ortho_cano_to_ao(A_ao,LDA_ao,A,LDA)
File: :file:`mos.irp.f`
Transform A from the |AO| basis to the orthogonal |AO| basis
:math:`C^{-1}.A_{ao}.C^\dagger^{-1}`
.. c:function:: ao_to_mo
.. code:: text
subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo)
File: :file:`mos.irp.f`
Transform A from the |AO| basis to the |MO| basis
:math:`C^\dagger.A_{ao}.C`
.. c:function:: give_all_mos_and_grad_and_lapl_at_r
.. code:: text
subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_lapl_array)
File: :file:`mos_in_r.irp.f`
.. c:function:: give_all_mos_and_grad_at_r
.. code:: text
subroutine give_all_mos_and_grad_at_r(r,mos_array,mos_grad_array)
File: :file:`mos_in_r.irp.f`
.. c:function:: give_all_mos_at_r
.. code:: text
subroutine give_all_mos_at_r(r,mos_array)
File: :file:`mos_in_r.irp.f`
.. c:function:: initialize_mo_coef_begin_iteration
.. code:: text
subroutine initialize_mo_coef_begin_iteration
File: :file:`track_orb.irp.f`
Initialize :c:data:`mo_coef_begin_iteration` to the current :c:data:`mo_coef`
.. c:function:: mix_mo_jk
.. code:: text
subroutine mix_mo_jk(j,k)
File: :file:`mos.irp.f`
Rotates the j-th |MO| with the k-th |MO| to give two new |MOs| that are
* :math:`+ = \frac{1}{\sqrt{2}} (|j\rangle + |k\rangle)`
* :math:`- = \frac{1}{\sqrt{2}} (|j\rangle - |k\rangle)`
by convention, the '+' |MO| is in the lowest index (min(j,k)) by convention, the '-' |MO| is in the highest index (max(j,k))
.. c:function:: mo_as_eigvectors_of_mo_matrix
.. code:: text
subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label,sign,output)
File: :file:`utils.irp.f`
.. c:function:: mo_as_svd_vectors_of_mo_matrix
.. code:: text
subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label)
File: :file:`utils.irp.f`
.. c:function:: mo_as_svd_vectors_of_mo_matrix_eig
.. code:: text
subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label)
File: :file:`utils.irp.f`
.. c:function:: reorder_active_orb
.. code:: text
subroutine reorder_active_orb
File: :file:`track_orb.irp.f`
routines that takes the current :c:data:`mo_coef` and reorder the active orbitals (see :c:data:`list_act` and :c:data:`n_act_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration`
.. c:function:: save_mos
.. code:: text
subroutine save_mos
File: :file:`utils.irp.f`
.. c:function:: save_mos_truncated
.. code:: text
subroutine save_mos_truncated(n)
File: :file:`utils.irp.f`

View File

@ -0,0 +1,87 @@
.. _mo_guess:
.. program:: mo_guess
.. default-role:: option
========
mo_guess
========
Guess for |MOs|.
Providers
---------
.. c:var:: ao_ortho_canonical_nucl_elec_integrals
.. code:: text
double precision, allocatable :: ao_ortho_canonical_nucl_elec_integrals (mo_num,mo_num)
File: :file:`pot_mo_ortho_canonical_ints.irp.f`
.. c:var:: ao_ortho_lowdin_coef
.. code:: text
double precision, allocatable :: ao_ortho_lowdin_coef (ao_num,ao_num)
File: :file:`mo_ortho_lowdin.irp.f`
matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_lowdin_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_lowdin orbital
.. c:var:: ao_ortho_lowdin_nucl_elec_integrals
.. code:: text
double precision, allocatable :: ao_ortho_lowdin_nucl_elec_integrals (mo_num,mo_num)
File: :file:`pot_mo_ortho_lowdin_ints.irp.f`
.. c:var:: ao_ortho_lowdin_overlap
.. code:: text
double precision, allocatable :: ao_ortho_lowdin_overlap (ao_num,ao_num)
File: :file:`mo_ortho_lowdin.irp.f`
overlap matrix of the ao_ortho_lowdin supposed to be the Identity
Subroutines / functions
-----------------------
.. c:function:: hcore_guess
.. code:: text
subroutine hcore_guess
File: :file:`h_core_guess_routine.irp.f`
Produce `H_core` MO orbital

View File

@ -0,0 +1,287 @@
.. _mo_one_e_ints:
.. program:: mo_one_e_ints
.. default-role:: option
==================
mo_one_e_integrals
==================
All the one-electron integrals in |MO| basis are defined here.
The most important providers for usual quantum-chemistry calculation are:
* `mo_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_mo_ints.irp.f`)
* `mo_nucl_elec_integrals` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_mo_ints.irp.f`)
* `mo_mono_elec_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`mo_mono_ints.irp.f`)
Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_mo.irp.f`.
EZFIO parameters
----------------
.. option:: mo_integrals_e_n
Nucleus-electron integrals in |MO| basis set
.. option:: io_mo_integrals_e_n
Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ]
Default: None
.. option:: mo_integrals_kinetic
Kinetic energy integrals in |MO| basis set
.. option:: io_mo_integrals_kinetic
Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ]
Default: None
.. option:: mo_integrals_pseudo
Pseudopotential integrals in |MO| basis set
.. option:: io_mo_integrals_pseudo
Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ]
Default: None
.. option:: mo_one_e_integrals
One-electron integrals in |MO| basis set
.. option:: io_mo_one_e_integrals
Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ]
Default: None
Providers
---------
.. c:var:: mo_dipole_x
.. code:: text
double precision, allocatable :: mo_dipole_x (mo_num,mo_num)
double precision, allocatable :: mo_dipole_y (mo_num,mo_num)
double precision, allocatable :: mo_dipole_z (mo_num,mo_num)
File: :file:`spread_dipole_mo.irp.f`
array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j
.. c:var:: mo_dipole_y
.. code:: text
double precision, allocatable :: mo_dipole_x (mo_num,mo_num)
double precision, allocatable :: mo_dipole_y (mo_num,mo_num)
double precision, allocatable :: mo_dipole_z (mo_num,mo_num)
File: :file:`spread_dipole_mo.irp.f`
array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j
.. c:var:: mo_dipole_z
.. code:: text
double precision, allocatable :: mo_dipole_x (mo_num,mo_num)
double precision, allocatable :: mo_dipole_y (mo_num,mo_num)
double precision, allocatable :: mo_dipole_z (mo_num,mo_num)
File: :file:`spread_dipole_mo.irp.f`
array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j
.. c:var:: mo_kinetic_integrals
.. code:: text
double precision, allocatable :: mo_kinetic_integrals (mo_num,mo_num)
File: :file:`kin_mo_ints.irp.f`
Kinetic energy integrals in the MO basis
.. c:var:: mo_mono_elec_integrals
.. code:: text
double precision, allocatable :: mo_mono_elec_integrals (mo_num,mo_num)
File: :file:`mo_one_e_ints.irp.f`
array of the mono electronic hamiltonian on the MOs basis : sum of the kinetic and nuclear electronic potential (and pseudo potential if needed)
.. c:var:: mo_nucl_elec_integrals
.. code:: text
double precision, allocatable :: mo_nucl_elec_integrals (mo_num,mo_num)
File: :file:`pot_mo_ints.irp.f`
Nucleus-electron interaction on the |MO| basis
.. c:var:: mo_nucl_elec_integrals_per_atom
.. code:: text
double precision, allocatable :: mo_nucl_elec_integrals_per_atom (mo_num,mo_num,nucl_num)
File: :file:`pot_mo_ints.irp.f`
mo_nucl_elec_integrals_per_atom(i,j,k) = :math:`\langle \phi_i| -\frac{1}{|r-R_k|} | \phi_j \rangle` . where R_k is the coordinate of the k-th nucleus.
.. c:var:: mo_overlap
.. code:: text
double precision, allocatable :: mo_overlap (mo_num,mo_num)
File: :file:`mo_overlap.irp.f`
Provider to check that the MOs are indeed orthonormal.
.. c:var:: mo_pseudo_integrals
.. code:: text
double precision, allocatable :: mo_pseudo_integrals (mo_num,mo_num)
File: :file:`pot_mo_pseudo_ints.irp.f`
Pseudopotential integrals in |MO| basis
.. c:var:: mo_spread_x
.. code:: text
double precision, allocatable :: mo_spread_x (mo_num,mo_num)
double precision, allocatable :: mo_spread_y (mo_num,mo_num)
double precision, allocatable :: mo_spread_z (mo_num,mo_num)
File: :file:`spread_dipole_mo.irp.f`
array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j
.. c:var:: mo_spread_y
.. code:: text
double precision, allocatable :: mo_spread_x (mo_num,mo_num)
double precision, allocatable :: mo_spread_y (mo_num,mo_num)
double precision, allocatable :: mo_spread_z (mo_num,mo_num)
File: :file:`spread_dipole_mo.irp.f`
array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j
.. c:var:: mo_spread_z
.. code:: text
double precision, allocatable :: mo_spread_x (mo_num,mo_num)
double precision, allocatable :: mo_spread_y (mo_num,mo_num)
double precision, allocatable :: mo_spread_z (mo_num,mo_num)
File: :file:`spread_dipole_mo.irp.f`
array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j
.. c:var:: s_mo_coef
.. code:: text
double precision, allocatable :: s_mo_coef (ao_num,mo_num)
File: :file:`ao_to_mo.irp.f`
Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix.
Subroutines / functions
-----------------------
.. c:function:: mo_to_ao
.. code:: text
subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao)
File: :file:`ao_to_mo.irp.f`
Transform A from the MO basis to the AO basis
(S.C).A_mo.(S.C)t
.. c:function:: orthonormalize_mos
.. code:: text
subroutine orthonormalize_mos
File: :file:`orthonormalize.irp.f`

View File

@ -0,0 +1,488 @@
.. _mo_two_e_erf_ints:
.. program:: mo_two_e_erf_ints
.. default-role:: option
======================
mo_two_e_erf_ints
======================
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_ints 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:: io_mo_two_e_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_num,mo_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_num,mo_num,mo_num)
double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_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_num,mo_num,mo_num)
double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_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_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_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_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_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_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_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_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_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_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_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_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_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
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 :math:`\langle ij|kl \rangle` 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 :math:`\langle ij|kl \rangle` 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 :math:`\langle ki|li \rangle`
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 :math:`\langle ki|il \rangle`
:math:`\int k(1)i(2) \frac{1}{r_{12}} 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 :math:`\langle ik|jl \rangle` in the |MO| basis, all :math:`\int i(1)j(1) \frac{\erf(\mu * r_{12})}{r_{12}} 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 :math:`\langle ij|kl \rangle` in the |MO| basis, all :math:`\int i(1)j(2) \frac{1}{r_{12}} 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`
Returns 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 |MO| erf 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 :math:`\langle ij|kl \rangle` 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,590 @@
.. _mo_two_e_ints:
.. program:: mo_two_e_ints
.. default-role:: option
==================
mo_two_e_ints
==================
Here, all two-electron integrals (:math:`1/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`.
To fetch an |AO| integral, use the
`get_ao_bielec_integral(i,j,k,l,ao_integrals_map)` function, and
to fetch an |MO| integral, use
`get_mo_bielec_integral(i,j,k,l,mo_integrals_map)` or
`mo_bielec_integral(i,j,k,l)`.
The conventions are:
* For |AO| integrals : (ik|jl) = (11|22)
* For |MO| integrals : <ij|kl> = <12|12>
EZFIO parameters
----------------
.. option:: io_mo_two_e_integrals
Read/Write |MO| integrals from/to disk [ Write | Read | None ]
Default: None
.. option:: mo_integrals_threshold
If | <ij|kl> | < `mo_integrals_threshold` then <ij|kl> is zero
Default: 1.e-15
.. option:: no_vvvv_integrals
If `True`, computes all integrals except for the integrals having 4 virtual indices
Default: False
.. option:: no_ivvv_integrals
Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual indices and 1 belonging to the core inactive active orbitals
Default: False
.. option:: no_vvv_integrals
Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual orbitals
Default: False
Providers
---------
.. c:var:: big_array_coulomb_integrals
.. code:: text
double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num)
double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num)
File: :file:`integrals_3_index.irp.f`
big_array_coulomb_integrals(i,j) = <ij|ij> = (ii|jj)
big_array_exchange_integrals(i,j) = <ij|ji> = (ij|ij)
.. c:var:: big_array_exchange_integrals
.. code:: text
double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num)
double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num)
File: :file:`integrals_3_index.irp.f`
big_array_coulomb_integrals(i,j) = <ij|ij> = (ii|jj)
big_array_exchange_integrals(i,j) = <ij|ji> = (ij|ij)
.. c:var:: core_energy
.. code:: text
double precision :: core_energy
File: :file:`core_quantities.irp.f`
energy from the core : contains all core-core contributions
.. c:var:: core_fock_operator
.. code:: text
double precision, allocatable :: core_fock_operator (mo_num,mo_num)
File: :file:`core_quantities.irp.f`
this is the contribution to the Fock operator from the core electrons
.. c:var:: insert_into_mo_integrals_map
.. code:: text
subroutine insert_into_mo_integrals_map(n_integrals, &
buffer_i, buffer_values, thr)
File: :file:`map_integrals.irp.f`
Create new entry into MO map, or accumulate in an existing entry
.. c:var:: mo_bielec_integral_jj
.. code:: text
double precision, allocatable :: mo_bielec_integral_jj (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_exchange (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_anti (mo_num,mo_num)
File: :file:`mo_bi_integrals.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_bielec_integral_jj_anti
.. code:: text
double precision, allocatable :: mo_bielec_integral_jj (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_exchange (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_anti (mo_num,mo_num)
File: :file:`mo_bi_integrals.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_bielec_integral_jj_anti_from_ao
.. code:: text
double precision, allocatable :: mo_bielec_integral_jj_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_anti_from_ao (mo_num,mo_num)
File: :file:`mo_bi_integrals.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_bielec_integral_jj_exchange
.. code:: text
double precision, allocatable :: mo_bielec_integral_jj (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_exchange (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_anti (mo_num,mo_num)
File: :file:`mo_bi_integrals.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_bielec_integral_jj_exchange_from_ao
.. code:: text
double precision, allocatable :: mo_bielec_integral_jj_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_anti_from_ao (mo_num,mo_num)
File: :file:`mo_bi_integrals.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_bielec_integral_jj_from_ao
.. code:: text
double precision, allocatable :: mo_bielec_integral_jj_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_jj_anti_from_ao (mo_num,mo_num)
File: :file:`mo_bi_integrals.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_bielec_integral_vv_anti_from_ao
.. code:: text
double precision, allocatable :: mo_bielec_integral_vv_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_vv_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_vv_anti_from_ao (mo_num,mo_num)
File: :file:`mo_bi_integrals.irp.f`
mo_bielec_integral_vv_from_ao(i,j) = J_ij mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals
.. c:var:: mo_bielec_integral_vv_exchange_from_ao
.. code:: text
double precision, allocatable :: mo_bielec_integral_vv_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_vv_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_vv_anti_from_ao (mo_num,mo_num)
File: :file:`mo_bi_integrals.irp.f`
mo_bielec_integral_vv_from_ao(i,j) = J_ij mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals
.. c:var:: mo_bielec_integral_vv_from_ao
.. code:: text
double precision, allocatable :: mo_bielec_integral_vv_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_vv_exchange_from_ao (mo_num,mo_num)
double precision, allocatable :: mo_bielec_integral_vv_anti_from_ao (mo_num,mo_num)
File: :file:`mo_bi_integrals.irp.f`
mo_bielec_integral_vv_from_ao(i,j) = J_ij mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals
.. c:var:: mo_bielec_integrals_in_map
.. code:: text
logical :: mo_bielec_integrals_in_map
File: :file:`mo_bi_integrals.irp.f`
If True, the map of MO bielectronic integrals is provided
.. c:var:: mo_integrals_cache
.. code:: text
double precision, allocatable :: mo_integrals_cache (0_8:128_8*128_8*128_8*128_8)
File: :file:`map_integrals.irp.f`
Cache of MO integrals for fast access
.. c:var:: mo_integrals_cache_max
.. code:: text
integer*4 :: mo_integrals_cache_min
integer*4 :: mo_integrals_cache_max
integer*8 :: mo_integrals_cache_min_8
integer*8 :: mo_integrals_cache_max_8
File: :file:`map_integrals.irp.f`
Min and max values of the MOs for which the integrals are in the cache
.. c:var:: mo_integrals_cache_max_8
.. code:: text
integer*4 :: mo_integrals_cache_min
integer*4 :: mo_integrals_cache_max
integer*8 :: mo_integrals_cache_min_8
integer*8 :: mo_integrals_cache_max_8
File: :file:`map_integrals.irp.f`
Min and max values of the MOs for which the integrals are in the cache
.. c:var:: mo_integrals_cache_min
.. code:: text
integer*4 :: mo_integrals_cache_min
integer*4 :: mo_integrals_cache_max
integer*8 :: mo_integrals_cache_min_8
integer*8 :: mo_integrals_cache_max_8
File: :file:`map_integrals.irp.f`
Min and max values of the MOs for which the integrals are in the cache
.. c:var:: mo_integrals_cache_min_8
.. code:: text
integer*4 :: mo_integrals_cache_min
integer*4 :: mo_integrals_cache_max
integer*8 :: mo_integrals_cache_min_8
integer*8 :: mo_integrals_cache_max_8
File: :file:`map_integrals.irp.f`
Min and max values of the MOs for which the integrals are in the cache
.. c:var:: mo_integrals_map
.. code:: text
type(map_type) :: mo_integrals_map
File: :file:`map_integrals.irp.f`
MO integrals
Subroutines / functions
-----------------------
.. c:function:: add_integrals_to_map
.. code:: text
subroutine add_integrals_to_map(mask_ijkl)
File: :file:`mo_bi_integrals.irp.f`
Adds integrals to tha MO map according to some bitmask
.. c:function:: add_integrals_to_map_no_exit_34
.. code:: text
subroutine add_integrals_to_map_no_exit_34(mask_ijkl)
File: :file:`mo_bi_integrals.irp.f`
Adds integrals to tha MO map according to some bitmask
.. c:function:: add_integrals_to_map_three_indices
.. code:: text
subroutine add_integrals_to_map_three_indices(mask_ijk)
File: :file:`mo_bi_integrals.irp.f`
Adds integrals to tha MO map according to some bitmask
.. c:function:: clear_mo_map
.. code:: text
subroutine clear_mo_map
File: :file:`mo_bi_integrals.irp.f`
Frees the memory of the MO map
.. c:function:: dump_mo_integrals
.. code:: text
subroutine dump_mo_integrals(filename)
File: :file:`map_integrals.irp.f`
Save to disk the |MO| integrals
.. c:function:: get_mo_bielec_integral
.. code:: text
double precision function get_mo_bielec_integral(i,j,k,l,map)
File: :file:`map_integrals.irp.f`
Returns one integral <ij|kl> in the MO basis
.. c:function:: get_mo_bielec_integrals
.. code:: text
subroutine get_mo_bielec_integrals(j,k,l,sze,out_val,map)
File: :file:`map_integrals.irp.f`
Returns multiple integrals <ij|kl> in the MO basis, all i for j,k,l fixed.
.. c:function:: get_mo_bielec_integrals_coulomb_ii
.. code:: text
subroutine get_mo_bielec_integrals_coulomb_ii(k,l,sze,out_val,map)
File: :file:`map_integrals.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_exch_ii
.. code:: text
subroutine get_mo_bielec_integrals_exch_ii(k,l,sze,out_val,map)
File: :file:`map_integrals.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_i1j1
.. code:: text
subroutine get_mo_bielec_integrals_i1j1(k,l,sze,out_array,map)
File: :file:`map_integrals.irp.f`
Returns multiple integrals <ik|jl> in the MO basis, all i(1)j(1) 1/r12 k(2)l(2) i, j for k,l fixed.
.. c:function:: get_mo_bielec_integrals_ij
.. code:: text
subroutine get_mo_bielec_integrals_ij(k,l,sze,out_array,map)
File: :file:`map_integrals.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_map_size
.. code:: text
integer*8 function get_mo_map_size()
File: :file:`map_integrals.irp.f`
Return the number of elements in the MO map
.. c:function:: load_mo_integrals
.. code:: text
integer function load_mo_integrals(filename)
File: :file:`map_integrals.irp.f`
Read from disk the |MO| integrals
.. c:function:: mo_bielec_integral
.. code:: text
double precision function mo_bielec_integral(i,j,k,l)
File: :file:`map_integrals.irp.f`
Returns one integral <ij|kl> in the MO basis
.. c:function:: mo_bielec_integrals_index
.. code:: text
subroutine mo_bielec_integrals_index(i,j,k,l,i1)
File: :file:`mo_bi_integrals.irp.f`
Computes an unique index for i,j,k,l integrals

130
docs/source/modules/mpi.rst Normal file
View File

@ -0,0 +1,130 @@
.. _mpi:
.. program:: mpi
.. default-role:: option
===
mpi
===
Contains all the functions and providers for parallelization with |MPI|.
Providers
---------
.. c:var:: mpi_initialized
.. code:: text
logical :: mpi_initialized
File: :file:`mpi.irp.f`
Always true. Initialized MPI
.. c:var:: mpi_master
.. code:: text
logical :: mpi_master
File: :file:`mpi.irp.f`
If true, rank is zero
.. c:var:: mpi_rank
.. code:: text
integer :: mpi_rank
integer :: mpi_size
File: :file:`mpi.irp.f`
Rank of MPI process and number of MPI processes
.. c:var:: mpi_size
.. code:: text
integer :: mpi_rank
integer :: mpi_size
File: :file:`mpi.irp.f`
Rank of MPI process and number of MPI processes
Subroutines / functions
-----------------------
.. c:function:: broadcast_chunks_double
.. code:: text
subroutine broadcast_chunks_double(A, LDA)
File: :file:`mpi.irp.f_template_97`
Broadcast with chunks of ~2GB
.. c:function:: broadcast_chunks_integer
.. code:: text
subroutine broadcast_chunks_integer(A, LDA)
File: :file:`mpi.irp.f_template_97`
Broadcast with chunks of ~2GB
.. c:function:: broadcast_chunks_integer8
.. code:: text
subroutine broadcast_chunks_integer8(A, LDA)
File: :file:`mpi.irp.f_template_97`
Broadcast with chunks of ~2GB
.. c:function:: mpi_print
.. code:: text
subroutine mpi_print(string)
File: :file:`mpi.irp.f`
Print string to stdout if the MPI rank is zero.

View File

@ -0,0 +1,351 @@
.. _nuclei:
.. program:: nuclei
.. default-role:: option
======
nuclei
======
This module contains data relative to the nuclei (coordinates, charge,
nuclear repulsion energy, etc).
The coordinates are expressed in atomic units.
EZFIO parameters
----------------
.. option:: nucl_num
Number of nuclei
.. option:: nucl_label
Nuclear labels
.. option:: nucl_charge
Nuclear charges
.. option:: nucl_coord
Nuclear coordinates in the format (:, {x,y,z})
.. option:: disk_access_nuclear_repulsion
Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ]
Default: None
.. option:: nuclear_repulsion
Nuclear repulsion (Computed automaticaly or Read in the |EZFIO|)
Providers
---------
.. c:var:: center_of_mass
.. code:: text
double precision, allocatable :: center_of_mass (3)
File: :file:`nuclei.irp.f`
Center of mass of the molecule
.. c:var:: element_mass
.. code:: text
character*(4), allocatable :: element_name (0:127)
double precision, allocatable :: element_mass (0:127)
File: :file:`nuclei.irp.f`
Array of the name of element, sorted by nuclear charge (integer)
.. c:var:: element_name
.. code:: text
character*(4), allocatable :: element_name (0:127)
double precision, allocatable :: element_mass (0:127)
File: :file:`nuclei.irp.f`
Array of the name of element, sorted by nuclear charge (integer)
.. c:var:: inertia_tensor
.. code:: text
double precision, allocatable :: inertia_tensor (3,3)
File: :file:`inertia.irp.f`
Inertia tensor
.. c:var:: inertia_tensor_eigenvalues
.. code:: text
double precision, allocatable :: inertia_tensor_eigenvectors (3,3)
double precision, allocatable :: inertia_tensor_eigenvalues (3)
File: :file:`inertia.irp.f`
Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation.
.. c:var:: inertia_tensor_eigenvectors
.. code:: text
double precision, allocatable :: inertia_tensor_eigenvectors (3,3)
double precision, allocatable :: inertia_tensor_eigenvalues (3)
File: :file:`inertia.irp.f`
Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation.
.. c:var:: nucl_coord
.. code:: text
double precision, allocatable :: nucl_coord (nucl_num,3)
File: :file:`nuclei.irp.f`
Nuclear coordinates in the format (:, {x,y,z})
.. c:var:: nucl_coord_transp
.. code:: text
double precision, allocatable :: nucl_coord_transp (3,nucl_num)
File: :file:`nuclei.irp.f`
Transposed array of nucl_coord
.. c:var:: nucl_dist
.. code:: text
double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist (nucl_num,nucl_num)
File: :file:`nuclei.irp.f`
nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors
.. c:var:: nucl_dist_2
.. code:: text
double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist (nucl_num,nucl_num)
File: :file:`nuclei.irp.f`
nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors
.. c:var:: nucl_dist_inv
.. code:: text
double precision, allocatable :: nucl_dist_inv (nucl_num,nucl_num)
File: :file:`nuclei.irp.f`
Inverse of the distance between nucleus I and nucleus J
.. c:var:: nucl_dist_vec_x
.. code:: text
double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist (nucl_num,nucl_num)
File: :file:`nuclei.irp.f`
nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors
.. c:var:: nucl_dist_vec_y
.. code:: text
double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist (nucl_num,nucl_num)
File: :file:`nuclei.irp.f`
nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors
.. c:var:: nucl_dist_vec_z
.. code:: text
double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num)
double precision, allocatable :: nucl_dist (nucl_num,nucl_num)
File: :file:`nuclei.irp.f`
nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors
.. c:var:: nuclear_repulsion
.. code:: text
double precision :: nuclear_repulsion
File: :file:`nuclei.irp.f`
Nuclear repulsion energy
.. c:var:: slater_bragg_radii
.. code:: text
double precision, allocatable :: slater_bragg_radii (100)
File: :file:`atomic_radii.irp.f`
atomic radii in Angstrom defined in table I of JCP 41, 3199 (1964) Slater execpt for the Hydrogen atom where we took the value of Becke (1988, JCP)
.. c:var:: slater_bragg_radii_per_atom
.. code:: text
double precision, allocatable :: slater_bragg_radii_per_atom (nucl_num)
File: :file:`atomic_radii.irp.f`
.. c:var:: slater_bragg_radii_per_atom_ua
.. code:: text
double precision, allocatable :: slater_bragg_radii_per_atom_ua (nucl_num)
File: :file:`atomic_radii.irp.f`
.. c:var:: slater_bragg_radii_ua
.. code:: text
double precision, allocatable :: slater_bragg_radii_ua (100)
File: :file:`atomic_radii.irp.f`
.. c:var:: slater_bragg_type_inter_distance
.. code:: text
double precision, allocatable :: slater_bragg_type_inter_distance (nucl_num,nucl_num)
File: :file:`atomic_radii.irp.f`
.. c:var:: slater_bragg_type_inter_distance_ua
.. code:: text
double precision, allocatable :: slater_bragg_type_inter_distance_ua (nucl_num,nucl_num)
File: :file:`atomic_radii.irp.f`

View File

@ -0,0 +1,560 @@
.. _perturbation:
.. program:: perturbation
.. default-role:: option
============
perturbation
============
All subroutines in ``*.irp.f`` starting with `pt2_` in the current directory are
perturbation computed using the routine `i_H_psi`. Other cases are not allowed.
The arguments of the `pt2_` are always:
.. code-block:: fortran
subroutine pt2_...( &
psi_ref, &
psi_ref_coefs, &
E_refs, &
det_pert, &
c_pert, &
e_2_pert, &
H_pert_diag, &
Nint, &
Ndet, &
N_st )
integer , intent(in) :: Nint,Ndet,N_st
integer(bit_kind), intent(in) :: psi_ref(Nint,2,Ndet)
double precision , intent(in) :: psi_ref_coefs(Ndet,N_st)
double precision , intent(in) :: E_refs(N_st)
integer(bit_kind), intent(in) :: det_pert(Nint,2)
double precision , intent(out) :: c_pert(N_st),e_2_pert(N_st),H_pert_diag
`psi_ref`
bitstring of the determinants present in the various `N_st` states
`psi_ref_coefs`
coefficients of the determinants on the various `N_st` states
`E_refs`
Energy of the various `N_st` states
`det_pert`
Perturber determinant
`c_pert`
Perturbative coefficients for the various states
`e_2_pert`
Perturbative energetic contribution for the various states
`H_pert_diag`
Diagonal |H| matrix element of the perturber
`Nint`
Should be equal to `N_int`
`Ndet`
Number of determinants `i` in |Psi| on which we apply <det_pert | |H| | `i`>
`N_st`
Number of states
EZFIO parameters
----------------
.. option:: do_pt2
If `True`, compute the |PT2| contribution
Default: True
.. option:: pt2_max
The selection process stops when the largest |PT2| (for all the state) is lower
than `pt2_max` in absolute value
Default: 0.0001
.. option:: pt2_relative_error
Stop stochastic |PT2| when the relative error is smaller than `PT2_relative_error`
Default: 0.005
.. option:: correlation_energy_ratio_max
The selection process stops at a fixed correlation ratio (useful for getting same accuracy between molecules).
Defined as :math:`{E_{CI}-E_{HF}}/{E_{CI}+E_{PT2} - E_{HF}}`.
Default: 1.00
.. option:: h0_type
Type of zeroth-order Hamiltonian [ EN | Barycentric | Variance | SOP ]
Default: EN
Providers
---------
.. c:var:: fill_h_apply_buffer_selection
.. code:: text
subroutine fill_H_apply_buffer_selection(n_selected,det_buffer,e_2_pert_buffer,coef_pert_buffer, &
N_st,Nint,iproc,select_max_out)
File: :file:`selection.irp.f`
Fill the H_apply buffer with determiants for the selection
.. c:var:: max_exc_pert
.. code:: text
integer :: max_exc_pert
File: :file:`exc_max.irp.f`
.. c:var:: selection_criterion
.. code:: text
double precision :: selection_criterion
double precision :: selection_criterion_min
double precision :: selection_criterion_factor
File: :file:`selection.irp.f`
Threshold to select determinants. Set by selection routines.
.. c:var:: selection_criterion_factor
.. code:: text
double precision :: selection_criterion
double precision :: selection_criterion_min
double precision :: selection_criterion_factor
File: :file:`selection.irp.f`
Threshold to select determinants. Set by selection routines.
.. c:var:: selection_criterion_min
.. code:: text
double precision :: selection_criterion
double precision :: selection_criterion_min
double precision :: selection_criterion_factor
File: :file:`selection.irp.f`
Threshold to select determinants. Set by selection routines.
.. c:var:: var_pt2_ratio
.. code:: text
double precision :: var_pt2_ratio
File: :file:`var_pt2_ratio_provider.irp.f`
The selection process stops when the energy ratio variational/(variational+PT2) is equal to var_pt2_ratio
Subroutines / functions
-----------------------
.. c:function:: perturb_buffer_by_mono_dummy
.. code:: text
subroutine perturb_buffer_by_mono_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_by_mono_epstein_nesbet
.. code:: text
subroutine perturb_buffer_by_mono_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_by_mono_epstein_nesbet_2x2
.. code:: text
subroutine perturb_buffer_by_mono_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_by_mono_h_core
.. code:: text
subroutine perturb_buffer_by_mono_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_by_mono_moller_plesset
.. code:: text
subroutine perturb_buffer_by_mono_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_by_mono_moller_plesset_general
.. code:: text
subroutine perturb_buffer_by_mono_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_by_mono_qdpt
.. code:: text
subroutine perturb_buffer_by_mono_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_dummy
.. code:: text
subroutine perturb_buffer_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_epstein_nesbet
.. code:: text
subroutine perturb_buffer_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_epstein_nesbet_2x2
.. code:: text
subroutine perturb_buffer_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_h_core
.. code:: text
subroutine perturb_buffer_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_moller_plesset
.. code:: text
subroutine perturb_buffer_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_moller_plesset_general
.. code:: text
subroutine perturb_buffer_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: perturb_buffer_qdpt
.. code:: text
subroutine perturb_buffer_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy)
File: :file:`perturbation.irp.f_shell_13`
Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine.
.. c:function:: pt2_dummy
.. code:: text
subroutine pt2_dummy (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pt2_equations.irp.f_template_309`
Dummy perturbation to add all connected determinants.
.. c:function:: pt2_epstein_nesbet
.. code:: text
subroutine pt2_epstein_nesbet (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pt2_equations.irp.f_template_309`
Compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution for the various N_st states.
`c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{ E_n - \langle \alpha|H|\alpha \rangle }` .
`e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{ E_n - \langle \alpha|H|\alpha \rangle }` .
.. c:function:: pt2_epstein_nesbet_2x2
.. code:: text
subroutine pt2_epstein_nesbet_2x2 (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pt2_equations.irp.f_template_309`
Computes the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution for the various N_st states.
`e_2_pert(i)` = :math:`\frac{1}{2} ( \langle \alpha|H|\alpha \rangle - E_n) - \sqrt{ (\langle \alpha|H|\alpha \rangle - E_n)^2 + 4 \langle i|H|\alpha \rangle^2 }` .
`c_pert(i)` = `e_2_pert(i)` :math:`\times \frac{1}{ \langle i|H|\alpha \rangle}` .
.. c:function:: pt2_h_core
.. code:: text
subroutine pt2_h_core(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pert_single.irp.f`
compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution
for the various N_st states.
c_pert(i) = <psi(i)|H|det_pert>/( E(i) - <det_pert|H|det_pert> )
e_2_pert(i) = <psi(i)|H|det_pert>^2/( E(i) - <det_pert|H|det_pert> )
.. c:function:: pt2_moller_plesset
.. code:: text
subroutine pt2_moller_plesset (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pt2_equations.irp.f_template_309`
Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states.
`c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` .
`e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` .
.. c:function:: pt2_moller_plesset_general
.. code:: text
subroutine pt2_moller_plesset_general (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pt2_equations.irp.f_template_309`
Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states.
`c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` .
`e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` .
.. c:function:: pt2_qdpt
.. code:: text
subroutine pt2_qdpt (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist)
File: :file:`pt2_equations.irp.f_template_309`
Computes the QDPT first order coefficient and second order energetic contribution for the various N_st states.
`c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\langle i|H|i \rangle - \langle \alpha|H|\alpha \rangle}` .
.. c:function:: remove_small_contributions
.. code:: text
subroutine remove_small_contributions
File: :file:`selection.irp.f`
Remove determinants with small contributions. N_states is assumed to be provided.
.. c:function:: repeat_all_e_corr
.. code:: text
double precision function repeat_all_e_corr(key_in)
File: :file:`pert_sc2.irp.f`

View File

@ -0,0 +1,94 @@
.. _pseudo:
.. program:: pseudo
.. default-role:: option
======
pseudo
======
This module defines the |EZFIO| parameters of the effective core potentials.
EZFIO parameters
----------------
.. option:: nucl_charge_remove
Nuclear charges removed per atom
.. option:: pseudo_klocmax
Maximum value of k for the local component
.. option:: pseudo_n_k
Number of gaussians in the local component
.. option:: pseudo_v_k
Coefficients in the local component
.. option:: pseudo_dz_k
Exponents in the local component
.. option:: pseudo_lmax
Maximum angular momentum
.. option:: pseudo_kmax
Maximum number of functions in the non-local component
.. option:: pseudo_n_kl
Number of functions in the non-local component
.. option:: pseudo_v_kl
Coefficients in the non-local component
.. option:: pseudo_dz_kl
Exponents in the non-local component
.. option:: do_pseudo
If `True`, pseudo-potentials are used.
Default: False
.. option:: pseudo_grid_size
Nb of points of the grid for the QMC interfaces
Default: 1000
.. option:: pseudo_grid_rmax
R_max of the QMC grid
Default: 10.0
.. option:: ao_pseudo_grid
Grid for the QMC interface
.. option:: mo_pseudo_grid
Grid for the QMC interface

View File

@ -0,0 +1,14 @@
.. _psiref_cas:
.. program:: psiref_cas
.. default-role:: option
==========
psiref_cas
==========
Reference wave function is defined as a |CAS| wave function.
This module is required for |CAS-SD|, |MRPT| or |MRCC|.

View File

@ -0,0 +1,16 @@
.. _psiref_utils:
.. program:: psiref_utils
.. default-role:: option
============
psiref_utils
============
Utilities related to the use of a reference wave function. This module
needs to be loaded with any `psi_ref_*` module.

View File

@ -0,0 +1,390 @@
.. _scf_utils:
.. program:: scf_utils
.. default-role:: option
=========
scf_utils
=========
The scf_utils module is an abstract module which contains the basics to perform *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 meant to be 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.
.. 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_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_num,mo_num)
double precision, allocatable :: fock_matrix_diag_mo (mo_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_num,mo_num)
double precision, allocatable :: fock_matrix_diag_mo (mo_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_num,mo_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_num,mo_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_num,mo_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

@ -0,0 +1,13 @@
.. _selectors_cassd:
.. program:: selectors_cassd
.. default-role:: option
===============
selectors_cassd
===============
Selectors for |CAS-SD| calculations. The selectors are defined as first the
generators from :ref:`Generators_CAS`, and then the rest of the wave function.

View File

@ -0,0 +1,72 @@
.. _selectors_full:
.. program:: selectors_full
.. default-role:: option
==============
selectors_full
==============
All the determinants are possible selectors. Only the largest contributions are kept, where
a threshold is applied to the squared norm of the wave function, with the :option:`determinants
threshold_selectors` flag.
Providers
---------
.. c:var:: n_det_selectors
.. code:: text
integer :: n_det_selectors
File: :file:`selectors.irp.f`
For Single reference wave functions, the number of selectors is 1 : the Hartree-Fock determinant
.. c:var:: psi_selectors
.. code:: text
integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size)
double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states)
File: :file:`selectors.irp.f`
Determinants on which we apply <i|H|psi> for perturbation.
.. c:var:: psi_selectors_coef
.. code:: text
integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size)
double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states)
File: :file:`selectors.irp.f`
Determinants on which we apply <i|H|psi> for perturbation.
.. c:var:: threshold_selectors
.. code:: text
double precision :: threshold_selectors
File: :file:`selectors.irp.f`
Thresholds on selectors (fraction of the square of the norm)

View File

@ -0,0 +1,381 @@
.. _selectors_utils:
.. program:: selectors_utils
.. default-role:: option
===============
selectors_utils
===============
Helper functions for selectors.
Providers
---------
.. c:var:: coef_hf_selector
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: delta_e_per_selector
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: double_index_selectors
.. code:: text
integer, allocatable :: exc_degree_per_selectors (N_det_selectors)
integer, allocatable :: double_index_selectors (N_det_selectors)
integer :: n_double_selectors
File: :file:`e_corr_selectors.irp.f`
Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants.
double_index_selectors = list of the index of the double excitations
n_double_selectors = number of double excitations in the selectors determinants
.. c:var:: e_corr_double_only
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: e_corr_per_selectors
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: e_corr_second_order
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: exc_degree_per_selectors
.. code:: text
integer, allocatable :: exc_degree_per_selectors (N_det_selectors)
integer, allocatable :: double_index_selectors (N_det_selectors)
integer :: n_double_selectors
File: :file:`e_corr_selectors.irp.f`
Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants.
double_index_selectors = list of the index of the double excitations
n_double_selectors = number of double excitations in the selectors determinants
.. c:var:: i_h_hf_per_selectors
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: inv_selectors_coef_hf
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: inv_selectors_coef_hf_squared
.. code:: text
double precision :: coef_hf_selector
double precision :: inv_selectors_coef_hf
double precision :: inv_selectors_coef_hf_squared
double precision, allocatable :: e_corr_per_selectors (N_det_selectors)
double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors)
double precision, allocatable :: delta_e_per_selector (N_det_selectors)
double precision :: e_corr_double_only
double precision :: e_corr_second_order
File: :file:`e_corr_selectors.irp.f`
Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants.
E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation.
E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation
coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants
.. c:var:: n_double_selectors
.. code:: text
integer, allocatable :: exc_degree_per_selectors (N_det_selectors)
integer, allocatable :: double_index_selectors (N_det_selectors)
integer :: n_double_selectors
File: :file:`e_corr_selectors.irp.f`
Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants.
double_index_selectors = list of the index of the double excitations
n_double_selectors = number of double excitations in the selectors determinants
.. c:var:: psi_selectors_coef_transp
.. code:: text
double precision, allocatable :: psi_selectors_coef_transp (N_states,psi_selectors_size)
File: :file:`selectors.irp.f`
Transposed psi_selectors
.. c:var:: psi_selectors_diag_h_mat
.. code:: text
double precision, allocatable :: psi_selectors_diag_h_mat (psi_selectors_size)
File: :file:`selectors.irp.f`
Diagonal elements of the H matrix for each selectors
.. c:var:: psi_selectors_size
.. code:: text
integer :: psi_selectors_size
File: :file:`selectors.irp.f`
Subroutines / functions
-----------------------
.. c:function:: zmq_get_n_det_generators
.. code:: text
integer function zmq_get_N_det_generators(zmq_to_qp_run_socket, worker_id)
File: :file:`zmq.irp.f_template_102`
Get N_det_generators from the qp_run scheduler
.. c:function:: zmq_get_n_det_selectors
.. code:: text
integer function zmq_get_N_det_selectors(zmq_to_qp_run_socket, worker_id)
File: :file:`zmq.irp.f_template_102`
Get N_det_selectors from the qp_run scheduler
.. c:function:: zmq_put_n_det_generators
.. code:: text
integer function zmq_put_N_det_generators(zmq_to_qp_run_socket,worker_id)
File: :file:`zmq.irp.f_template_102`
Put N_det_generators on the qp_run scheduler
.. c:function:: zmq_put_n_det_selectors
.. code:: text
integer function zmq_put_N_det_selectors(zmq_to_qp_run_socket,worker_id)
File: :file:`zmq.irp.f_template_102`
Put N_det_selectors on the qp_run scheduler

View File

@ -0,0 +1,14 @@
.. _single_ref_method:
.. program:: single_ref_method
.. default-role:: option
=================
single_ref_method
=================
Include this module for single reference methods.
Using this module, the only generator determinant is the Hartree-Fock determinant.

View File

@ -0,0 +1,73 @@
.. _slave:
.. program:: slave
.. default-role:: option
=====
slave
=====
Slave processes for distributed parallelism.
Subroutines / functions
-----------------------
.. c:function:: provide_everything
.. code:: text
subroutine provide_everything
File: :file:`slave_cipsi.irp.f`
.. c:function:: qp_ao_ints
.. code:: text
subroutine qp_ao_ints
File: :file:`slave_eri.irp.f`
Slave for electron repulsion integrals
.. c:function:: run_wf
.. code:: text
subroutine run_wf
File: :file:`slave_cipsi.irp.f`
.. c:function:: slave
.. code:: text
subroutine slave
File: :file:`slave_cipsi.irp.f`
Helper program for distributed parallelism

View File

@ -0,0 +1,222 @@
.. _tools:
.. program:: tools
.. default-role:: option
=====
tools
=====
Useful tools are grouped in this module.
Subroutines / functions
-----------------------
.. c:function:: diagonalize_h
.. code:: text
subroutine diagonalize_h
File: :file:`diagonalize_h.irp.f`
program that extracts the N_states lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder
.. c:function:: fcidump
.. code:: text
subroutine fcidump
File: :file:`fcidump.irp.f`
Produce a FCIDUMP file
.. c:function:: four_idx_transform
.. code:: text
subroutine four_idx_transform
File: :file:`four_idx_transform.irp.f`
4-index transformation of two-electron integrals from AO to MO integrals
.. c:function:: molden
.. code:: text
subroutine molden
File: :file:`molden.irp.f`
Produce a Molden file
.. c:function:: print_wf
.. code:: text
subroutine print_wf
File: :file:`print_wf.irp.f`
print the wave function stored in the EZFIO folder in the intermediate normalization
it also prints a lot of information regarding the excitation operators from the reference determinant
and a first-order perturbative analysis of the wave function.
If the wave function strongly deviates from the first-order analysis, something funny is going on :)
.. c:function:: routine
.. code:: text
subroutine routine
File: :file:`write_integrals_erf.irp.f`
.. c:function:: save_natorb
.. code:: text
subroutine save_natorb
File: :file:`save_natorb.irp.f`
Save natural MOs into the EZFIO
.. 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
subroutine save_ortho_mos
File: :file:`save_ortho_mos.irp.f`
Save orthonormalized MOs in the EZFIO.
.. c:function:: write_ao_basis
.. code:: text
subroutine write_Ao_basis(i_unit_output)
File: :file:`molden.irp.f`
.. c:function:: write_geometry
.. code:: text
subroutine write_geometry(i_unit_output)
File: :file:`molden.irp.f`
.. c:function:: write_integrals
.. code:: text
subroutine write_integrals
File: :file:`write_integrals_erf.irp.f`
Saves the bielec erf integrals into the EZFIO
.. c:function:: write_intro_gamess
.. code:: text
subroutine write_intro_gamess(i_unit_output)
File: :file:`molden.irp.f`
.. c:function:: write_mo_basis
.. code:: text
subroutine write_Mo_basis(i_unit_output)
File: :file:`molden.irp.f`

File diff suppressed because it is too large Load Diff

885
docs/source/modules/zmq.rst Normal file
View File

@ -0,0 +1,885 @@
.. _zmq:
.. program:: zmq
.. default-role:: option
===
zmq
===
Definition of |ZeroMQ| sockets and messages.
Providers
---------
.. c:var:: qp_run_address
.. code:: text
character*(128) :: qp_run_address
integer :: zmq_port_start
File: :file:`utils.irp.f`
Address of the qp_run socket Example : tcp://130.120.229.139:12345
.. c:var:: zmq_context
.. code:: text
integer(ZMQ_PTR) :: zmq_context
integer(omp_lock_kind) :: zmq_lock
File: :file:`utils.irp.f`
Context for the ZeroMQ library
.. c:var:: zmq_lock
.. code:: text
integer(ZMQ_PTR) :: zmq_context
integer(omp_lock_kind) :: zmq_lock
File: :file:`utils.irp.f`
Context for the ZeroMQ library
.. c:var:: zmq_port_start
.. code:: text
character*(128) :: qp_run_address
integer :: zmq_port_start
File: :file:`utils.irp.f`
Address of the qp_run socket Example : tcp://130.120.229.139:12345
.. c:var:: zmq_socket_pair_inproc_address
.. code:: text
character*(128) :: zmq_socket_pull_tcp_address
character*(128) :: zmq_socket_pair_inproc_address
character*(128) :: zmq_socket_push_tcp_address
character*(128) :: zmq_socket_pull_inproc_address
character*(128) :: zmq_socket_push_inproc_address
character*(128) :: zmq_socket_sub_tcp_address
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:var:: zmq_socket_pull_inproc_address
.. code:: text
character*(128) :: zmq_socket_pull_tcp_address
character*(128) :: zmq_socket_pair_inproc_address
character*(128) :: zmq_socket_push_tcp_address
character*(128) :: zmq_socket_pull_inproc_address
character*(128) :: zmq_socket_push_inproc_address
character*(128) :: zmq_socket_sub_tcp_address
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:var:: zmq_socket_pull_tcp_address
.. code:: text
character*(128) :: zmq_socket_pull_tcp_address
character*(128) :: zmq_socket_pair_inproc_address
character*(128) :: zmq_socket_push_tcp_address
character*(128) :: zmq_socket_pull_inproc_address
character*(128) :: zmq_socket_push_inproc_address
character*(128) :: zmq_socket_sub_tcp_address
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:var:: zmq_socket_push_inproc_address
.. code:: text
character*(128) :: zmq_socket_pull_tcp_address
character*(128) :: zmq_socket_pair_inproc_address
character*(128) :: zmq_socket_push_tcp_address
character*(128) :: zmq_socket_pull_inproc_address
character*(128) :: zmq_socket_push_inproc_address
character*(128) :: zmq_socket_sub_tcp_address
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:var:: zmq_socket_push_tcp_address
.. code:: text
character*(128) :: zmq_socket_pull_tcp_address
character*(128) :: zmq_socket_pair_inproc_address
character*(128) :: zmq_socket_push_tcp_address
character*(128) :: zmq_socket_pull_inproc_address
character*(128) :: zmq_socket_push_inproc_address
character*(128) :: zmq_socket_sub_tcp_address
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:var:: zmq_socket_sub_tcp_address
.. code:: text
character*(128) :: zmq_socket_pull_tcp_address
character*(128) :: zmq_socket_pair_inproc_address
character*(128) :: zmq_socket_push_tcp_address
character*(128) :: zmq_socket_pull_inproc_address
character*(128) :: zmq_socket_push_inproc_address
character*(128) :: zmq_socket_sub_tcp_address
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:var:: zmq_state
.. code:: text
character*(128) :: zmq_state
File: :file:`utils.irp.f`
Threads executing work through the ZeroMQ interface
Subroutines / functions
-----------------------
.. c:function:: add_task_to_taskserver
.. code:: text
integer function add_task_to_taskserver(zmq_to_qp_run_socket,task)
File: :file:`utils.irp.f`
Get a task from the task server
.. c:function:: connect_to_taskserver
.. code:: text
integer function connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread)
File: :file:`utils.irp.f`
Connect to the task server and obtain the worker ID
.. c:function:: disconnect_from_taskserver
.. code:: text
integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id)
File: :file:`utils.irp.f`
Disconnect from the task server
.. c:function:: disconnect_from_taskserver_state
.. code:: text
integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state)
File: :file:`utils.irp.f`
Disconnect from the task server
.. c:function:: end_parallel_job
.. code:: text
subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in)
File: :file:`utils.irp.f`
End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave'
.. c:function:: end_zmq_pair_socket
.. code:: text
subroutine end_zmq_pair_socket(zmq_socket_pair)
File: :file:`utils.irp.f`
Terminate socket on which the results are sent.
.. c:function:: end_zmq_pull_socket
.. code:: text
subroutine end_zmq_pull_socket(zmq_socket_pull)
File: :file:`utils.irp.f`
Terminate socket on which the results are sent.
.. c:function:: end_zmq_push_socket
.. code:: text
subroutine end_zmq_push_socket(zmq_socket_push,thread)
File: :file:`utils.irp.f`
Terminate socket on which the results are sent.
.. c:function:: end_zmq_sub_socket
.. code:: text
subroutine end_zmq_sub_socket(zmq_socket_sub)
File: :file:`utils.irp.f`
Terminate socket on which the results are sent.
.. c:function:: end_zmq_to_qp_run_socket
.. code:: text
subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)
File: :file:`utils.irp.f`
Terminate the socket from the application to qp_run
.. c:function:: get_task_from_taskserver
.. code:: text
integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task)
File: :file:`utils.irp.f`
Get a task from the task server
.. c:function:: get_tasks_from_taskserver
.. code:: text
integer function get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task,n_tasks)
File: :file:`utils.irp.f`
Get multiple tasks from the task server
.. c:function:: new_parallel_job
.. code:: text
subroutine new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in)
File: :file:`utils.irp.f`
Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave'
.. c:function:: new_zmq_pair_socket
.. code:: text
function new_zmq_pair_socket(bind)
File: :file:`utils.irp.f`
Socket on which the collector and the main communicate
.. c:function:: new_zmq_pull_socket
.. code:: text
function new_zmq_pull_socket()
File: :file:`utils.irp.f`
Socket on which the results are sent. If thread is 1, use inproc
.. c:function:: new_zmq_push_socket
.. code:: text
function new_zmq_push_socket(thread)
File: :file:`utils.irp.f`
Socket on which the results are sent. If thread is 1, use inproc
.. c:function:: new_zmq_sub_socket
.. code:: text
function new_zmq_sub_socket()
File: :file:`utils.irp.f`
Socket to read the state published by the Task server
.. c:function:: new_zmq_to_qp_run_socket
.. code:: text
function new_zmq_to_qp_run_socket()
File: :file:`utils.irp.f`
Socket on which the qp_run process replies
.. c:function:: reset_zmq_addresses
.. code:: text
subroutine reset_zmq_addresses
File: :file:`utils.irp.f`
Socket which pulls the results (2)
.. c:function:: switch_qp_run_to_master
.. code:: text
subroutine switch_qp_run_to_master
File: :file:`utils.irp.f`
Address of the master qp_run socket Example : tcp://130.120.229.139:12345
.. c:function:: task_done_to_taskserver
.. code:: text
integer function task_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id)
File: :file:`utils.irp.f`
Get a task from the task server
.. c:function:: tasks_done_to_taskserver
.. code:: text
integer function tasks_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id, n_tasks)
File: :file:`utils.irp.f`
Get a task from the task server
.. c:function:: wait_for_next_state
.. code:: text
subroutine wait_for_next_state(state)
File: :file:`utils.irp.f`
.. c:function:: wait_for_state
.. code:: text
subroutine wait_for_state(state_wait,state)
File: :file:`utils.irp.f`
Wait for the ZMQ state to be ready
.. c:function:: wait_for_states
.. code:: text
subroutine wait_for_states(state_wait,state,n)
File: :file:`utils.irp.f`
Wait for the ZMQ state to be ready
.. c:function:: zmq_abort
.. code:: text
integer function zmq_abort(zmq_to_qp_run_socket)
File: :file:`utils.irp.f`
Aborts a running parallel computation
.. c:function:: zmq_delete_task
.. code:: text
integer function zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id,more)
File: :file:`utils.irp.f`
When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull.
.. c:function:: zmq_delete_tasks
.. code:: text
integer function zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more)
File: :file:`utils.irp.f`
When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull.
.. c:function:: zmq_delete_tasks_async_recv
.. code:: text
integer function zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more)
File: :file:`utils.irp.f`
When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull.
.. c:function:: zmq_delete_tasks_async_send
.. code:: text
integer function zmq_delete_tasks_async_send(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more)
File: :file:`utils.irp.f`
When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull.
.. c:function:: zmq_get8_dvector
.. code:: text
integer function zmq_get8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Get a float vector from the qp_run scheduler
.. c:function:: zmq_get8_ivector
.. code:: text
integer function zmq_get8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Get a vector of integers from the qp_run scheduler
.. c:function:: zmq_get_dmatrix
.. code:: text
integer function zmq_get_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze)
File: :file:`put_get.irp.f`
Get a float vector from the qp_run scheduler
.. c:function:: zmq_get_dvector
.. code:: text
integer function zmq_get_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Get a float vector from the qp_run scheduler
.. c:function:: zmq_get_i8matrix
.. code:: text
integer function zmq_get_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze)
File: :file:`put_get.irp.f`
Get a float vector from the qp_run scheduler
.. c:function:: zmq_get_imatrix
.. code:: text
integer function zmq_get_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze)
File: :file:`put_get.irp.f`
Get a float vector from the qp_run scheduler
.. c:function:: zmq_get_int
.. code:: text
integer function zmq_get_int(zmq_to_qp_run_socket, worker_id, name, x)
File: :file:`put_get.irp.f`
Get a vector of integers from the qp_run scheduler
.. c:function:: zmq_get_int_nompi
.. code:: text
integer function zmq_get_int_nompi(zmq_to_qp_run_socket, worker_id, name, x)
File: :file:`put_get.irp.f`
Get a vector of integers from the qp_run scheduler
.. c:function:: zmq_get_ivector
.. code:: text
integer function zmq_get_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Get a vector of integers from the qp_run scheduler
.. c:function:: zmq_port
.. code:: text
function zmq_port(ishift)
File: :file:`utils.irp.f`
Return the value of the ZMQ port from the corresponding integer
.. c:function:: zmq_put8_dvector
.. code:: text
integer function zmq_put8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Put a float vector on the qp_run scheduler
.. c:function:: zmq_put8_ivector
.. code:: text
integer function zmq_put8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Put a vector of integers on the qp_run scheduler
.. c:function:: zmq_put_dmatrix
.. code:: text
integer function zmq_put_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze)
File: :file:`put_get.irp.f`
Put a float vector on the qp_run scheduler
.. c:function:: zmq_put_dvector
.. code:: text
integer function zmq_put_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Put a float vector on the qp_run scheduler
.. c:function:: zmq_put_i8matrix
.. code:: text
integer function zmq_put_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze)
File: :file:`put_get.irp.f`
Put a float vector on the qp_run scheduler
.. c:function:: zmq_put_imatrix
.. code:: text
integer function zmq_put_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze)
File: :file:`put_get.irp.f`
Put a float vector on the qp_run scheduler
.. c:function:: zmq_put_int
.. code:: text
integer function zmq_put_int(zmq_to_qp_run_socket, worker_id, name, x)
File: :file:`put_get.irp.f`
Put a vector of integers on the qp_run scheduler
.. c:function:: zmq_put_ivector
.. code:: text
integer function zmq_put_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x)
File: :file:`put_get.irp.f`
Put a vector of integers on the qp_run scheduler
.. c:function:: zmq_set_running
.. code:: text
integer function zmq_set_running(zmq_to_qp_run_socket)
File: :file:`utils.irp.f`
Set the job to Running in QP-run

View File

@ -45,25 +45,25 @@ Index of Providers
* :c:data:`ao_integrals_erf_map`
* :c:data:`ao_integrals_map`
* :c:data:`ao_integrals_threshold`
* :c:data:`ao_kinetic_integral`
* :c:data:`ao_kinetic_integrals`
* :c:data:`ao_l`
* :c:data:`ao_l_char`
* :c:data:`ao_l_char_space`
* :c:data:`ao_l_max`
* :c:data:`ao_md5`
* :c:data:`ao_mono_elec_integral`
* :c:data:`ao_mono_elec_integral_diag`
* :c:data:`ao_nucl`
* :c:data:`ao_nucl_elec_integral`
* :c:data:`ao_nucl_elec_integral_per_atom`
* :c:data:`ao_nucl_elec_integrals`
* :c:data:`ao_nucl_elec_integrals_per_atom`
* :c:data:`ao_num`
* :c:data:`ao_one_e_integrals`
* :c:data:`ao_one_e_integrals_diag`
* :c:data:`ao_ortho_canonical_coef`
* :c:data:`ao_ortho_canonical_coef_inv`
* :c:data:`ao_ortho_canonical_nucl_elec_integral`
* :c:data:`ao_ortho_canonical_nucl_elec_integrals`
* :c:data:`ao_ortho_canonical_num`
* :c:data:`ao_ortho_canonical_overlap`
* :c:data:`ao_ortho_lowdin_coef`
* :c:data:`ao_ortho_lowdin_nucl_elec_integral`
* :c:data:`ao_ortho_lowdin_nucl_elec_integrals`
* :c:data:`ao_ortho_lowdin_overlap`
* :c:data:`ao_overlap`
* :c:data:`ao_overlap_abs`
@ -76,9 +76,9 @@ Index of Providers
* :c:data:`ao_power_ordered_transp_per_nucl`
* :c:data:`ao_prim_num`
* :c:data:`ao_prim_num_max`
* :c:data:`ao_pseudo_integral`
* :c:data:`ao_pseudo_integral_local`
* :c:data:`ao_pseudo_integral_non_local`
* :c:data:`ao_pseudo_integrals`
* :c:data:`ao_pseudo_integrals_local`
* :c:data:`ao_pseudo_integrals_non_local`
* :c:data:`ao_spread_x`
* :c:data:`ao_spread_y`
* :c:data:`ao_spread_z`
@ -165,12 +165,8 @@ Index of Providers
* :c:data:`dft_type`
* :c:data:`diag_algorithm`
* :c:data:`diagonal_h_matrix_on_psi_det`
* :c:data:`disk_access_ao_integrals`
* :c:data:`disk_access_ao_integrals_erf`
* :c:data:`disk_access_ao_one_integrals`
* :c:data:`disk_access_mo_integrals`
* :c:data:`disk_access_mo_integrals_erf`
* :c:data:`disk_access_mo_one_integrals`
* :c:data:`disk_access_nuclear_repulsion`
* :c:data:`disk_based_davidson`
* :c:data:`distributed_davidson`
@ -303,6 +299,21 @@ Index of Providers
* :c:data:`inv_int`
* :c:data:`inv_selectors_coef_hf`
* :c:data:`inv_selectors_coef_hf_squared`
* :c:data:`io_ao_integrals_e_n`
* :c:data:`io_ao_integrals_erf`
* :c:data:`io_ao_integrals_kinetic`
* :c:data:`io_ao_integrals_overlap`
* :c:data:`io_ao_integrals_pseudo`
* :c:data:`io_ao_one_e_integrals`
* :c:data:`io_ao_two_e_integrals`
* :c:data:`io_ao_two_e_integrals_erf`
* :c:data:`io_mo_integrals_e_n`
* :c:data:`io_mo_integrals_erf`
* :c:data:`io_mo_integrals_kinetic`
* :c:data:`io_mo_integrals_pseudo`
* :c:data:`io_mo_one_e_integrals`
* :c:data:`io_mo_two_e_integrals`
* :c:data:`io_mo_two_e_integrals_erf`
* :c:data:`iradix_sort`
* :c:data:`iradix_sort_big`
* :c:data:`kinetic_ref_bitmask_energy`
@ -357,19 +368,18 @@ Index of Providers
* :c:data:`mo_integrals_erf_map`
* :c:data:`mo_integrals_map`
* :c:data:`mo_integrals_threshold`
* :c:data:`mo_kinetic_integral`
* :c:data:`mo_kinetic_integrals`
* :c:data:`mo_label`
* :c:data:`mo_mono_elec_integral`
* :c:data:`mo_nucl_elec_integral`
* :c:data:`mo_nucl_elec_integral_per_atom`
* :c:data:`mo_mono_elec_integrals`
* :c:data:`mo_nucl_elec_integrals`
* :c:data:`mo_nucl_elec_integrals_per_atom`
* :c:data:`mo_num`
* :c:data:`mo_occ`
* :c:data:`mo_overlap`
* :c:data:`mo_pseudo_integral`
* :c:data:`mo_pseudo_integrals`
* :c:data:`mo_spread_x`
* :c:data:`mo_spread_y`
* :c:data:`mo_spread_z`
* :c:data:`mo_tot_num`
* :c:data:`mo_two_e_int_erf_jj`
* :c:data:`mo_two_e_int_erf_jj_anti`
* :c:data:`mo_two_e_int_erf_jj_anti_from_ao`
@ -608,12 +618,22 @@ Index of Providers
* :c:data:`pt2_w_t`
* :c:data:`qp_max_mem`
* :c:data:`qp_run_address`
* :c:data:`read_ao_integrals`
* :c:data:`read_ao_integrals_e_n`
* :c:data:`read_ao_integrals_erf`
* :c:data:`read_ao_one_integrals`
* :c:data:`read_mo_integrals`
* :c:data:`read_ao_integrals_kinetic`
* :c:data:`read_ao_integrals_overlap`
* :c:data:`read_ao_integrals_pseudo`
* :c:data:`read_ao_one_e_integrals`
* :c:data:`read_ao_two_e_integrals`
* :c:data:`read_ao_two_e_integrals_erf`
* :c:data:`read_mo_integrals_e_n`
* :c:data:`read_mo_integrals_erf`
* :c:data:`read_mo_one_integrals`
* :c:data:`read_mo_integrals_kinetic`
* :c:data:`read_mo_integrals_pseudo`
* :c:data:`read_mo_one_e_integrals`
* :c:data:`read_mo_two_e_integrals`
* :c:data:`read_mo_two_e_integrals_erf`
* :c:data:`read_nuclear_repulsion`
* :c:data:`read_wf`
* :c:data:`rec__quicksort`
* :c:data:`rec_d_quicksort`
@ -686,12 +706,22 @@ Index of Providers
* :c:data:`weight_occ_pattern`
* :c:data:`weights_angular_integration_lebedev`
* :c:data:`weights_angular_points`
* :c:data:`write_ao_integrals`
* :c:data:`write_ao_integrals_e_n`
* :c:data:`write_ao_integrals_erf`
* :c:data:`write_ao_one_integrals`
* :c:data:`write_mo_integrals`
* :c:data:`write_ao_integrals_kinetic`
* :c:data:`write_ao_integrals_overlap`
* :c:data:`write_ao_integrals_pseudo`
* :c:data:`write_ao_one_e_integrals`
* :c:data:`write_ao_two_e_integrals`
* :c:data:`write_ao_two_e_integrals_erf`
* :c:data:`write_mo_integrals_e_n`
* :c:data:`write_mo_integrals_erf`
* :c:data:`write_mo_one_integrals`
* :c:data:`write_mo_integrals_kinetic`
* :c:data:`write_mo_integrals_pseudo`
* :c:data:`write_mo_one_e_integrals`
* :c:data:`write_mo_two_e_integrals`
* :c:data:`write_mo_two_e_integrals_erf`
* :c:data:`write_nuclear_repulsion`
* :c:data:`zmq_context`
* :c:data:`zmq_lock`
* :c:data:`zmq_port_start`

View File

@ -1,3 +1,4 @@
==============
Excited states
==============

View File

@ -4,7 +4,8 @@
qp_edit
=======
.. TODO
.. program:: qp_edit
This command reads the content of the |EZFIO| directory and creates a temporary
file containing the data. The data is presented as a *ReStructured Text* (rst)

View File

@ -1 +1,9 @@
TODO
================
qp_export_as_tgz
================
.. program:: qp_export_as_tgz
.. TODO
.. include:: /work.rst

View File

@ -4,6 +4,8 @@
qp_plugins
==========
.. program:: qp_plugins
This command deals with all external plugings of |qp|. Plugin repositories can
be downloaded, and the plugins in these repositories can be
installed/uninstalled of created.

View File

@ -3,7 +3,7 @@
qp_set_mo_class
===============
.. TODO
.. program:: qp_set_mo_class
This command sets the orbital classes in an |EZFIO| directory.

View File

@ -4,6 +4,8 @@
qp_test
=======
.. program:: qp_test
This command runs the consistency test of |qp|.
The tests are run with the |Bats| shell testing environment.
If the name of a test of its number is specified on the command line, only this

View File

@ -87,9 +87,9 @@ let of_int64_array l =
(* Compute n_int *)
let n_int_of_mo_tot_num mo_tot_num =
let n_int_of_mo_num mo_num =
let bit_kind_size = Bit_kind_size.to_int (Lazy.force Qpackage.bit_kind_size) in
N_int_number.of_int ( (mo_tot_num-1)/bit_kind_size + 1 )
N_int_number.of_int ( (mo_num-1)/bit_kind_size + 1 )
(* Create a zero bit list *)
@ -134,14 +134,14 @@ let of_mo_number_list n_int l =
let to_mo_number_list l =
let a = Array.of_list l in
let mo_tot_num = MO_number.get_max () in
let mo_num = MO_number.get_max () in
let rec do_work accu = function
| 0 -> accu
| i ->
begin
let new_accu =
match a.(i-1) with
| Bit.One -> (MO_number.of_int ~max:mo_tot_num i)::accu
| Bit.One -> (MO_number.of_int ~max:mo_num i)::accu
| Bit.Zero -> accu
in
do_work new_accu (i-1)

View File

@ -23,7 +23,7 @@ val to_int64_list : t -> int64 list
val to_int64_array : t -> int64 array
(** Get the number of needed int64 elements to encode the bit list *)
val n_int_of_mo_tot_num : int -> Qptypes.N_int_number.t
val n_int_of_mo_num : int -> Qptypes.N_int_number.t
(** Conversion to MO numbers *)
val to_mo_number_list : t -> Qptypes.MO_number.t list

View File

@ -24,9 +24,9 @@ let to_bitlist_couple x =
in (xa,xb)
let bitlist_to_string ~mo_tot_num x =
let bitlist_to_string ~mo_num x =
let len =
MO_number.to_int mo_tot_num
MO_number.to_int mo_num
in
let s =
List.map (function
@ -47,17 +47,17 @@ let of_int64_array ~n_int ~alpha ~beta x =
in
if ( (Bitlist.popcnt a) <> alpha) then
begin
let mo_tot_num = MO_number.get_max () in
let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in
let mo_num = MO_number.get_max () in
let mo_num = MO_number.of_int mo_num ~max:mo_num in
failwith (Printf.sprintf "Expected %d electrons in alpha determinant
%s" alpha (bitlist_to_string ~mo_tot_num:mo_tot_num a) )
%s" alpha (bitlist_to_string ~mo_num:mo_num a) )
end;
if ( (Bitlist.popcnt b) <> beta ) then
begin
let mo_tot_num = MO_number.get_max () in
let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in
let mo_num = MO_number.get_max () in
let mo_num = MO_number.of_int mo_num ~max:mo_num in
failwith (Printf.sprintf "Expected %d electrons in beta determinant
%s" beta (bitlist_to_string ~mo_tot_num:mo_tot_num b) )
%s" beta (bitlist_to_string ~mo_num:mo_num b) )
end;
x
@ -70,15 +70,15 @@ let of_bitlist_couple ?n_int ~alpha ~beta (xa,xb) =
and n_int =
match n_int with
| Some x -> x
| None -> Bitlist.n_int_of_mo_tot_num (List.length xa)
| None -> Bitlist.n_int_of_mo_num (List.length xa)
in
of_int64_array ~n_int ~alpha ~beta (Array.concat [ba;bb])
let to_string ~mo_tot_num x =
let to_string ~mo_num x =
let (xa,xb) = to_bitlist_couple x in
[ " " ; bitlist_to_string ~mo_tot_num xa ; "\n" ;
" " ; bitlist_to_string ~mo_tot_num xb ]
[ " " ; bitlist_to_string ~mo_num xa ; "\n" ;
" " ; bitlist_to_string ~mo_num xb ]
|> String.concat ""

View File

@ -30,4 +30,4 @@ val of_bitlist_couple : ?n_int:Qptypes.N_int_number.t ->
Bitlist.t * Bitlist.t -> t
(** String representation *)
val to_string : mo_tot_num:Qptypes.MO_number.t -> t -> string
val to_string : mo_num:Qptypes.MO_number.t -> t -> string

View File

@ -29,8 +29,8 @@ end = struct
let read_n_int () =
if not (Ezfio.has_bitmasks_n_int()) then
Ezfio.get_mo_basis_mo_tot_num ()
|> Bitlist.n_int_of_mo_tot_num
Ezfio.get_mo_basis_mo_num ()
|> Bitlist.n_int_of_mo_num
|> N_int_number.to_int
|> Ezfio.set_bitmasks_n_int
;
@ -59,7 +59,7 @@ end = struct
let full_mask n_int =
let range = "[1-"^
(Int.to_string (Ezfio.get_mo_basis_mo_tot_num ()))^"]"
(Int.to_string (Ezfio.get_mo_basis_mo_num ()))^"]"
in
MO_class.create_active range
|> MO_class.to_bitlist n_int
@ -121,7 +121,7 @@ end = struct
;;
let read () =
if (Ezfio.has_mo_basis_mo_tot_num ()) then
if (Ezfio.has_mo_basis_mo_num ()) then
Some
{ n_int = read_n_int ();
bit_kind = read_bit_kind ();

View File

@ -41,8 +41,8 @@ end = struct
let read_n_int () =
if not (Ezfio.has_determinants_n_int()) then
Ezfio.get_mo_basis_mo_tot_num ()
|> Bitlist.n_int_of_mo_tot_num
Ezfio.get_mo_basis_mo_num ()
|> Bitlist.n_int_of_mo_num
|> N_int_number.to_int
|> Ezfio.set_determinants_n_int
;
@ -214,10 +214,10 @@ end = struct
in
if not (Ezfio.has_determinants_psi_det ()) then
begin
let mo_tot_num = MO_number.get_max () in
let mo_num = MO_number.get_max () in
let rec build_data accu = function
| 0 -> accu
| n -> build_data ((MO_number.of_int ~max:mo_tot_num n)::accu) (n-1)
| n -> build_data ((MO_number.of_int ~max:mo_num n)::accu) (n-1)
in
let det_a = build_data [] (Elec_alpha_number.to_int n_alpha)
|> Bitlist.of_mo_number_list n_int
@ -257,7 +257,7 @@ end = struct
let read () =
if (Ezfio.has_mo_basis_mo_tot_num ()) then
if (Ezfio.has_mo_basis_mo_num ()) then
{ n_int = read_n_int () ;
bit_kind = read_bit_kind () ;
n_det = read_n_det () ;
@ -304,9 +304,9 @@ end = struct
let to_rst b =
let max =
Ezfio.get_mo_basis_mo_tot_num ()
Ezfio.get_mo_basis_mo_num ()
in
let mo_tot_num =
let mo_num =
MO_number.of_int ~max max
in
let det_text =
@ -333,7 +333,7 @@ end = struct
Array.init ndet ~f:(fun i ->
Printf.sprintf " %s\n%s\n"
(coefs_string i)
(Determinant.to_string ~mo_tot_num:mo_tot_num b.psi_det.(i)
(Determinant.to_string ~mo_num:mo_num b.psi_det.(i)
|> String.split ~on:'\n'
|> List.map ~f:(fun x -> " "^x)
|> String.concat ~sep:"\n"
@ -367,8 +367,8 @@ Determinants ::
;;
let to_string b =
let mo_tot_num = Ezfio.get_mo_basis_mo_tot_num () in
let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in
let mo_num = Ezfio.get_mo_basis_mo_num () in
let mo_num = MO_number.of_int mo_num ~max:mo_num in
Printf.sprintf "
n_int = %s
bit_kind = %s
@ -388,7 +388,7 @@ psi_det = %s
(b.psi_coef |> Array.to_list |> List.map ~f:Det_coef.to_string
|> String.concat ~sep:", ")
(b.psi_det |> Array.to_list |> List.map ~f:(Determinant.to_string
~mo_tot_num:mo_tot_num) |> String.concat ~sep:"\n\n")
~mo_num) |> String.concat ~sep:"\n\n")
;;
let of_rst r =

View File

@ -5,7 +5,7 @@ open Core
module Mo_basis : sig
type t =
{ mo_tot_num : MO_number.t ;
{ mo_num : MO_number.t ;
mo_label : MO_label.t;
mo_class : MO_class.t array;
mo_occ : MO_occ.t array;
@ -17,7 +17,7 @@ module Mo_basis : sig
val to_rst : t -> Rst_string.t
end = struct
type t =
{ mo_tot_num : MO_number.t ;
{ mo_num : MO_number.t ;
mo_label : MO_label.t;
mo_class : MO_class.t array;
mo_occ : MO_occ.t array;
@ -54,21 +54,21 @@ end = struct
result
let read_mo_tot_num () =
Ezfio.get_mo_basis_mo_tot_num ()
let read_mo_num () =
Ezfio.get_mo_basis_mo_num ()
|> MO_number.of_int
let read_mo_class () =
if not (Ezfio.has_mo_basis_mo_class ()) then
begin
let mo_tot_num = MO_number.to_int (read_mo_tot_num ()) in
let mo_num = MO_number.to_int (read_mo_num ()) in
let data =
Array.init mo_tot_num ~f:(fun _ -> MO_class.(to_string (Active [])))
Array.init mo_num ~f:(fun _ -> MO_class.(to_string (Active [])))
|> Array.to_list
in
Ezfio.ezfio_array_of_list ~rank:1
~dim:[| mo_tot_num |] ~data:data
~dim:[| mo_num |] ~data:data
|> Ezfio.set_mo_basis_mo_class
end;
Ezfio.flattened_ezfio (Ezfio.get_mo_basis_mo_class () )
@ -80,13 +80,13 @@ end = struct
begin
let elec_alpha_num = Ezfio.get_electrons_elec_alpha_num ()
and elec_beta_num = Ezfio.get_electrons_elec_beta_num ()
and mo_tot_num = MO_number.to_int (read_mo_tot_num ()) in
let data = Array.init mo_tot_num ~f:(fun i ->
and mo_num = MO_number.to_int (read_mo_num ()) in
let data = Array.init mo_num ~f:(fun i ->
if (i<elec_beta_num) then 2.
else if (i < elec_alpha_num) then 1.
else 0.) |> Array.to_list in
Ezfio.ezfio_array_of_list ~rank:1
~dim:[| mo_tot_num |] ~data:data
~dim:[| mo_num |] ~data:data
|> Ezfio.set_mo_basis_mo_occ
end;
Ezfio.flattened_ezfio (Ezfio.get_mo_basis_mo_occ () )
@ -98,17 +98,17 @@ end = struct
|> Ezfio.flattened_ezfio
|> Array.map ~f:MO_coef.of_float
in
let mo_tot_num = read_mo_tot_num () |> MO_number.to_int in
let ao_num = (Array.length a)/mo_tot_num in
Array.init mo_tot_num ~f:(fun j ->
let mo_num = read_mo_num () |> MO_number.to_int in
let ao_num = (Array.length a)/mo_num in
Array.init mo_num ~f:(fun j ->
Array.sub ~pos:(j*ao_num) ~len:(ao_num) a
)
let read () =
if (Ezfio.has_mo_basis_mo_tot_num ()) then
if (Ezfio.has_mo_basis_mo_num ()) then
Some
{ mo_tot_num = read_mo_tot_num ();
{ mo_num = read_mo_num ();
mo_label = read_mo_label () ;
mo_class = read_mo_class ();
mo_occ = read_mo_occ ();
@ -121,7 +121,7 @@ end = struct
let mo_coef_to_string mo_coef =
let ao_num = Array.length mo_coef.(0)
and mo_tot_num = Array.length mo_coef in
and mo_num = Array.length mo_coef in
let rec print_five imin imax =
match (imax-imin+1) with
| 1 ->
@ -175,10 +175,10 @@ end = struct
| _ -> assert false
in
let rec create_list accu i =
if (i+4 < mo_tot_num) then
if (i+4 < mo_num) then
create_list ( (print_five i (i+3) |> String.concat ~sep:"\n")::accu ) (i+4)
else
(print_five i (mo_tot_num-1) |> String.concat ~sep:"\n")::accu |> List.rev
(print_five i (mo_num-1) |> String.concat ~sep:"\n")::accu |> List.rev
in
create_list [] 0 |> String.concat ~sep:"\n\n"
@ -191,14 +191,14 @@ Label of the molecular orbitals ::
Total number of MOs ::
mo_tot_num = %s
mo_num = %s
MO coefficients ::
%s
"
(MO_label.to_string b.mo_label)
(MO_number.to_string b.mo_tot_num)
(MO_number.to_string b.mo_num)
(mo_coef_to_string b.mo_coef)
|> Rst_string.of_string
@ -206,14 +206,14 @@ MO coefficients ::
let to_string b =
Printf.sprintf "
mo_label = %s
mo_tot_num = \"%s\"
mo_label = \"%s\"
mo_num = %s
mo_clas = %s
mo_occ = %s
mo_coef = %s
"
(MO_label.to_string b.mo_label)
(MO_number.to_string b.mo_tot_num)
(MO_number.to_string b.mo_num)
(b.mo_class |> Array.to_list |> List.map
~f:(MO_class.to_string) |> String.concat ~sep:", " )
(b.mo_occ |> Array.to_list |> List.map

View File

@ -26,8 +26,8 @@ let run ~multiplicity ezfio_file =
let n_open_shells =
alpha - beta
in
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
let mo_num =
Ezfio.get_mo_basis_mo_num ()
in
let build_list_of_dets ne n_closed n_open =
let init =
@ -60,7 +60,7 @@ let run ~multiplicity ezfio_file =
in
set_n_electrons init n_open ne
|> List.filter ~f:(fun x -> List.length x <= n_closed+n_open)
|> List.map ~f:(fun x -> extend x (((mo_tot_num-1)/64+1)*64 - List.length x))
|> List.map ~f:(fun x -> extend x (((mo_num-1)/64+1)*64 - List.length x))
in
let alpha_new =
@ -79,7 +79,7 @@ let run ~multiplicity ezfio_file =
in
let n_int =
Bitlist.n_int_of_mo_tot_num mo_tot_num
Bitlist.n_int_of_mo_num mo_num
in
let determinants =
List.map l_alpha ~f:(fun x -> List.map l_beta ~f:(fun y -> (x,y) ))
@ -94,7 +94,7 @@ let run ~multiplicity ezfio_file =
in
determinants
|> List.map ~f:(fun x -> Determinant.to_string ~mo_tot_num:(MO_number.of_int mo_tot_num) x)
|> List.map ~f:(fun x -> Determinant.to_string ~mo_num:(MO_number.of_int mo_num) x)
|> List.iter ~f:(fun x -> Printf.printf "%s\n\n%!" x);
let l =

View File

@ -24,7 +24,7 @@ let run ?(sym="None") ?(apply="no") fc ezfio_filename =
and n =
(AO_number.to_int aos.Input.Ao_basis.ao_num)
and m =
(MO_number.to_int mos.Input.Mo_basis.mo_tot_num)
(MO_number.to_int mos.Input.Mo_basis.mo_num)
and one = Positive_int.of_int 1
and zero = Positive_int.of_int 0
in

View File

@ -19,8 +19,8 @@ let () =
let fetch_wf ~state filename =
(* State 0 is the ground state *)
Ezfio.set_file filename;
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
let mo_num =
Ezfio.get_mo_basis_mo_num ()
|> MO_number.of_int
in
let d =
@ -33,7 +33,7 @@ let () =
state*n_det
in
let keys =
Array.map (Determinant.to_string ~mo_tot_num)
Array.map (Determinant.to_string ~mo_num)
d.Determinants_by_hand.psi_det
and values =
Array.map Det_coef.to_float

View File

@ -36,17 +36,17 @@ type t = MO_class.t option
let set ~core ~inact ~act ~virt ~del =
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
let mo_num =
Ezfio.get_mo_basis_mo_num ()
in
let n_int =
try N_int_number.of_int (Ezfio.get_determinants_n_int ())
with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num
with _ -> Bitlist.n_int_of_mo_num mo_num
in
let mo_class =
Array.init mo_tot_num ~f:(fun i -> None)
Array.init mo_num ~f:(fun i -> None)
in
(* Check input data *)
@ -74,7 +74,7 @@ let set ~core ~inact ~act ~virt ~del =
let check f x =
try f x with Invalid_argument a ->
begin
Printf.printf "Number of MOs: %d\n%!" mo_tot_num;
Printf.printf "Number of MOs: %d\n%!" mo_num;
raise (Invalid_argument a)
end
in
@ -96,7 +96,7 @@ let set ~core ~inact ~act ~virt ~del =
for i=1 to (Array.length mo_class)
do
if (mo_class.(i-1) = None) then
failwith (Printf.sprintf "Orbital %d is not specified (mo_tot_num = %d)" i mo_tot_num)
failwith (Printf.sprintf "Orbital %d is not specified (mo_num = %d)" i mo_num)
done;
@ -199,7 +199,7 @@ let set ~core ~inact ~act ~virt ~del =
| Some x -> MO_class.to_string x
)
in
Ezfio.ezfio_array_of_list ~rank:1 ~dim:[| mo_tot_num |] ~data
Ezfio.ezfio_array_of_list ~rank:1 ~dim:[| mo_num |] ~data
|> Ezfio.set_mo_basis_mo_class
@ -223,18 +223,18 @@ let get () =
| Some x -> x
in
let mo_tot_num =
MO_number.to_int data.Input.Mo_basis.mo_tot_num
let mo_num =
MO_number.to_int data.Input.Mo_basis.mo_num
in
let n_int =
try N_int_number.of_int (Ezfio.get_determinants_n_int ())
with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num
with _ -> Bitlist.n_int_of_mo_num mo_num
in
Printf.printf "Electrons: %d %d\n" elec_alpha_num elec_beta_num;
Printf.printf "MO : %d\n" mo_tot_num;
Printf.printf "MO : %d\n" mo_num;
Printf.printf "n_int: %d\n" (N_int_number.to_int n_int);
@ -267,8 +267,8 @@ let get () =
let run ~q ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_filename =
Ezfio.set_file ezfio_filename ;
if not (Ezfio.has_mo_basis_mo_tot_num ()) then
failwith "mo_basis/mo_tot_num not found" ;
if not (Ezfio.has_mo_basis_mo_num ()) then
failwith "mo_basis/mo_num not found" ;
if q then
get ()

View File

@ -58,8 +58,8 @@ let input_data = "
* Det_number_max : int
assert (x > 0) ;
if (x > 10_00_000_000) then
warning \"More than 10 billion determinants\";
if (x > 50_00_000_000) then
warning \"More than 50 billion determinants\";
* States_number : int
assert (x > 0) ;
@ -141,7 +141,7 @@ let input_data = "
let input_ezfio = "
* MO_number : int
mo_basis_mo_tot_num
mo_basis_mo_num
1 : 10_000
More than 10_000 MOs
@ -162,8 +162,8 @@ let input_ezfio = "
* Det_number : int
determinants_n_det
1 : 10_000_000_000
More than 10 billion determinants
1 : 50_000_000_000
More than 50 billion determinants
"

View File

@ -1,7 +1,7 @@
open Qptypes;;
let test_module () =
let mo_tot_num = MO_number.of_int 10 in
let mo_num = MO_number.of_int 10 in
let det =
[| 15L ; 7L |]
|> Determinant.of_int64_array
@ -9,7 +9,7 @@ let test_module () =
~alpha:(Elec_alpha_number.of_int 4)
~beta:(Elec_beta_number.of_int 3)
in
Printf.printf "%s\n" (Determinant.to_string (~mo_tot_num:mo_tot_num) det)
Printf.printf "%s\n" (Determinant.to_string (~mo_num:mo_num) det)
;;
test_module ();;

View File

@ -228,8 +228,8 @@ def write_ezfio(res, filename):
for i in MOindices:
MOs.append(allMOs[i])
mo_tot_num = len(MOs)
while len(MOindices) < mo_tot_num:
mo_num = len(MOs)
while len(MOindices) < mo_num:
MOindices.append(len(MOindices))
MOmap = list(MOindices)
@ -237,7 +237,7 @@ def write_ezfio(res, filename):
MOmap[i] = MOindices.index(i)
energies = []
for i in xrange(mo_tot_num):
for i in xrange(mo_num):
energies.append(MOs[i].eigenvalue)
if res.occ_num is not None:
@ -245,7 +245,7 @@ def write_ezfio(res, filename):
for i in MOindices:
OccNum.append(res.occ_num[MO_type][i])
while len(OccNum) < mo_tot_num:
while len(OccNum) < mo_num:
OccNum.append(0.)
MoMatrix = []
@ -267,7 +267,7 @@ def write_ezfio(res, filename):
# W r i t e #
# ~#~#~#~#~ #
ezfio.set_mo_basis_mo_tot_num(mo_tot_num)
ezfio.set_mo_basis_mo_num(mo_num)
ezfio.set_mo_basis_mo_occ(OccNum)
ezfio.set_mo_basis_mo_coef(MoMatrix)
print "OK"

View File

@ -89,7 +89,7 @@ class H_apply(object):
# !$OMP occ_hole_tmp,key_idx,i_b,j_b,key,N_elec_in_key_part_1,&
# !$OMP N_elec_in_key_hole_1,N_elec_in_key_part_2, &
# !$OMP N_elec_in_key_hole_2,ia_ja_pairs,key_union_hole_part) &
# !$OMP SHARED(key_in,N_int,elec_num_tab,mo_tot_num, &
# !$OMP SHARED(key_in,N_int,elec_num_tab,mo_num, &
# !$OMP hole_1, particl_1, hole_2, particl_2, &
# !$OMP elec_alpha_num,i_generator) FIRSTPRIVATE(iproc)"""
# s["omp_end_parallel"] = "!$OMP END PARALLEL"
@ -107,7 +107,7 @@ class H_apply(object):
s["filter_integrals"] = "array_pairs = .True."
if SingleRef:
s["filter_integrals"] = """
call get_mo_bielec_integrals_existing_ik(i_a,j_a,mo_tot_num,array_pairs,mo_integrals_map)
call get_mo_bielec_integrals_existing_ik(i_a,j_a,mo_num,array_pairs,mo_integrals_map)
"""
s["generate_psi_guess"] = """

View File

@ -56,7 +56,7 @@ def main(arguments):
else:
nb += 5
mo_tot_num = ezfio.mo_basis_mo_tot_num
mo_num = ezfio.mo_basis_mo_num
if arguments["-q"]:
print nb
@ -64,10 +64,10 @@ def main(arguments):
if nb == 0:
os.system( """qp_set_mo_class -act "[1-%d]" %s""" %
(mo_tot_num, sys.argv[1]) )
(mo_num, sys.argv[1]) )
else:
os.system( """qp_set_mo_class -core "[1-%d]" -act "[%d-%d]" %s""" %
(nb, nb+1, mo_tot_num, sys.argv[1]) )
(nb, nb+1, mo_num, sys.argv[1]) )

View File

@ -1,4 +1,4 @@
[disk_access_ao_integrals_erf]
[io_ao_two_e_integrals_erf]
type: Disk_access
doc: Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml

View File

@ -25,8 +25,8 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ]
integral = ao_bielec_integral_erf(1,1,1,1)
double precision :: map_mb
PROVIDE read_ao_integrals_erf disk_access_ao_integrals_erf
if (read_ao_integrals_erf) then
PROVIDE read_ao_two_e_integrals_erf io_ao_two_e_integrals_erf
if (read_ao_two_e_integrals_erf) then
print*,'Reading the AO ERF integrals'
call map_load_from_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map)
print*, 'AO ERF integrals provided'
@ -87,10 +87,10 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_erf_in_map ]
ao_bielec_integrals_erf_in_map = .True.
if (write_ao_integrals_erf) then
if (write_ao_two_e_integrals_erf) then
call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map)
call ezfio_set_ao_two_e_erf_integrals_disk_access_ao_integrals_erf("Read")
call ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf("Read")
endif
END_PROVIDER

View File

@ -4,7 +4,7 @@ subroutine save_erf_bi_elec_integrals_ao
PROVIDE ao_bielec_integrals_erf_in_map
call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map)
call ezfio_set_ao_two_e_erf_integrals_disk_access_ao_integrals_erf('Read')
call ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf('Read')
end
subroutine save_erf_bielec_ints_ao_into_ints_ao
@ -13,6 +13,6 @@ subroutine save_erf_bielec_ints_ao_into_ints_ao
PROVIDE ao_bielec_integrals_erf_in_map
call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_erf_map)
call ezfio_set_ao_two_e_integrals_disk_access_ao_integrals('Read')
call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals('Read')
end

View File

@ -416,7 +416,7 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ]
if (write_ao_two_e_integrals.and.mpi_master) then
call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_map)
call ezfio_set_ao_two_e_integrals_disk_access_ao_integrals('Read')
call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals('Read')
endif
END_PROVIDER

View File

@ -14,13 +14,13 @@ size: (determinants.n_states)
interface: ezfio, provider
doc: Alpha one body density matrix on the MO basis computed with the wave function
type: double precision
size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num,determinants.n_states)
size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states)
[data_one_body_beta_dm_mo]
interface: ezfio, provider
doc: Beta one body density matrix on the MO basis computed with the wave function
type: double precision
size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num,determinants.n_states)
size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states)

View File

@ -6,7 +6,7 @@ BEGIN_PROVIDER [ integer, N_int ]
BEGIN_DOC
! Number of 64-bit integers needed to represent determinants as binary strings
END_DOC
N_int = (mo_tot_num-1)/bit_kind_size + 1
N_int = (mo_num-1)/bit_kind_size + 1
call write_int(6,N_int, 'N_int')
if (N_int > N_int_max) then
stop 'N_int > N_int_max'
@ -30,7 +30,7 @@ BEGIN_PROVIDER [ integer(bit_kind), full_ijkl_bitmask, (N_int) ]
if (mo_class(k) /= 'Deleted') then
full_ijkl_bitmask(j) = ibset(full_ijkl_bitmask(j),i)
endif
if (k == mo_tot_num) exit
if (k == mo_num) exit
enddo
enddo
END_PROVIDER
@ -496,8 +496,8 @@ END_PROVIDER
BEGIN_PROVIDER [ integer, list_inact, (n_inact_orb)]
&BEGIN_PROVIDER [ integer, list_virt, (n_virt_orb)]
&BEGIN_PROVIDER [ integer, list_inact_reverse, (mo_tot_num)]
&BEGIN_PROVIDER [ integer, list_virt_reverse, (mo_tot_num)]
&BEGIN_PROVIDER [ integer, list_inact_reverse, (mo_num)]
&BEGIN_PROVIDER [ integer, list_virt_reverse, (mo_num)]
BEGIN_DOC
! list_inact : List of the inactive orbitals which are supposed to be doubly excited
! in post CAS methods
@ -536,7 +536,7 @@ END_PROVIDER
BEGIN_PROVIDER [ integer, list_core_inact, (n_core_inact_orb)]
&BEGIN_PROVIDER [ integer, list_core_inact_reverse, (mo_tot_num)]
&BEGIN_PROVIDER [ integer, list_core_inact_reverse, (mo_num)]
implicit none
integer :: occ_inact(N_int*bit_kind_size)
@ -591,7 +591,7 @@ END_PROVIDER
enddo
END_PROVIDER
BEGIN_PROVIDER [ integer, list_core_inact_act, (n_core_inact_act_orb)]
&BEGIN_PROVIDER [ integer, list_core_inact_act_reverse, (mo_tot_num)]
&BEGIN_PROVIDER [ integer, list_core_inact_act_reverse, (mo_num)]
implicit none
integer :: occ_inact(N_int*bit_kind_size)
integer :: itest,i
@ -636,7 +636,7 @@ END_PROVIDER
END_PROVIDER
BEGIN_PROVIDER [integer, list_core, (n_core_orb)]
&BEGIN_PROVIDER [integer, list_core_reverse, (mo_tot_num)]
&BEGIN_PROVIDER [integer, list_core_reverse, (mo_num)]
BEGIN_DOC
! List of the core orbitals that are never excited in post CAS method
END_DOC
@ -705,7 +705,7 @@ BEGIN_PROVIDER [ integer, n_act_orb]
END_PROVIDER
BEGIN_PROVIDER [integer, list_act, (n_act_orb)]
&BEGIN_PROVIDER [integer, list_act_reverse, (mo_tot_num)]
&BEGIN_PROVIDER [integer, list_act_reverse, (mo_num)]
BEGIN_DOC
! list_act(i) = index of the ith active orbital
!

View File

@ -57,7 +57,7 @@ subroutine example_bitmask
integer :: i_orb
character*(2048) :: output
do i_orb = 1, min(4,mo_tot_num) ! you set the first four bits to 1 in key
do i_orb = 1, min(4,mo_num) ! you set the first four bits to 1 in key
call set_bit_to_integer(i_orb,key,N_int)
enddo
print*,'print a human readable representation of the bitstring'

View File

@ -1,9 +1,9 @@
BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_tot_num,mo_tot_num, N_states)]
BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_num,mo_num, N_states)]
implicit none
BEGIN_DOC
! density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density
END_DOC
double precision :: delta_alpha(mo_tot_num,mo_tot_num,N_states)
double precision :: delta_alpha(mo_num,mo_num,N_states)
if(density_for_dft .EQ. "damping_rs_dft")then
delta_alpha = one_body_dm_mo_alpha - data_one_body_alpha_dm_mo
one_body_dm_mo_alpha_for_dft = data_one_body_alpha_dm_mo + damping_for_rs_dft * delta_alpha
@ -16,12 +16,12 @@ BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_tot_num,mo_t
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_tot_num,mo_tot_num, N_states)]
BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_num,mo_num, N_states)]
implicit none
BEGIN_DOC
! density matrix for beta electrons in the MO basis used for all DFT calculations based on the density
END_DOC
double precision :: delta_beta(mo_tot_num,mo_tot_num,N_states)
double precision :: delta_beta(mo_num,mo_num,N_states)
if(density_for_dft .EQ. "damping_rs_dft")then
delta_beta = one_body_dm_mo_beta - data_one_body_beta_dm_mo
one_body_dm_mo_beta_for_dft = data_one_body_beta_dm_mo + damping_for_rs_dft * delta_beta
@ -33,12 +33,12 @@ BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_tot_num,mo_to
endif
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_mo_for_dft, (mo_tot_num,mo_tot_num, N_states)]
BEGIN_PROVIDER [double precision, one_body_dm_mo_for_dft, (mo_num,mo_num, N_states)]
implicit none
one_body_dm_mo_for_dft = one_body_dm_mo_beta_for_dft + one_body_dm_mo_alpha_for_dft
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_average_mo_for_dft, (mo_tot_num,mo_tot_num)]
BEGIN_PROVIDER [double precision, one_body_dm_average_mo_for_dft, (mo_num,mo_num)]
implicit none
integer :: i
one_body_dm_average_mo_for_dft = 0.d0
@ -60,8 +60,8 @@ END_PROVIDER
one_body_dm_beta_ao_for_dft = 0.d0
do k = 1, ao_num
do l = 1, ao_num
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
do istate = 1, N_states
mo_alpha = one_body_dm_mo_alpha_for_dft(j,i,istate)
mo_beta = one_body_dm_mo_beta_for_dft(j,i,istate)

View File

@ -14,7 +14,7 @@ subroutine do_mono_excitation(key_in,i_hole,i_particle,ispin,i_ok)
integer :: k,j,i
use bitmasks
ASSERT (i_hole > 0 )
ASSERT (i_particle <= mo_tot_num)
ASSERT (i_particle <= mo_num)
i_ok = 1
! hole
k = shiftr(i_hole-1,bit_kind_shift)+1

View File

@ -1,5 +1,5 @@
BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha_average, (mo_tot_num,mo_tot_num) ]
&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta_average, (mo_tot_num,mo_tot_num) ]
BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha_average, (mo_num,mo_num) ]
&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta_average, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! $\alpha$ and $\beta$ one-body density matrix for each state
@ -13,7 +13,7 @@
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_tot_num,mo_tot_num,2:N_states) ]
BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_states) ]
implicit none
BEGIN_DOC
! Difference of the one-body density matrix with respect to the ground state
@ -21,8 +21,8 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_tot_num,mo_tot_num,2
integer :: i,j, istate
do istate=2,N_states
do j=1,mo_tot_num
do i=1,mo_tot_num
do j=1,mo_num
do i=1,mo_num
one_body_dm_mo_diff(i,j,istate) = &
one_body_dm_mo_alpha(i,j,istate) - one_body_dm_mo_alpha(i,j,1) +&
one_body_dm_mo_beta (i,j,istate) - one_body_dm_mo_beta (i,j,1)
@ -33,13 +33,13 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_tot_num,mo_tot_num,2
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_tot_num,mo_tot_num,N_states,2) ]
BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_states,2) ]
implicit none
integer :: i,j,ispin,istate
ispin = 1
do istate = 1, N_states
do j = 1, mo_tot_num
do i = 1, mo_tot_num
do j = 1, mo_num
do i = 1, mo_num
one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_alpha(i,j,istate)
enddo
enddo
@ -47,8 +47,8 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_tot_num,mo_tot
ispin = 2
do istate = 1, N_states
do j = 1, mo_tot_num
do i = 1, mo_tot_num
do j = 1, mo_num
do i = 1, mo_num
one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_beta(i,j,istate)
enddo
enddo
@ -57,14 +57,14 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_tot_num,mo_tot
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_tot_num,mo_tot_num,N_states,2) ]
BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_num,mo_num,N_states,2) ]
implicit none
integer :: i,j,ispin,istate
ispin = 1
do istate = 1, N_states
do j = 1, mo_tot_num
do j = 1, mo_num
one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_alpha(j,j,istate)
do i = j+1, mo_tot_num
do i = j+1, mo_num
one_body_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_body_dm_mo_alpha(i,j,istate)
one_body_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_body_dm_mo_alpha(i,j,istate)
enddo
@ -73,9 +73,9 @@ BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_tot_num
ispin = 2
do istate = 1, N_states
do j = 1, mo_tot_num
do j = 1, mo_num
one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_beta(j,j,istate)
do i = j+1, mo_tot_num
do i = j+1, mo_num
one_body_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_body_dm_mo_beta(i,j,istate)
one_body_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_body_dm_mo_beta(i,j,istate)
enddo
@ -84,8 +84,8 @@ BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_tot_num
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha, (mo_tot_num,mo_tot_num,N_states) ]
&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta, (mo_tot_num,mo_tot_num,N_states) ]
BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha, (mo_num,mo_num,N_states) ]
&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta, (mo_num,mo_num,N_states) ]
implicit none
BEGIN_DOC
! $\alpha$ and $\beta$ one-body density matrix for each state
@ -110,12 +110,12 @@ END_PROVIDER
!$OMP tmp_a, tmp_b, n_occ, krow, kcol, lrow, lcol, tmp_det, tmp_det2)&
!$OMP SHARED(psi_det,psi_coef,N_int,N_states,elec_alpha_num, &
!$OMP elec_beta_num,one_body_dm_mo_alpha,one_body_dm_mo_beta,N_det,&
!$OMP mo_tot_num,psi_bilinear_matrix_rows,psi_bilinear_matrix_columns,&
!$OMP mo_num,psi_bilinear_matrix_rows,psi_bilinear_matrix_columns,&
!$OMP psi_bilinear_matrix_transp_rows, psi_bilinear_matrix_transp_columns,&
!$OMP psi_bilinear_matrix_order_reverse, psi_det_alpha_unique, psi_det_beta_unique,&
!$OMP psi_bilinear_matrix_values, psi_bilinear_matrix_transp_values,&
!$OMP N_det_alpha_unique,N_det_beta_unique,irp_here)
allocate(tmp_a(mo_tot_num,mo_tot_num,N_states), tmp_b(mo_tot_num,mo_tot_num,N_states) )
allocate(tmp_a(mo_num,mo_num,N_states), tmp_b(mo_num,mo_num,N_states) )
tmp_a = 0.d0
!$OMP DO SCHEDULE(dynamic,64)
do k_a=1,N_det
@ -231,8 +231,8 @@ END_PROVIDER
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_alpha, (mo_tot_num,mo_tot_num) ]
&BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_beta, (mo_tot_num,mo_tot_num) ]
BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_alpha, (mo_num,mo_num) ]
&BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_beta, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! $\alpha$ and $\beta$ one-body density matrix for each state
@ -257,8 +257,8 @@ END_PROVIDER
!$OMP tmp_a, tmp_b, n_occ_alpha,degree_respect_to_HF_k,degree_respect_to_HF_l)&
!$OMP SHARED(ref_bitmask,psi_det,psi_coef,N_int,N_states,state_average_weight,elec_alpha_num,&
!$OMP elec_beta_num,one_body_single_double_dm_mo_alpha,one_body_single_double_dm_mo_beta,N_det,&
!$OMP mo_tot_num)
allocate(tmp_a(mo_tot_num,mo_tot_num), tmp_b(mo_tot_num,mo_tot_num) )
!$OMP mo_num)
allocate(tmp_a(mo_num,mo_num), tmp_b(mo_num,mo_num) )
tmp_a = 0.d0
tmp_b = 0.d0
!$OMP DO SCHEDULE(dynamic)
@ -314,7 +314,7 @@ END_PROVIDER
!$OMP END PARALLEL
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_tot_num,mo_tot_num) ]
BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! One-body density matrix
@ -322,7 +322,7 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_tot_num,mo_tot_num) ]
one_body_dm_mo = one_body_dm_mo_alpha_average + one_body_dm_mo_beta_average
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_spin_density_mo, (mo_tot_num,mo_tot_num) ]
BEGIN_PROVIDER [ double precision, one_body_spin_density_mo, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! $\rho(\alpha) - \rho(\beta)$
@ -340,7 +340,7 @@ subroutine set_natural_mos
double precision, allocatable :: tmp(:,:)
label = "Natural"
call mo_as_svd_vectors_of_mo_matrix_eig(one_body_dm_mo,size(one_body_dm_mo,1),mo_tot_num,mo_tot_num,mo_occ,label)
call mo_as_svd_vectors_of_mo_matrix_eig(one_body_dm_mo,size(one_body_dm_mo,1),mo_num,mo_num,mo_occ,label)
soft_touch mo_occ
end
@ -414,8 +414,8 @@ BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ]
one_body_spin_density_ao = 0.d0
do k = 1, ao_num
do l = 1, ao_num
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
dm_mo = one_body_spin_density_mo(j,i)
! if(dabs(dm_mo).le.1.d-10)cycle
one_body_spin_density_ao(l,k) += mo_coef(k,i) * mo_coef(l,j) * dm_mo
@ -440,8 +440,8 @@ END_PROVIDER
one_body_dm_ao_beta = 0.d0
do k = 1, ao_num
do l = 1, ao_num
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
mo_alpha = one_body_dm_mo_alpha_average(j,i)
mo_beta = one_body_dm_mo_beta_average(j,i)
! if(dabs(dm_mo).le.1.d-10)cycle

View File

@ -218,11 +218,11 @@ subroutine getMobiles(key,key_mask, mobiles,Nint)
else if(nel == 1) then
mobiles(1) = list(1)
call bitstring_to_list(mobileMask(1,2), list, nel, Nint)
mobiles(2) = list(1) + mo_tot_num
mobiles(2) = list(1) + mo_num
else
call bitstring_to_list(mobileMask(1,2), list, nel, Nint)
mobiles(1) = list(1) + mo_tot_num
mobiles(2) = list(2) + mo_tot_num
mobiles(1) = list(1) + mo_num
mobiles(2) = list(2) + mo_num
end if
end subroutine
@ -233,16 +233,16 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro
integer, intent(in) :: Nint, N_minilist
integer(bit_kind), intent(in) :: minilist(Nint,2,N_minilist), key_mask(Nint,2)
integer, intent(out) :: N_microlist(0:mo_tot_num*2), ptr_microlist(0:mo_tot_num*2+1), idx_microlist(N_minilist*4)
integer, intent(out) :: N_microlist(0:mo_num*2), ptr_microlist(0:mo_num*2+1), idx_microlist(N_minilist*4)
integer(bit_kind), intent(out) :: microlist(Nint,2,N_minilist*4)
integer :: i,j,k,nt,n_element(2)
integer :: list(Nint*bit_kind_size,2)
integer, allocatable :: cur_microlist(:)
allocate (cur_microlist(0:mo_tot_num*2+1))
allocate (cur_microlist(0:mo_num*2+1))
integer(bit_kind) :: key_mask_neg(Nint,2), mobileMask(Nint,2)
integer :: mo_tot_num_2
mo_tot_num_2 = mo_tot_num+mo_tot_num
integer :: mo_num_2
mo_num_2 = mo_num+mo_num
do i=1,Nint
@ -250,7 +250,7 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro
key_mask_neg(i,2) = not(key_mask(i,2))
end do
do i=0,mo_tot_num_2
do i=0,mo_num_2
N_microlist(i) = 0
enddo
@ -272,18 +272,18 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro
end do
do j=1,n_element(2)
nt = list(j,2) + mo_tot_num
nt = list(j,2) + mo_num
N_microlist(nt) = N_microlist(nt) + 1
end do
end if
end do
ptr_microlist(0) = 1
do i=1,mo_tot_num_2+1
do i=1,mo_num_2+1
ptr_microlist(i) = ptr_microlist(i-1) + N_microlist(i-1)
end do
do i=0,mo_tot_num_2+1
do i=0,mo_num_2+1
cur_microlist(i) = ptr_microlist(i)
end do
@ -318,7 +318,7 @@ subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_micro
end do
do j=1,n_element(2)
nt = list(j,2) + mo_tot_num
nt = list(j,2) + mo_num
idx_microlist(cur_microlist(nt)) = i
do k=1,Nint
microlist(k,1,cur_microlist(nt)) = minilist(k,1,i)

View File

@ -7,7 +7,7 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
END_DOC
integer, intent(in) :: Nint
integer(bit_kind), intent(in) :: det_ref(Nint,2)
double precision, intent(out) :: fock_diag_tmp(2,mo_tot_num+1)
double precision, intent(out) :: fock_diag_tmp(2,mo_num+1)
integer :: occ(Nint*bit_kind_size,2)
integer :: ne(2), i, j, ii, jj
@ -64,7 +64,7 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
enddo
! Virtual MOs
do i=1,mo_tot_num
do i=1,mo_num
if (fock_diag_tmp(1,i) /= 0.d0) cycle
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_mono_elec_integrals(i,i)
do jj=1,elec_alpha_num
@ -76,7 +76,7 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
fock_diag_tmp(1,i) = fock_diag_tmp(1,i) + mo_bielec_integral_jj(i,j)
enddo
enddo
do i=1,mo_tot_num
do i=1,mo_num
if (fock_diag_tmp(2,i) /= 0.d0) cycle
fock_diag_tmp(2,i) = fock_diag_tmp(2,i) + mo_mono_elec_integrals(i,i)
do jj=1,elec_beta_num
@ -89,7 +89,7 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint)
enddo
enddo
fock_diag_tmp(1,mo_tot_num+1) = E0
fock_diag_tmp(2,mo_tot_num+1) = E0
fock_diag_tmp(1,mo_num+1) = E0
fock_diag_tmp(2,mo_num+1) = E0
end

View File

@ -7,7 +7,7 @@ subroutine $subroutine_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl
integer,intent(in) :: i_generator,iproc_in
integer :: status(N_int*bit_kind_size, 2)
integer :: highest, p1,p2,sp,ni,i,mi,nt,ns,k
double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1)
double precision, intent(in) :: fock_diag_tmp(2,mo_num+1)
integer(bit_kind), intent(in) :: key_prev(N_int, 2, *)
PROVIDE N_int
PROVIDE N_det
@ -74,7 +74,7 @@ end subroutine
subroutine $subroutine_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in $parameters )
implicit none
integer(bit_kind), intent(in) :: key_in(N_int, 2), particl_1(N_int, 2), particl_2(N_int, 2)
double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1)
double precision, intent(in) :: fock_diag_tmp(2,mo_num+1)
integer(bit_kind) :: p1_mask(N_int, 2), p2_mask(N_int, 2), key_mask(N_int, 2)
integer,intent(in) :: fs1,fs2,i_generator,iproc_in, fh1,fh2
integer(bit_kind) :: miniList(N_int, 2, N_det)
@ -121,7 +121,7 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl
integer(bit_kind), intent(in) :: hole_1(N_int,2), particl_1(N_int,2)
integer(bit_kind), intent(in) :: hole_2(N_int,2), particl_2(N_int,2)
integer, intent(in) :: iproc_in
double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1)
double precision, intent(in) :: fock_diag_tmp(2,mo_num+1)
integer(bit_kind), allocatable :: hole_save(:,:)
integer(bit_kind), allocatable :: key(:,:),hole(:,:), particle(:,:)
integer(bit_kind), allocatable :: hole_tmp(:,:), particle_tmp(:,:)
@ -177,20 +177,20 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl
enddo
call bitstring_to_list_ab(particle,occ_particle,N_elec_in_key_part_1,N_int)
call bitstring_to_list_ab(hole,occ_hole,N_elec_in_key_hole_1,N_int)
allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_tot_num,2), &
ib_jb_pairs(2,0:(elec_alpha_num)*mo_tot_num))
allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_num,2), &
ib_jb_pairs(2,0:(elec_alpha_num)*mo_num))
do ispin=1,2
i=0
do ii=N_elec_in_key_hole_1(ispin),1,-1 ! hole
i_a = occ_hole(ii,ispin)
ASSERT (i_a > 0)
ASSERT (i_a <= mo_tot_num)
ASSERT (i_a <= mo_num)
do jj=1,N_elec_in_key_part_1(ispin) !particle
j_a = occ_particle(jj,ispin)
ASSERT (j_a > 0)
ASSERT (j_a <= mo_tot_num)
ASSERT (j_a <= mo_num)
i += 1
ia_ja_pairs(1,i,ispin) = i_a
ia_ja_pairs(2,i,ispin) = j_a
@ -205,7 +205,7 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl
integer(bit_kind) :: test(N_int,2)
double precision :: accu
logical, allocatable :: array_pairs(:,:)
allocate(array_pairs(mo_tot_num,mo_tot_num))
allocate(array_pairs(mo_num,mo_num))
accu = 0.d0
do ispin=1,2
other_spin = iand(ispin,1)+1
@ -213,10 +213,10 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl
do ii=1,ia_ja_pairs(1,0,ispin)
i_a = ia_ja_pairs(1,ii,ispin)
ASSERT (i_a > 0)
ASSERT (i_a <= mo_tot_num)
ASSERT (i_a <= mo_num)
j_a = ia_ja_pairs(2,ii,ispin)
ASSERT (j_a > 0)
ASSERT (j_a <= mo_tot_num)
ASSERT (j_a <= mo_num)
hole = key_in
k = shiftr(i_a-1,bit_kind_shift)+1
j = i_a-shiftl(k-1,bit_kind_shift)-1
@ -249,11 +249,11 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl
do kk = 1,N_elec_in_key_hole_2(other_spin)
i_b = occ_hole_tmp(kk,other_spin)
ASSERT (i_b > 0)
ASSERT (i_b <= mo_tot_num)
ASSERT (i_b <= mo_num)
do jjj=1,N_elec_in_key_part_2(other_spin) ! particle
j_b = occ_particle_tmp(jjj,other_spin)
ASSERT (j_b > 0)
ASSERT (j_b <= mo_tot_num)
ASSERT (j_b <= mo_num)
if (array_pairs(i_b,j_b)) then
$filter_vvvv_excitation
i+= 1
@ -303,11 +303,11 @@ subroutine $subroutine_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl
i_b = occ_hole_tmp(kk,ispin)
if (i_b <= i_a.or.i_b == j_a) cycle
ASSERT (i_b > 0)
ASSERT (i_b <= mo_tot_num)
ASSERT (i_b <= mo_num)
do jjj=1,N_elec_in_key_part_2(ispin) ! particule
j_b = occ_particle_tmp(jjj,ispin)
ASSERT (j_b > 0)
ASSERT (j_b <= mo_tot_num)
ASSERT (j_b <= mo_num)
if (j_b <= j_a) cycle
if (array_pairs(i_b,j_b)) then
$filter_vvvv_excitation
@ -381,7 +381,7 @@ subroutine $subroutine_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generato
integer(bit_kind),intent(in) :: key_in(N_int,2)
integer(bit_kind),intent(in) :: hole_1(N_int,2), particl_1(N_int,2)
integer, intent(in) :: iproc_in
double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1)
double precision, intent(in) :: fock_diag_tmp(2,mo_num+1)
integer(bit_kind),allocatable :: keys_out(:,:,:)
integer(bit_kind),allocatable :: hole_save(:,:)
integer(bit_kind),allocatable :: key(:,:),hole(:,:), particle(:,:)
@ -444,7 +444,7 @@ subroutine $subroutine_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generato
call bitstring_to_list_ab(particle,occ_particle,N_elec_in_key_part_1,N_int)
call bitstring_to_list_ab(hole,occ_hole,N_elec_in_key_hole_1,N_int)
allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_tot_num,2))
allocate (ia_ja_pairs(2,0:(elec_alpha_num)*mo_num,2))
do ispin=1,2
i=0

View File

@ -23,7 +23,7 @@ subroutine $subroutine($params_main)
call wall_time(wall_0)
iproc = 0
allocate( mask(N_int,2,6), fock_diag_tmp(2,mo_tot_num+1) )
allocate( mask(N_int,2,6), fock_diag_tmp(2,mo_num+1) )
do i_generator=1,N_det_generators
! Compute diagonal of the Fock matrix

View File

@ -147,7 +147,7 @@ subroutine $subroutine_slave(thread, iproc)
N_st = N_states
allocate( pt2(N_st), norm_pert(N_st), H_pert_diag(N_st), &
mask(N_int,2,6), fock_diag_tmp(2,mo_tot_num+1) )
mask(N_int,2,6), fock_diag_tmp(2,mo_num+1) )
do
integer, external :: get_task_from_taskserver

View File

@ -1,4 +1,4 @@
BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_tot_num,2,2)]
BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_num,2,2)]
use bitmasks
implicit none
BEGIN_DOC
@ -42,7 +42,7 @@ BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_tot_num,2,2)]
do hp=1,2
do ispin=1,2
do i=1,mo_tot_num
do i=1,mo_num
psi_in_out_coef(1:N_det,1:N_states) = psi_coef(1:N_det,1:N_states)
psi_in_out(1:N_int,1:2,1:N_det) = psi_det(1:N_int,1:2,1:N_det)
call apply_exc_to_psi(i,hole_particle(hp),ispin, &
@ -70,7 +70,7 @@ BEGIN_PROVIDER [ double precision, mo_energy_expval, (N_states,mo_tot_num,2,2)]
enddo
enddo
mo_energy_expval(1:N_states,1:mo_tot_num,1:2,1) = -mo_energy_expval(1:N_states,1:mo_tot_num,1:2,1)
mo_energy_expval(1:N_states,1:mo_num,1:2,1) = -mo_energy_expval(1:N_states,1:mo_num,1:2,1)
END_PROVIDER

View File

@ -60,7 +60,7 @@ subroutine mono_excitation_wee(det_1,det_2,h,p,spin,phase,hij)
end
BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num) ]
BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_num, mo_num) ]
implicit none
integer :: i0,j0,i,j,k0,k
integer :: n_occ_ab(2)
@ -77,15 +77,15 @@ BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num
key_virt(i,1) = xor(key_virt(i,1),ref_closed_shell_bitmask(i,1))
key_virt(i,2) = xor(key_virt(i,2),ref_closed_shell_bitmask(i,2))
enddo
double precision :: array_coulomb(mo_tot_num),array_exchange(mo_tot_num)
double precision :: array_coulomb(mo_num),array_exchange(mo_num)
call bitstring_to_list_ab(key_virt, occ_virt, n_occ_ab_virt, N_int)
! docc ---> virt mono excitations
do i0 = 1, n_occ_ab(1)
i=occ(i0,1)
do j0 = 1, n_occ_ab_virt(1)
j = occ_virt(j0,1)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map)
double precision :: accu
accu = 0.d0
do k0 = 1, n_occ_ab(1)
@ -102,8 +102,8 @@ BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num
i=occ_virt(i0,1)
do j0 = 1, n_occ_ab_virt(1)
j = occ_virt(j0,1)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map)
accu = 0.d0
do k0 = 1, n_occ_ab(1)
k = occ(k0,1)
@ -119,8 +119,8 @@ BEGIN_PROVIDER [double precision, fock_wee_closed_shell, (mo_tot_num, mo_tot_num
i=occ(i0,1)
do j0 = 1, n_occ_ab(1)
j = occ(j0,1)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map)
accu = 0.d0
do k0 = 1, n_occ_ab(1)
k = occ(k0,1)

View File

@ -2,7 +2,7 @@
implicit none
integer :: i
integer :: j,k
double precision :: tmp(mo_tot_num,mo_tot_num),mono_ints(mo_tot_num,mo_tot_num)
double precision :: tmp(mo_num,mo_num),mono_ints(mo_num,mo_num)
BEGIN_DOC
! psi_energy_h_core = $\langle \Psi | h_{core} |\Psi \rangle$
!
@ -11,8 +11,8 @@
END_DOC
psi_energy_h_core = 0.d0
do i = 1, N_states
do j = 1, mo_tot_num
do k = 1, mo_tot_num
do j = 1, mo_num
do k = 1, mo_num
psi_energy_h_core(i) += mo_mono_elec_integrals(k,j) * (one_body_dm_mo_alpha(k,j,i) + one_body_dm_mo_beta(k,j,i))
enddo
enddo
@ -20,7 +20,7 @@
double precision :: accu
accu = 0.d0
do i = 1, N_states
do j = 1, mo_tot_num
do j = 1, mo_num
accu += one_body_dm_mo_alpha(j,j,i) + one_body_dm_mo_beta(j,j,i)
enddo
accu = (elec_alpha_num + elec_beta_num ) / accu

View File

@ -19,7 +19,7 @@ BEGIN_PROVIDER [integer(bit_kind), ref_closed_shell_bitmask, (N_int,2)]
END_PROVIDER
BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_tot_num, mo_tot_num) ]
BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_num, mo_num) ]
implicit none
integer :: i0,j0,i,j,k0,k
integer :: n_occ_ab(2)
@ -37,15 +37,15 @@ BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_to
key_virt(i,2) = xor(key_virt(i,2),ref_closed_shell_bitmask(i,2))
enddo
double precision, allocatable :: array_coulomb(:),array_exchange(:)
allocate (array_coulomb(mo_tot_num),array_exchange(mo_tot_num))
allocate (array_coulomb(mo_num),array_exchange(mo_num))
call bitstring_to_list_ab(key_virt, occ_virt, n_occ_ab_virt, N_int)
! docc ---> virt mono excitations
do i0 = 1, n_occ_ab(1)
i=occ(i0,1)
do j0 = 1, n_occ_ab_virt(1)
j = occ_virt(j0,1)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map)
double precision :: accu
accu = 0.d0
do k0 = 1, n_occ_ab(1)
@ -62,8 +62,8 @@ BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_to
i=occ_virt(i0,1)
do j0 = 1, n_occ_ab_virt(1)
j = occ_virt(j0,1)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map)
accu = 0.d0
do k0 = 1, n_occ_ab(1)
k = occ(k0,1)
@ -79,8 +79,8 @@ BEGIN_PROVIDER [double precision, fock_operator_closed_shell_ref_bitmask, (mo_to
i=occ(i0,1)
do j0 = 1, n_occ_ab(1)
j = occ(j0,1)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_tot_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_tot_num,array_exchange,mo_integrals_map)
call get_mo_bielec_integrals_coulomb_ii(i,j,mo_num,array_coulomb,mo_integrals_map)
call get_mo_bielec_integrals_exch_ii(i,j,mo_num,array_exchange,mo_integrals_map)
accu = 0.d0
do k0 = 1, n_occ_ab(1)
k = occ(k0,1)

View File

@ -1592,7 +1592,7 @@ double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Ni
END_DOC
integer,intent(in) :: Nint
integer(bit_kind),intent(in) :: det_ref(Nint,2), det_pert(Nint,2)
double precision, intent(in) :: fock_diag_tmp(2,mo_tot_num+1)
double precision, intent(in) :: fock_diag_tmp(2,mo_num+1)
integer :: degree
double precision :: phase, E0
@ -1600,7 +1600,7 @@ double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Ni
integer :: h1, p1, h2, p2, s1, s2
call get_excitation_degree(det_ref,det_pert,degree,Nint)
E0 = fock_diag_tmp(1,mo_tot_num+1)
E0 = fock_diag_tmp(1,mo_num+1)
if (degree == 2) then
call get_double_excitation(det_ref,det_pert,exc,phase,Nint)
call decode_exc(exc,2,h1,p1,h2,p2,s1,s2)
@ -1793,9 +1793,9 @@ subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb)
key(k,ispin) = ibset(key(k,ispin),l)
other_spin = iand(ispin,1)+1
! if (iorb > mo_tot_num) then
! print *, irp_here, 'iorb > mo_tot_num'
! print *, iorb, mo_tot_num
! if (iorb > mo_num) then
! print *, irp_here, 'iorb > mo_num'
! print *, iorb, mo_num
! stop -1
! endif
hjj = hjj + mo_mono_elec_integrals(iorb,iorb)

View File

@ -872,7 +872,7 @@ BEGIN_PROVIDER [ integer, singles_alpha_size ]
BEGIN_DOC
! Dimension of the singles_alpha array
END_DOC
singles_alpha_size = elec_alpha_num * (mo_tot_num - elec_alpha_num)
singles_alpha_size = elec_alpha_num * (mo_num - elec_alpha_num)
END_PROVIDER
BEGIN_PROVIDER [ integer*8, singles_alpha_csc_idx, (N_det_alpha_unique+1) ]

View File

@ -109,7 +109,7 @@ end
integer :: i,j,k,l,m,istate
double precision :: contrib
double precision :: r(3)
double precision :: aos_array(ao_num),mos_array(mo_tot_num)
double precision :: aos_array(ao_num),mos_array(mo_num)
do j = 1, nucl_num
do k = 1, n_points_radial_grid -1
do l = 1, n_points_integration_angular

View File

@ -1,5 +1,5 @@
BEGIN_PROVIDER[double precision, mos_in_r_array, (mo_tot_num,n_points_final_grid)]
&BEGIN_PROVIDER[double precision, mos_in_r_array_transp,(n_points_final_grid,mo_tot_num)]
BEGIN_PROVIDER[double precision, mos_in_r_array, (mo_num,n_points_final_grid)]
&BEGIN_PROVIDER[double precision, mos_in_r_array_transp,(n_points_final_grid,mo_num)]
implicit none
BEGIN_DOC
! mos_in_r_array(i,j) = value of the ith mo on the jth grid point
@ -7,13 +7,13 @@
! mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point
END_DOC
integer :: i,j
double precision :: mos_array(mo_tot_num), r(3)
double precision :: mos_array(mo_num), r(3)
do i = 1, n_points_final_grid
r(1) = final_grid_points(1,i)
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
call give_all_mos_at_r(r,mos_array)
do j = 1, mo_tot_num
do j = 1, mo_num
mos_in_r_array(j,i) = mos_array(j)
mos_in_r_array_transp(i,j) = mos_array(j)
enddo
@ -21,7 +21,7 @@
END_PROVIDER
BEGIN_PROVIDER[double precision, mos_grad_in_r_array,(mo_tot_num,n_points_final_grid,3)]
BEGIN_PROVIDER[double precision, mos_grad_in_r_array,(mo_num,n_points_final_grid,3)]
implicit none
BEGIN_DOC
! mos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith mo on the jth grid point
@ -33,11 +33,11 @@
integer :: m
mos_grad_in_r_array = 0.d0
do m=1,3
call dgemm('N','N',mo_tot_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_tot_num,aos_grad_in_r_array(1,1,m),ao_num,0.d0,mos_grad_in_r_array(1,1,m),mo_tot_num)
call dgemm('N','N',mo_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_num,aos_grad_in_r_array(1,1,m),ao_num,0.d0,mos_grad_in_r_array(1,1,m),mo_num)
enddo
END_PROVIDER
BEGIN_PROVIDER[double precision, mos_lapl_in_r_array,(mo_tot_num,n_points_final_grid,3)]
BEGIN_PROVIDER[double precision, mos_lapl_in_r_array,(mo_num,n_points_final_grid,3)]
implicit none
BEGIN_DOC
! mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point
@ -49,7 +49,7 @@
integer :: m
mos_lapl_in_r_array = 0.d0
do m=1,3
call dgemm('N','N',mo_tot_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_tot_num,aos_lapl_in_r_array(1,1,m),ao_num,0.d0,mos_lapl_in_r_array(1,1,m),mo_tot_num)
call dgemm('N','N',mo_num,n_points_final_grid,ao_num,1.d0,mo_coef_transp,mo_num,aos_lapl_in_r_array(1,1,m),ao_num,0.d0,mos_lapl_in_r_array(1,1,m),mo_num)
enddo
END_PROVIDER

View File

@ -10,8 +10,8 @@
psi_dft_energy_kinetic = 0.d0
psi_dft_energy_nuclear_elec = 0.d0
do istate = 1, N_states
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
psi_dft_energy_kinetic(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_kinetic_integrals(j,i)
psi_dft_energy_nuclear_elec(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_nucl_elec_integrals(j,i)
enddo
@ -19,7 +19,7 @@
enddo
accu = 0.d0
do i = 1, N_states
do j = 1, mo_tot_num
do j = 1, mo_num
accu += one_body_dm_mo_alpha_for_dft(j,j,i) + one_body_dm_mo_beta_for_dft(j,j,i)
enddo
accu = (elec_alpha_num + elec_beta_num ) / accu

View File

@ -57,10 +57,10 @@ END_PROVIDER
BEGIN_PROVIDER [double precision, potential_x_alpha_mo,(mo_tot_num,mo_tot_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_x_beta_mo,(mo_tot_num,mo_tot_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_c_alpha_mo,(mo_tot_num,mo_tot_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_c_beta_mo,(mo_tot_num,mo_tot_num,N_states)]
BEGIN_PROVIDER [double precision, potential_x_alpha_mo,(mo_num,mo_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_x_beta_mo,(mo_num,mo_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_c_alpha_mo,(mo_num,mo_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_c_beta_mo,(mo_num,mo_num,N_states)]
implicit none
BEGIN_DOC
! general providers for the alpha/beta exchange/correlation potentials on the MO basis
@ -114,8 +114,8 @@ END_PROVIDER
do istate = 1, N_states
Trace_v_xc(istate) = 0.d0
Trace_v_H(istate) = 0.d0
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
Trace_v_xc(istate) += (potential_x_alpha_mo(j,i,istate) + potential_c_alpha_mo(j,i,istate)) * one_body_dm_mo_alpha_for_dft(j,i,istate)
Trace_v_xc(istate) += (potential_x_beta_mo(j,i,istate) + potential_c_beta_mo(j,i,istate) ) * one_body_dm_mo_beta_for_dft(j,i,istate)
dm = one_body_dm_mo_alpha_for_dft(j,i,istate) + one_body_dm_mo_beta_for_dft(j,i,istate)

View File

@ -1,4 +1,4 @@
BEGIN_PROVIDER [double precision, short_range_Hartree_operator, (mo_tot_num,mo_tot_num,N_states)]
BEGIN_PROVIDER [double precision, short_range_Hartree_operator, (mo_num,mo_num,N_states)]
&BEGIN_PROVIDER [double precision, short_range_Hartree, (N_states)]
implicit none
BEGIN_DOC
@ -11,17 +11,17 @@
integer :: i,j,k,l,m,n,istate
double precision :: get_mo_bielec_integral,get_mo_bielec_integral_erf
double precision :: integral, integral_erf, contrib
double precision :: integrals_array(mo_tot_num,mo_tot_num),integrals_erf_array(mo_tot_num,mo_tot_num)
double precision :: integrals_array(mo_num,mo_num),integrals_erf_array(mo_num,mo_num)
short_range_Hartree_operator = 0.d0
short_range_Hartree = 0.d0
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
if(dabs(one_body_dm_average_mo_for_dft(j,i)).le.1.d-12)cycle
call get_mo_bielec_integrals_i1j1(i,j,mo_tot_num,integrals_array,mo_integrals_map)
call get_mo_bielec_integrals_erf_i1j1(i,j,mo_tot_num,integrals_erf_array,mo_integrals_erf_map)
call get_mo_bielec_integrals_i1j1(i,j,mo_num,integrals_array,mo_integrals_map)
call get_mo_bielec_integrals_erf_i1j1(i,j,mo_num,integrals_erf_array,mo_integrals_erf_map)
do istate = 1, N_states
do k = 1, mo_tot_num
do l = 1, mo_tot_num
do k = 1, mo_num
do l = 1, mo_num
integral = integrals_array(l,k)
integral_erf = integrals_erf_array(l,k)
contrib = one_body_dm_mo_for_dft(i,j,istate) * (integral - integral_erf)
@ -37,8 +37,8 @@
END_PROVIDER
BEGIN_PROVIDER [double precision, effective_one_e_potential, (mo_tot_num, mo_tot_num,N_states)]
&BEGIN_PROVIDER [double precision, effective_one_e_potential_without_kin, (mo_tot_num, mo_tot_num,N_states)]
BEGIN_PROVIDER [double precision, effective_one_e_potential, (mo_num, mo_num,N_states)]
&BEGIN_PROVIDER [double precision, effective_one_e_potential_without_kin, (mo_num, mo_num,N_states)]
implicit none
integer :: i,j,istate
effective_one_e_potential = 0.d0
@ -52,8 +52,8 @@ END_PROVIDER
! shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal
END_DOC
do istate = 1, N_states
do i = 1, mo_tot_num
do j = 1, mo_tot_num
do i = 1, mo_num
do j = 1, mo_num
effective_one_e_potential(i,j,istate) = short_range_Hartree_operator(i,j,istate) + mo_nucl_elec_integrals(i,j) + mo_kinetic_integrals(i,j) &
+ 0.5d0 * (potential_x_alpha_mo(i,j,istate) + potential_c_alpha_mo(i,j,istate) &
+ potential_x_beta_mo(i,j,istate) + potential_c_beta_mo(i,j,istate) )

View File

@ -187,10 +187,10 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index
allocate(minilist(N_int, 2, N_det_selectors), fullminilist(N_int, 2, N_det))
allocate(banned(mo_tot_num, mo_tot_num,2), bannedOrb(mo_tot_num, 2))
allocate(counted(mo_tot_num, mo_tot_num), countedOrb(mo_tot_num, 2))
allocate (indexes(0:mo_tot_num, 0:mo_tot_num))
allocate (indexes_end(0:mo_tot_num, 0:mo_tot_num))
allocate(banned(mo_num, mo_num,2), bannedOrb(mo_num, 2))
allocate(counted(mo_num, mo_num), countedOrb(mo_num, 2))
allocate (indexes(0:mo_num, 0:mo_num))
allocate (indexes_end(0:mo_num, 0:mo_num))
integer :: nb_count
do s1=1,2
do i1=N_holes(s1),1,-1 ! Generate low excitations first
@ -322,7 +322,7 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index
h2 = hole_list(i2,s2)
call apply_hole(pmask, s2,h2, mask, ok, N_int)
banned = .false.
do j=1,mo_tot_num
do j=1,mo_num
bannedOrb(j, 1) = .true.
bannedOrb(j, 2) = .true.
enddo
@ -370,15 +370,15 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned,
implicit none
double precision,intent(inout) :: delta_ij_loc(N_states,N_det,2)
integer, intent(in) :: sp, indexes(0:mo_tot_num, 0:mo_tot_num), siz, iproc, i_gen
integer, intent(in) :: indexes_end(0:mo_tot_num, 0:mo_tot_num), rabuf(*)
logical, intent(in) :: bannedOrb(mo_tot_num,2), banned(mo_tot_num, mo_tot_num)
integer, intent(in) :: sp, indexes(0:mo_num, 0:mo_num), siz, iproc, i_gen
integer, intent(in) :: indexes_end(0:mo_num, 0:mo_num), rabuf(*)
logical, intent(in) :: bannedOrb(mo_num,2), banned(mo_num, mo_num)
integer(bit_kind), intent(in) :: mask(N_int, 2)
integer(bit_kind) :: alpha(N_int, 2)
integer, allocatable :: labuf(:), abuf(:), iorder(:)
logical :: ok
integer :: i,j,k,s,st1,st2,st3,st4,t2
integer :: lindex(mo_tot_num,2), lindex_end(mo_tot_num, 2)
integer :: lindex(mo_num,2), lindex_end(mo_num, 2)
integer :: s1, s2, stamo
integer(bit_kind), allocatable :: det_minilist(:,:,:)
@ -420,7 +420,7 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned,
lindex_end(:,1) = indexes_end(1:, 0)-1
end if
do i=1,mo_tot_num
do i=1,mo_num
do j=1,2
if(lindex(i,j) > 0 .and. lindex_end(i,j) > lindex(i,j)) then
call isort(abuf(lindex(i,j)), iorder, lindex_end(i,j)-lindex(i,j)+1)
@ -429,7 +429,7 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned,
end do
do i=1,mo_tot_num
do i=1,mo_num
if(bannedOrb(i,s1)) cycle
if(lindex(i,s1) /= 0) then
st2 = st1 + 1 + lindex_end(i,s1)-lindex(i,s1)
@ -447,7 +447,7 @@ subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned,
stamo = i+1
end if
do j=stamo,mo_tot_num
do j=stamo,mo_num
if(bannedOrb(j,s2) .or. banned(i,j)) cycle
if(lindex(j,s2) /= 0) then
k = lindex(j,s2)
@ -498,8 +498,8 @@ subroutine create_indexes(countedGlob, countedOrb, counted, indexes, siz)
use bitmasks
implicit none
integer, intent(in) :: countedGlob, countedOrb(mo_tot_num,2), counted(mo_tot_num, mo_tot_num)
integer, intent(out) :: indexes(0:mo_tot_num, 0:mo_tot_num), siz
integer, intent(in) :: countedGlob, countedOrb(mo_num,2), counted(mo_num, mo_num)
integer, intent(out) :: indexes(0:mo_num, 0:mo_num), siz
integer :: tmp, i, j
indexes(0, 0) = countedGlob
@ -509,8 +509,8 @@ subroutine create_indexes(countedGlob, countedOrb, counted, indexes, siz)
siz = 1
do i=0, mo_tot_num
do j=0, mo_tot_num
do i=0, mo_num
do j=0, mo_num
if(indexes(i,j) == 0) cycle
tmp = indexes(i,j)
indexes(i,j) = siz
@ -529,8 +529,8 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob,
integer, intent(in) :: sp, i_gen, N_sel
integer, intent(in) :: interesting(0:N_sel)
integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel)
logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2)
integer, intent(inout) :: countedGlob, countedOrb(mo_tot_num, 2), counted(mo_tot_num, mo_tot_num)
logical, intent(inout) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num, 2)
integer, intent(inout) :: countedGlob, countedOrb(mo_num, 2), counted(mo_num, mo_num)
integer :: i, s, ii, j, k, l, h(0:2,2), p(0:4,2), nt
@ -568,7 +568,7 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob,
if (interesting(i) == i_gen) then
do s=1,2
do j=1,mo_tot_num
do j=1,mo_num
if(bannedOrb(j, s)) then
if(sp == 3 .and. s == 1) then
banned(j, :, 1) = .true.
@ -583,14 +583,14 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob,
end do
if(sp == 3) then
do j=1,mo_tot_num
do k=1,mo_tot_num
do j=1,mo_num
do k=1,mo_num
banned(j,k,2) = banned(k,j,1)
enddo
enddo
else
do k=1,mo_tot_num
do l=k+1,mo_tot_num
do k=1,mo_num
do l=k+1,mo_num
banned(l,k,1) = banned(k,l,1)
end do
end do
@ -625,10 +625,10 @@ subroutine count_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, countedGlob,
end if
end do
do i=1,mo_tot_num
do i=1,mo_num
if(bannedOrb(i,1)) countedOrb(i,1) = 0
if(bannedOrb(i,2)) countedOrb(i,2) = 0
do j=1,mo_tot_num
do j=1,mo_num
if(banned(i,j,1)) counted(i,j) = 0
end do
end do
@ -647,8 +647,8 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, indexes, ab
integer, intent(in) :: sp, i_gen, N_sel
integer, intent(in) :: interesting(0:N_sel)
integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel)
logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2)
integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num)
logical, intent(inout) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num, 2)
integer, intent(inout) :: indexes(0:mo_num, 0:mo_num)
integer, intent(inout) :: abuf(*)
integer :: i, ii, j, k, l, h(0:2,2), p(0:4,2), nt, s
integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2)
@ -717,8 +717,8 @@ subroutine get_d2(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2)
integer, intent(inout) :: abuf(*)
integer, intent(in) :: i_gen
logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2)
integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num)
logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2)
integer, intent(inout) :: indexes(0:mo_num, 0:mo_num)
integer, intent(in) :: h(0:2,2), p(0:4,2), sp
!double precision, external :: get_phase_bi
@ -845,11 +845,11 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2)
integer, intent(inout) :: abuf(*)
integer,intent(in) :: i_gen
logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2)
logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num,2)
integer(bit_kind) :: det(N_int, 2)
integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num)
integer, intent(inout) :: indexes(0:mo_num, 0:mo_num)
integer, intent(in) :: h(0:2,2), p(0:4,2), sp
double precision :: hij, tmp_row(N_states, mo_tot_num), tmp_row2(N_states, mo_tot_num)
double precision :: hij, tmp_row(N_states, mo_num), tmp_row2(N_states, mo_num)
!double precision, external :: get_phase_bi
double precision, external :: mo_bielec_integral
logical :: ok
@ -865,7 +865,7 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
integer :: phasemask(2,N_int*bit_kind_size)
allocate (lbanned(mo_tot_num, 2))
allocate (lbanned(mo_num, 2))
lbanned = bannedOrb
do i=1, p(0,1)
@ -895,19 +895,19 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
! hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2)
! tmp_row(1:N_states,putj) += hij * coefs(1:N_states)
!end do
!do putj=hfix+1, mo_tot_num
!do putj=hfix+1, mo_num
! if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle
! hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2)
! tmp_row(1:N_states,putj) += hij * coefs(1:N_states)
!end do
if(ma == 1) then
!mat(1:N_states,1:mo_tot_num,puti) += tmp_row(1:N_states,1:mo_tot_num)
!mat(1:N_states,1:mo_num,puti) += tmp_row(1:N_states,1:mo_num)
abuf(indexes(0, puti)) = i_gen
indexes(0, puti) += 1
!countedOrb(puti, 2) -= 1
else
!mat(1:N_states,puti,1:mo_tot_num) += tmp_row(1:N_states,1:mo_tot_num)
!mat(1:N_states,puti,1:mo_num) += tmp_row(1:N_states,1:mo_num)
abuf(indexes(puti, 0)) = i_gen
indexes(puti, 0) += 1
!countedOrb(puti, 1) -= 1
@ -918,7 +918,7 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
!pfix = p(1,mi)
!tmp_row = 0d0
!tmp_row2 = 0d0
!do puti=1,mo_tot_num
!do puti=1,mo_num
! if(lbanned(puti,mi)) cycle
!p1 fixed
! putj = p1
@ -966,7 +966,7 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
! hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2)
! tmp_row(:,putj) += hij * coefs(:)
!end do
!do putj=hfix+1,mo_tot_num
!do putj=hfix+1,mo_num
! if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle
! hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2)
! tmp_row(:,putj) += hij * coefs(:)
@ -991,7 +991,7 @@ subroutine get_d1(i_gen, gen, banned, bannedOrb, indexes, abuf, mask, h, p, sp)
p2 = p(2,ma)
!tmp_row = 0d0
!tmp_row2 = 0d0
!do puti=1,mo_tot_num
!do puti=1,mo_num
! if(lbanned(puti,ma)) cycle
! putj = p2
!if(.not. banned(puti,putj,1)) then
@ -1055,7 +1055,7 @@ subroutine past_d1(bannedOrb, p)
use bitmasks
implicit none
logical, intent(inout) :: bannedOrb(mo_tot_num, 2)
logical, intent(inout) :: bannedOrb(mo_num, 2)
integer, intent(in) :: p(0:4, 2)
integer :: i,s
@ -1071,7 +1071,7 @@ subroutine past_d2(banned, p, sp)
use bitmasks
implicit none
logical, intent(inout) :: banned(mo_tot_num, mo_tot_num)
logical, intent(inout) :: banned(mo_num, mo_num)
integer, intent(in) :: p(0:4, 2), sp
integer :: i,j
@ -1096,7 +1096,7 @@ subroutine count_d1(countedOrb, p)
use bitmasks
implicit none
integer, intent(inout) :: countedOrb(mo_tot_num, 2)
integer, intent(inout) :: countedOrb(mo_num, 2)
integer, intent(in) :: p(0:4, 2)
integer :: i,s
@ -1112,7 +1112,7 @@ subroutine count_d2(counted, p, sp)
use bitmasks
implicit none
integer, intent(inout) :: counted(mo_tot_num, mo_tot_num)
integer, intent(inout) :: counted(mo_num, mo_num)
integer, intent(in) :: p(0:4, 2), sp
integer :: i,j
@ -1140,7 +1140,7 @@ subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting)
integer, intent(in) :: i_gen, N
integer, intent(in) :: interesting(0:N)
integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N)
logical, intent(inout) :: banned(mo_tot_num, mo_tot_num)
logical, intent(inout) :: banned(mo_num, mo_num)
logical, intent(out) :: fullMatch

Some files were not shown because too many files have changed in this diff Show More