2019-03-07 16:29:06 +01:00
|
|
|
.. _module_utils:
|
|
|
|
|
|
|
|
.. program:: utils
|
|
|
|
|
|
|
|
.. default-role:: option
|
|
|
|
|
|
|
|
=====
|
|
|
|
utils
|
|
|
|
=====
|
|
|
|
|
|
|
|
Contains general purpose utilities (sorting, maps, etc).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Providers
|
|
|
|
---------
|
|
|
|
|
|
|
|
.. c:var:: binom
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: binom (0:40,0:40)
|
|
|
|
double precision, allocatable :: binom_transp (0:40,0:40)
|
|
|
|
|
|
|
|
|
|
|
|
Binomial coefficients
|
|
|
|
|
|
|
|
Needed by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`binom_int`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: binom_int
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
integer*8, allocatable :: binom_int (0:40,0:40)
|
|
|
|
integer*8, allocatable :: binom_int_transp (0:40,0:40)
|
|
|
|
|
|
|
|
|
|
|
|
Binomial coefficients, as integers*8
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`binom`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: binom_int_transp
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
integer*8, allocatable :: binom_int (0:40,0:40)
|
|
|
|
integer*8, allocatable :: binom_int_transp (0:40,0:40)
|
|
|
|
|
|
|
|
|
|
|
|
Binomial coefficients, as integers*8
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`binom`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: binom_transp
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: binom (0:40,0:40)
|
|
|
|
double precision, allocatable :: binom_transp (0:40,0:40)
|
|
|
|
|
|
|
|
|
|
|
|
Binomial coefficients
|
|
|
|
|
|
|
|
Needed by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`binom_int`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: degree_max_integration_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/angular_integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
integer :: degree_max_integration_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
integrate correctly a polynom of order "degree_max_integration_lebedev"
|
|
|
|
needed for the angular integration according to LEBEDEV formulae
|
|
|
|
|
|
|
|
Needed by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`n_points_integration_angular_lebedev`
|
|
|
|
* :c:data:`theta_angular_integration_lebedev`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dtranspose:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/transpose.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine dtranspose(A,LDA,B,LDB,d1,d2)
|
|
|
|
|
|
|
|
|
|
|
|
Transpose input matrix A into output matrix B
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`dtranspose`
|
|
|
|
* :c:func:`h_s2_u_0_nstates_openmp`
|
|
|
|
* :c:func:`h_s2_u_0_nstates_zmq`
|
|
|
|
* :c:func:`h_s2_u_0_two_e_nstates_openmp`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`dtranspose`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: fact_inv
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: fact_inv (128)
|
|
|
|
|
|
|
|
|
|
|
|
1/n!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: i2radix_sort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_644`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine i2radix_sort(x,iorder,isize,iradix)
|
|
|
|
|
|
|
|
|
|
|
|
Sort integer array x(isize) using the radix sort algorithm.
|
|
|
|
iorder in input should be (1,2,3,...,isize), and in output
|
|
|
|
contains the new order of the elements.
|
|
|
|
iradix should be -1 in input.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`get_mo_two_e_integrals_erf_i1j1`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_erf_ij`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_i1j1`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_ij`
|
|
|
|
* :c:func:`i2radix_sort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`i2radix_sort`
|
|
|
|
* :c:func:`insertion_i2sort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: i8radix_sort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_644`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine i8radix_sort(x,iorder,isize,iradix)
|
|
|
|
|
|
|
|
|
|
|
|
Sort integer array x(isize) using the radix sort algorithm.
|
|
|
|
iorder in input should be (1,2,3,...,isize), and in output
|
|
|
|
contains the new order of the elements.
|
|
|
|
iradix should be -1 in input.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`get_mo_two_e_integrals_erf_i1j1`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_erf_ij`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_i1j1`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_ij`
|
|
|
|
* :c:func:`i8radix_sort`
|
|
|
|
* :c:data:`psi_bilinear_matrix_transp_values`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`i8radix_sort`
|
|
|
|
* :c:func:`insertion_i8sort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: i8radix_sort_big:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_644`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine i8radix_sort_big(x,iorder,isize,iradix)
|
|
|
|
|
|
|
|
|
|
|
|
Sort integer array x(isize) using the radix sort algorithm.
|
|
|
|
iorder in input should be (1,2,3,...,isize), and in output
|
|
|
|
contains the new order of the elements.
|
|
|
|
iradix should be -1 in input.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`i8radix_sort_big`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`i8radix_sort_big`
|
|
|
|
* :c:func:`insertion_i8sort_big`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: inv_int
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: inv_int (128)
|
|
|
|
|
|
|
|
|
|
|
|
1/i
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: iradix_sort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_644`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine iradix_sort(x,iorder,isize,iradix)
|
|
|
|
|
|
|
|
|
|
|
|
Sort integer array x(isize) using the radix sort algorithm.
|
|
|
|
iorder in input should be (1,2,3,...,isize), and in output
|
|
|
|
contains the new order of the elements.
|
|
|
|
iradix should be -1 in input.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`get_mo_two_e_integrals_erf_i1j1`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_erf_ij`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_i1j1`
|
|
|
|
* :c:func:`get_mo_two_e_integrals_ij`
|
|
|
|
* :c:func:`iradix_sort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`insertion_isort`
|
|
|
|
* :c:func:`iradix_sort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: iradix_sort_big:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_644`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine iradix_sort_big(x,iorder,isize,iradix)
|
|
|
|
|
|
|
|
|
|
|
|
Sort integer array x(isize) using the radix sort algorithm.
|
|
|
|
iorder in input should be (1,2,3,...,isize), and in output
|
|
|
|
contains the new order of the elements.
|
|
|
|
iradix should be -1 in input.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`iradix_sort_big`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`insertion_isort_big`
|
|
|
|
* :c:func:`iradix_sort_big`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: n_points_integration_angular_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/angular_integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
integer :: n_points_integration_angular_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
Number of points needed for the angular integral
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`degree_max_integration_lebedev`
|
|
|
|
|
|
|
|
Needed by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`theta_angular_integration_lebedev`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: nproc
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
integer :: nproc
|
|
|
|
|
|
|
|
|
|
|
|
Number of current OpenMP threads
|
|
|
|
|
|
|
|
Needed by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`ao_two_e_integrals_erf_in_map`
|
|
|
|
* :c:data:`ao_two_e_integrals_in_map`
|
|
|
|
* :c:data:`h_apply_buffer_allocated`
|
|
|
|
* :c:data:`n_det`
|
|
|
|
* :c:data:`nthreads_davidson`
|
|
|
|
* :c:data:`nthreads_pt2`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: overlap_gaussian_xyz:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/one_e_integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,&
|
|
|
|
power_B,overlap_x,overlap_y,overlap_z,overlap,dim)
|
|
|
|
|
|
|
|
|
|
|
|
.. math::
|
|
|
|
|
|
|
|
S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\
|
|
|
|
S = S_x S_y S_z
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`ao_coef_normalization_libint_factor`
|
|
|
|
* :c:data:`ao_coef_normalized`
|
|
|
|
* :c:data:`ao_deriv2_x`
|
|
|
|
* :c:data:`ao_deriv_1_x`
|
|
|
|
* :c:data:`ao_dipole_x`
|
|
|
|
* :c:data:`ao_overlap`
|
|
|
|
* :c:data:`ao_spread_x`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`gaussian_product_x`
|
|
|
|
* :c:func:`give_explicit_poly_and_gaussian`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: phi_angular_integration_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/angular_integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: theta_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
double precision, allocatable :: phi_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
double precision, allocatable :: weights_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
|
|
|
|
|
|
|
|
Theta phi values together with the weights values for the angular integration :
|
|
|
|
integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1<i<n_points_integration_angular_lebedev) f(xi,yi,zi)
|
|
|
|
Note that theta and phi are in DEGREES !!
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`degree_max_integration_lebedev`
|
|
|
|
* :c:data:`n_points_integration_angular_lebedev`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: qp_max_mem
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/memory.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
integer :: qp_max_mem
|
|
|
|
|
|
|
|
|
|
|
|
Maximum memory in Gb
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`mpi_master`
|
|
|
|
|
|
|
|
Needed by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`pt2_j`
|
|
|
|
* :c:data:`pt2_w`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: rec__quicksort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_261`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine rec__quicksort(x, iorder, isize, first, last, level)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`quick_sort`
|
|
|
|
* :c:func:`rec__quicksort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`rec__quicksort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: rec_d_quicksort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_261`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine rec_d_quicksort(x, iorder, isize, first, last, level)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`quick_dsort`
|
|
|
|
* :c:func:`rec_d_quicksort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`rec_d_quicksort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: rec_i2_quicksort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_261`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine rec_i2_quicksort(x, iorder, isize, first, last, level)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`quick_i2sort`
|
|
|
|
* :c:func:`rec_i2_quicksort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`rec_i2_quicksort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: rec_i8_quicksort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_261`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine rec_i8_quicksort(x, iorder, isize, first, last, level)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`quick_i8sort`
|
|
|
|
* :c:func:`rec_i8_quicksort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`rec_i8_quicksort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: rec_i_quicksort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_261`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine rec_i_quicksort(x, iorder, isize, first, last, level)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`quick_isort`
|
|
|
|
* :c:func:`rec_i_quicksort`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`rec_i_quicksort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: theta_angular_integration_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/angular_integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: theta_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
double precision, allocatable :: phi_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
double precision, allocatable :: weights_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
|
|
|
|
|
|
|
|
Theta phi values together with the weights values for the angular integration :
|
|
|
|
integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1<i<n_points_integration_angular_lebedev) f(xi,yi,zi)
|
|
|
|
Note that theta and phi are in DEGREES !!
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`degree_max_integration_lebedev`
|
|
|
|
* :c:data:`n_points_integration_angular_lebedev`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: transpose:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/transpose.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
recursive subroutine transpose(A,LDA,B,LDB,d1,d2)
|
|
|
|
|
|
|
|
|
|
|
|
Transpose input matrix A into output matrix B
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`transpose`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`transpose`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:var:: weights_angular_integration_lebedev
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/angular_integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision, allocatable :: theta_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
double precision, allocatable :: phi_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
double precision, allocatable :: weights_angular_integration_lebedev (n_points_integration_angular_lebedev)
|
|
|
|
|
|
|
|
|
|
|
|
Theta phi values together with the weights values for the angular integration :
|
|
|
|
integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1<i<n_points_integration_angular_lebedev) f(xi,yi,zi)
|
|
|
|
Note that theta and phi are in DEGREES !!
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`degree_max_integration_lebedev`
|
|
|
|
* :c:data:`n_points_integration_angular_lebedev`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subroutines / functions
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
.. c:function:: a_coef:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function a_coef(n)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: add_poly:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine add_poly(b,nb,c,nc,d,nd)
|
|
|
|
|
|
|
|
|
|
|
|
Add two polynomials
|
|
|
|
D(t) =! D(t) +( B(t)+C(t))
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: add_poly_multiply:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine add_poly_multiply(b,nb,cst,d,nd)
|
|
|
|
|
|
|
|
|
|
|
|
Add a polynomial multiplied by a constant
|
|
|
|
D(t) =! D(t) +( cst * B(t))
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`general_primitive_integral`
|
|
|
|
* :c:func:`general_primitive_integral_erf`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: apply_rotation:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/linear_algebra.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine apply_rotation(A,LDA,R,LDR,B,LDB,m,n)
|
|
|
|
|
|
|
|
|
|
|
|
Apply the rotation found by find_rotation
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`dgemm`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: approx_dble:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function approx_dble(a,n)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: b_coef:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function b_coef(n,u)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: binom_func:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function binom_func(i,j)
|
|
|
|
|
|
|
|
|
|
|
|
.. math ::
|
|
|
|
|
|
|
|
\frac{i!}{j!(i-j)!}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: check_mem:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/memory.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine check_mem(rss_in,routine)
|
|
|
|
|
|
|
|
|
|
|
|
Checks if n gigabytes can be allocated. If not, exit the run.
|
|
|
|
|
|
|
|
Needs:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`qp_max_mem`
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`create_selection_buffer`
|
|
|
|
* :c:func:`davidson_diag_hjj_sjj`
|
|
|
|
* :c:func:`make_selection_buffer_s2`
|
|
|
|
* :c:func:`merge_selection_buffers`
|
|
|
|
* :c:func:`pt2_collector`
|
|
|
|
* :c:data:`pt2_j`
|
|
|
|
* :c:data:`pt2_w`
|
|
|
|
* :c:func:`remove_duplicates_in_selection_buffer`
|
|
|
|
* :c:func:`run_cipsi`
|
|
|
|
* :c:func:`run_slave_main`
|
|
|
|
* :c:func:`run_stochastic_cipsi`
|
|
|
|
* :c:func:`selection_collector`
|
|
|
|
* :c:func:`sort_selection_buffer`
|
|
|
|
* :c:func:`testteethbuilding`
|
|
|
|
* :c:func:`zmq_pt2`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`resident_memory`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dble_fact:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function dble_fact(n)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dble_fact_even:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function dble_fact_even(n) result(fact2)
|
|
|
|
|
|
|
|
|
|
|
|
n!!
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dble_fact_odd:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function dble_fact_odd(n) result(fact2)
|
|
|
|
|
|
|
|
|
|
|
|
n!!
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dble_logfact:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function dble_logfact(n) result(logfact2)
|
|
|
|
|
|
|
|
|
|
|
|
n!!
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: ddfact2:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function ddfact2(n)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dset_order:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_347`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine dset_order(x,iorder,isize)
|
|
|
|
|
|
|
|
|
|
|
|
array A has already been sorted, and iorder has contains the new order of
|
|
|
|
elements of A. This subroutine changes the order of x to match the new order of A.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`ao_coef_normalized_ordered`
|
|
|
|
* :c:func:`h_s2_u_0_nstates_openmp`
|
|
|
|
* :c:func:`h_s2_u_0_nstates_zmq`
|
|
|
|
* :c:func:`h_s2_u_0_two_e_nstates_openmp`
|
|
|
|
* :c:data:`psi_bilinear_matrix_transp_values`
|
|
|
|
* :c:data:`psi_bilinear_matrix_values`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dset_order_big:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_412`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine dset_order_big(x,iorder,isize)
|
|
|
|
|
|
|
|
|
|
|
|
array A has already been sorted, and iorder has contains the new order of
|
|
|
|
elements of A. This subroutine changes the order of x to match the new order of A.
|
|
|
|
This is a version for very large arrays where the indices need
|
|
|
|
to be in integer*8 format
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: dsort:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/sort.irp.f_template_293`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine dsort(x,iorder,isize)
|
|
|
|
|
|
|
|
|
|
|
|
Sort array x(isize).
|
|
|
|
iorder in input should be (1,2,3,...,isize), and in output
|
|
|
|
contains the new order of the elements.
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`ao_coef_normalized_ordered`
|
|
|
|
* :c:func:`make_selection_buffer_s2`
|
|
|
|
* :c:data:`psi_det_sorted`
|
|
|
|
* :c:func:`reorder_core_orb`
|
2019-05-28 10:23:50 +02:00
|
|
|
* :c:func:`sort_by_fock_energies`
|
2019-03-07 16:29:06 +01:00
|
|
|
* :c:func:`sort_selection_buffer`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`insertion_dsort`
|
|
|
|
* :c:func:`quick_dsort`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: erf0:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function erf0(x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: extrapolate_data:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/extrapolation.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine extrapolate_data(N_data, data, pt2, output)
|
|
|
|
|
|
|
|
|
|
|
|
Extrapolate the data to the FCI limit
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`extrapolated_energy`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`get_pseudo_inverse`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: f_integral:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function F_integral(n,p)
|
|
|
|
|
|
|
|
|
|
|
|
function that calculates the following integral
|
|
|
|
\int_{\-infty}^{+\infty} x^n \exp(-p x^2) dx
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: fact:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/util.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function fact(n)
|
|
|
|
|
|
|
|
|
|
|
|
n!
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: find_rotation:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/linear_algebra.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine find_rotation(A,LDA,B,m,C,n)
|
|
|
|
|
|
|
|
|
|
|
|
Find A.C = B
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`dgemm`
|
|
|
|
* :c:func:`get_pseudo_inverse`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: gammln:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function gammln(xx)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: gammp:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
double precision function gammp(a,x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`gcf`
|
|
|
|
* :c:func:`gser`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: gaussian_product:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine gaussian_product(a,xa,b,xb,k,p,xp)
|
|
|
|
|
|
|
|
|
|
|
|
Gaussian product in 1D.
|
|
|
|
e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2}
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`give_explicit_poly_and_gaussian`
|
|
|
|
* :c:func:`give_explicit_poly_and_gaussian_double`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: gaussian_product_x:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/integration.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine gaussian_product_x(a,xa,b,xb,k,p,xp)
|
|
|
|
|
|
|
|
|
|
|
|
Gaussian product in 1D.
|
|
|
|
e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2}
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`overlap_gaussian_xyz`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: gcf:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/need.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine gcf(gammcf,a,x,gln)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`gammp`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: get_inverse:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/linear_algebra.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine get_inverse(A,LDA,m,C,LDC)
|
|
|
|
|
|
|
|
|
|
|
|
Returns the inverse of the square matrix A
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`ao_ortho_canonical_coef_inv`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`dgetrf`
|
|
|
|
* :c:func:`dgetri`
|
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: get_pseudo_inverse:
|
|
|
|
|
|
|
|
|
|
|
|
File : :file:`utils/linear_algebra.irp.f`
|
|
|
|
|
|
|
|
.. code:: fortran
|
|
|
|
|
|
|
|
subroutine get_pseudo_inverse(A,LDA,m,n,C,LDC)
|
|
|
|
|
|
|
|
|
|
|
|
Find C = A^-1
|
|
|
|
|
|
|
|
Called by:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:data:`ao_cart_to_sphe_inv`
|
|
|
|
* :c:func:`extrapolate_data`
|
|
|
|
* :c:func:`find_rotation`
|
|
|
|
* :c:data:`s_inv`
|
|
|
|
|
|
|
|
Calls:
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
* :c:func:`dgesvd`
|
|
|
|
|
|
|
|
|
|
|
|
|