Merge branch 'toto' of github.com:eginer/quantum_package

This commit is contained in:
Anthony Scemama 2019-01-11 19:58:21 +01:00
commit cf2fa908e2
60 changed files with 1422 additions and 459 deletions

View File

@ -25,9 +25,8 @@ sets all the environment variables required for the normal operation of the
Running this script will also tell you which external dependencies are missing
and need to be installed.
Then, source the :file:`quantum_package.rc` file in your current shell before
installing the dependencies.
When all dependencies have been installed, ( the :command:`configure` will tell you)
source the :file:`quantum_package.rc` in order to load all environment variables and compile the |QP|.
Requirements
@ -71,6 +70,52 @@ architecture. Modify it if needed, and run :command:`configure` with
Help for installing external dependencies
=========================================
Using the :command:`configure` executable
-----------------------------------------
The :command:`configure` executable can help you in installing the minimal dependencies you will need to compile the |QP|.
The command is to be used as follows:
.. code:: bash
./configure --install <package>
The following packages are supported by the :command:`configure` installer:
* ninja
* irpf90
* zeromq
* f77zmq ( :math:`\approx` 3 minutes)
* ocaml
* ezfio
* emsl
* docopt
* resultsFile
* bats
Example:
.. code:: bash
./configure -i ezfio
.. note::
When installing the ocaml package, you will be asked the location of where it should be installed.
A safe option is to enter the path proposed by the |QP|:
QP>> Please install it here: /your_quantum_package_directory/bin
So just enter the proposition of the |QP| and press enter.
If the :command:`configure` executable fails to install a specific dependency
-----------------------------------------------------------------------------
If the :command:`configure` executable does not succeed to install a specific dependency,
there are some proposition of how to download and install the minimal dependencies to compile and use the |QP|
Before doing anything below, try to install the packages with your package manager
(:command:`apt`, :command:`yum`, etc)

37
REPLACE
View File

@ -144,3 +144,40 @@ qp_name ao_bi_elec_integral_beta -r ao_two_e_integral_beta
qp_name ao_bi_elec_integral_alpha -r ao_two_e_integral_alpha
qp_name ao_bi_elec_integral_alpha_tmp -r ao_two_e_integral_alpha_tmp
qp_name ao_bi_elec_integral_beta_tmp -r ao_two_e_integral_beta_tmp
qp_name data_one_body_alpha_dm_mo -r data_one_body_dm_alpha_mo
qp_name data_one_body_beta_dm_mo -r data_one_body_dm_beta_mo
qp_name one_body_dm_alpha_ao_for_dft -r one_e_dm_alpha_ao_for_dft
qp_name one_body_dm_alpha_at_r -r one_e_dm_alpha_at_r
qp_name one_body_dm_ao_alpha -r one_e_dm_ao_alpha
qp_name one_body_dm_ao_beta -r one_e_dm_ao_beta
qp_name one_body_dm_average_mo_for_dft -r one_e_dm_average_mo_for_dft
qp_name one_body_dm_beta_ao_for_dft -r one_e_dm_beta_ao_for_dft
qp_name one_body_dm_beta_at_r -r one_e_dm_beta_at_r
qp_name one_body_dm_dagger_mo_spin_index -r one_e_dm_dagger_mo_spin_index
qp_name one_body_dm_mo -r one_e_dm_mo
qp_name one_body_dm_mo_alpha -r one_e_dm_mo_alpha
qp_name one_body_dm_mo_alpha_average -r one_e_dm_mo_alpha_average
qp_name one_body_dm_mo_alpha_for_dft -r one_e_dm_mo_alpha_for_dft
qp_name one_body_dm_mo_beta -r one_e_dm_mo_beta
qp_name one_body_dm_mo_beta_average -r one_e_dm_mo_beta_average
qp_name one_body_dm_mo_beta_for_dft -r one_e_dm_mo_beta_for_dft
qp_name one_body_dm_mo_diff -r one_e_dm_mo_diff
qp_name one_body_dm_mo_for_dft -r one_e_dm_mo_for_dft
qp_name one_body_dm_mo_spin_index -r one_e_dm_mo_spin_index
qp_name one_body_grad_2_dm_alpha_at_r -r one_e_grad_2_dm_alpha_at_r
qp_name one_body_grad_2_dm_beta_at_r -r one_e_grad_2_dm_beta_at_r
qp_name one_body_spin_density_ao -r one_e_spin_density_ao
qp_name one_body_spin_density_mo -r one_e_spin_density_mo
qp_name one_electron_energy -r one_e_energy
qp_name one_dm_alpha_in_r -r one_e_dm_alpha_in_r
qp_name one_dm_and_grad_alpha_in_r -r one_e_dm_and_grad_alpha_in_r
qp_name one_dm_and_grad_beta_in_r -r one_e_dm_and_grad_beta_in_r
qp_name one_dm_beta_in_r -r one_e_dm_beta_in_r
qp_name ezfio_set_aux_quantities_data_one_body_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_alpha_dm_mo
qp_name ezfio_set_aux_quantities_data_one_body_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_beta_dm_mo
qp_name data_one_body_dm_alpha_mo -r data_one_e_dm_alpha_mo
qp_name data_one_body_dm_beta_mo -r data_one_e_dm_beta_mo
qp_name save_one_body_dm -r save_one_e_dm
qp_name ezfio_set_aux_quantities_data_one_e_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_alpha_mo
qp_name ezfio_set_aux_quantities_data_one_e_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_beta_mo
qp_name two_electron_energy -r two_e_energy

4
TODO
View File

@ -1,3 +1,7 @@
============
Probleme with EMSL
* Mettre le fichier LIB
* Faire que le slave de Hartree-fock est le calcul des integrales AO en parallele

View File

@ -26,6 +26,7 @@
users_guide/excited_states
users_guide/natural_orbitals
users_guide/plugins
users_guide/qp_plugins
users_guide/index
@ -39,6 +40,7 @@
programmers_guide/ezfio
/programmers_guide/plugins
programmers_guide/index
programmers_guide/plugins
.. toctree::

View File

@ -105,13 +105,25 @@ The determinants in |SetDI| will be characterized as **internal**.
Of course, such a procedure can be applied on any state and therefore can allow to treat both ground and excited states.
Approximations to accelerate the selection
------------------------------------------
Stochastic approximations for the selection and the computation of |EPT|
------------------------------------------------------------------------
The simple algorithm would be too slow to make calculations possible. Instead,
we use the 3-class |CIPSI| approximation to accelerate the selection,
:cite:`Evangelisti_1983` where instead of generating all possible |kalpha|,
we only generate a subset which are likely to be selected.
the |QP| uses a stochastic algorithm :cite:`Garniron_2017.2` in order to compute
efficiently the |EPT| and to select on-the-fly the best Slater determinants.
In such a way, the selection step introduces no extra cost with respect to the |EPT| calculation and the |EPT|
itself is unbiased but associated with a statistical error bar rapidly converging.
Deterministic approximations for the selection
----------------------------------------------
The following description was used in a previous version of the |CIPSI| algorithm
which was less efficient. Nonetheless, it introduces the notions of **generator** and **selector** determinants
which are much more general than the |CIPSI| algorithm that targets the |FCI| and can be used to realize virtually
**any kind of CI in a selected way**.
We define **generator** determinants, as determinants of the internal space
from which the |kalpha| are generated.
@ -124,6 +136,11 @@ The default is to use :option:`determinants threshold_generators` = 0.99 for
the generators, and :option:`determinants threshold_selectors` = 0.999 for the
selectors.
This is nothing but the 3-class |CIPSI| approximation to accelerate the selection,
:cite:`Evangelisti_1983` where instead of generating all possible |kalpha|,
we only generate a subset which are likely to be selected.
The computation of |EPT| using a truncated wave function is biased,
so if an accurate estimate of the |FCI| energy is desired, it is preferable
to recompute |EPT| with the hybrid deterministic/stochastic algorithm
@ -147,7 +164,7 @@ a selected |CAS-SD|. And if one add the rule to prevent for doing double
excitations with two holes and two particles outside of the active space, one
obtains a selected |DDCI| method.
All such things can be done very easily when programming the the |qp|.
All such things can be done very easily when programming the |qp|.
-----------------------------------

View File

@ -18,7 +18,7 @@ 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
* `data_one_e_dm_alpha_mo` and `data_one_e_dm_beta_mo` which are the
one-body alpha and beta densities which are necessary read from the EZFIO
folder.
@ -41,12 +41,12 @@ EZFIO parameters
Projected energy computed with the wave function
.. option:: data_one_body_alpha_dm_mo
.. option:: data_one_e_dm_alpha_mo
Alpha one body density matrix on the MO basis computed with the wave function
Alpha one body density matrix on the |MO| basis computed with the wave function
.. option:: data_one_body_beta_dm_mo
.. option:: data_one_e_dm_beta_mo
Beta one body density matrix on the MO basis computed with the wave function
Beta one body density matrix on the |MO| basis computed with the wave function

View File

@ -42,7 +42,45 @@ Subroutines / functions
File: :file:`cis.irp.f`
Configuration Interaction with Single excitations.
Configuration Interaction with Single excitations.
This program takes a reference Slater determinant of ROHF-like occupancy,
and performs all single excitations on top of it, disregarding spatial symmetry and compute the "n_states" lowest eigenstates of that CI matrix. (see :option:`determinants n_states`)
This program can be useful in many cases:
* GROUND STATE CALCULATION: to be sure to have the lowest scf solution, perform an scf (see the :ref:`hartree_fock` module), then a cis,
save the natural orbitals (see :ref:`save_natorb`) and reperform an scf optimization from this MO guess
* EXCITED STATES CALCULATIONS: the lowest excited states are much likely to be dominanted by single-excitations.
Therefore, running a cis will save the "n_states" lowest states within the CIS space
in the EZFIO folder, which can afterward be used as guess wave functions for a further
multi-state fci calculation if you specify "read_wf" = True before running the fci executable.
Also, if you specify "s2_eig" = True, the cis will only retain states having the good value :math:`S^2` value (see expected_s2).
If "s2_eig" = False, it will take the lowest n_states, whatever multiplicity they are.
Note: if you would like to discard some orbitals, use qp_set_mo_class to specify:
* "core" orbitals which will be always doubly occupied
* "act" orbitals where an electron can be either excited from or to
* "del" orbitals which will be never occupied

View File

@ -42,7 +42,43 @@ Subroutines / functions
File: :file:`cisd.irp.f`
Configuration Interaction with Single and Double excitations.
Configuration Interaction with Single and Double excitations.
This program takes a reference Slater determinant of ROHF-like occupancy,
and performs all single and double excitations on top of it, disregarding spatial symmetry and compute the "n_states" lowest eigenstates of that CI matrix.
This program can be useful in many cases:
* GROUND STATE CALCULATION: if even after a cis calculation, natural orbitals and then scf optimization, you are not sure to have the lowest scf solution, do the same strategy with the cisd executable to generate the natural orbitals as a guess for the scf.
* EXCITED STATES CALCULATIONS: the lowest excited states are much likely to be dominanted by single- or double-excitations.
Therefore, running a cis will save the "n_states" lowest states within the CISD space
in the EZFIO folder, which can afterward be used as guess wave functions for a further
multi-state fci calculation if you specify "read_wf" = True before running the fci executable.
Also, if you specify "s2_eig" = True, the cisd will only retain states having the good value :math:`S^2` value (see expected_s2).
If "s2_eig" = False, it will take the lowest n_states, whatever multiplicity they are.
Note: if you would like to discard some orbitals, use qp_set_mo_class to specify:
* "core" orbitals which will be always doubly occupied
* "act" orbitals where an electron can be either excited from or to
* "del" orbitals which will be never occupied

View File

@ -93,6 +93,20 @@ Providers
.. c:var:: one_body_dm_mo_alpha_one_det
.. code:: text
double precision, allocatable :: one_body_dm_mo_alpha_one_det (mo_num,mo_num,N_states)
double precision, allocatable :: one_body_dm_mo_beta_one_det (mo_num,mo_num,N_states)
File: :file:`density_for_dft.irp.f`
One body density matrix on the |MO| basis for a single determinant
.. c:var:: one_body_dm_mo_beta_for_dft
.. code:: text
@ -106,6 +120,20 @@ Providers
.. c:var:: one_body_dm_mo_beta_one_det
.. code:: text
double precision, allocatable :: one_body_dm_mo_alpha_one_det (mo_num,mo_num,N_states)
double precision, allocatable :: one_body_dm_mo_beta_one_det (mo_num,mo_num,N_states)
File: :file:`density_for_dft.irp.f`
One body density matrix on the |MO| basis for a single determinant
.. c:var:: one_body_dm_mo_for_dft
.. code:: text
@ -117,3 +145,83 @@ Providers
.. c:var:: one_e_dm_alpha_ao_for_dft
.. code:: text
double precision, allocatable :: one_e_dm_alpha_ao_for_dft (ao_num,ao_num,N_states)
double precision, allocatable :: one_e_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_e_dm_mo_alpha_for_dft
.. c:var:: one_e_dm_average_mo_for_dft
.. code:: text
double precision, allocatable :: one_e_dm_average_mo_for_dft (mo_num,mo_num)
File: :file:`density_for_dft.irp.f`
.. c:var:: one_e_dm_beta_ao_for_dft
.. code:: text
double precision, allocatable :: one_e_dm_alpha_ao_for_dft (ao_num,ao_num,N_states)
double precision, allocatable :: one_e_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_e_dm_mo_alpha_for_dft
.. c:var:: one_e_dm_mo_alpha_for_dft
.. code:: text
double precision, allocatable :: one_e_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_e_dm_mo_beta_for_dft
.. code:: text
double precision, allocatable :: one_e_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_e_dm_mo_for_dft
.. code:: text
double precision, allocatable :: one_e_dm_mo_for_dft (mo_num,mo_num,N_states)
File: :file:`density_for_dft.irp.f`

View File

@ -199,7 +199,7 @@ Providers
Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function:
||Da||_i \sum_j C_{ij}**2
:math:`||D_\alpha||_i = \sum_j C_{ij}^2`
@ -215,7 +215,7 @@ Providers
Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function:
||Da||_i \sum_j C_{ij}**2
:math:`||D_\alpha||_i = \sum_j C_{ij}^2`
@ -451,7 +451,7 @@ Providers
integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size)
integer :: n_det_alpha_unique
File: :file:`spindeterminants.irp.f_template_143`
File: :file:`spindeterminants.irp.f_template_144`
Unique :math:`\alpha` determinants
@ -465,7 +465,7 @@ Providers
integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size)
integer :: n_det_beta_unique
File: :file:`spindeterminants.irp.f_template_143`
File: :file:`spindeterminants.irp.f_template_144`
Unique :math:`\beta` determinants
@ -740,6 +740,168 @@ Providers
.. c:var:: one_e_dm_ao_alpha
.. code:: text
double precision, allocatable :: one_e_dm_ao_alpha (ao_num,ao_num)
double precision, allocatable :: one_e_dm_ao_beta (ao_num,ao_num)
File: :file:`density_matrix.irp.f`
One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` .
.. c:var:: one_e_dm_ao_beta
.. code:: text
double precision, allocatable :: one_e_dm_ao_alpha (ao_num,ao_num)
double precision, allocatable :: one_e_dm_ao_beta (ao_num,ao_num)
File: :file:`density_matrix.irp.f`
One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` .
.. c:var:: one_e_dm_dagger_mo_spin_index
.. code:: text
double precision, allocatable :: one_e_dm_dagger_mo_spin_index (mo_num,mo_num,N_states,2)
File: :file:`density_matrix.irp.f`
.. c:var:: one_e_dm_mo
.. code:: text
double precision, allocatable :: one_e_dm_mo (mo_num,mo_num)
File: :file:`density_matrix.irp.f`
One-body density matrix
.. c:var:: one_e_dm_mo_alpha
.. code:: text
double precision, allocatable :: one_e_dm_mo_alpha (mo_num,mo_num,N_states)
double precision, allocatable :: one_e_dm_mo_beta (mo_num,mo_num,N_states)
File: :file:`density_matrix.irp.f`
:math:`\alpha` and :math:`\beta` one-body density matrix for each state
.. c:var:: one_e_dm_mo_alpha_average
.. code:: text
double precision, allocatable :: one_e_dm_mo_alpha_average (mo_num,mo_num)
double precision, allocatable :: one_e_dm_mo_beta_average (mo_num,mo_num)
File: :file:`density_matrix.irp.f`
:math:`\alpha` and :math:`\beta` one-body density matrix for each state
.. c:var:: one_e_dm_mo_beta
.. code:: text
double precision, allocatable :: one_e_dm_mo_alpha (mo_num,mo_num,N_states)
double precision, allocatable :: one_e_dm_mo_beta (mo_num,mo_num,N_states)
File: :file:`density_matrix.irp.f`
:math:`\alpha` and :math:`\beta` one-body density matrix for each state
.. c:var:: one_e_dm_mo_beta_average
.. code:: text
double precision, allocatable :: one_e_dm_mo_alpha_average (mo_num,mo_num)
double precision, allocatable :: one_e_dm_mo_beta_average (mo_num,mo_num)
File: :file:`density_matrix.irp.f`
:math:`\alpha` and :math:`\beta` one-body density matrix for each state
.. c:var:: one_e_dm_mo_diff
.. code:: text
double precision, allocatable :: one_e_dm_mo_diff (mo_num,mo_num,2:N_states)
File: :file:`density_matrix.irp.f`
Difference of the one-body density matrix with respect to the ground state
.. c:var:: one_e_dm_mo_spin_index
.. code:: text
double precision, allocatable :: one_e_dm_mo_spin_index (mo_num,mo_num,N_states,2)
File: :file:`density_matrix.irp.f`
.. c:var:: one_e_spin_density_ao
.. code:: text
double precision, allocatable :: one_e_spin_density_ao (ao_num,ao_num)
File: :file:`density_matrix.irp.f`
One body spin density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha) - \rho_{AO}(\beta)`
.. c:var:: one_e_spin_density_mo
.. code:: text
double precision, allocatable :: one_e_spin_density_mo (mo_num,mo_num)
File: :file:`density_matrix.irp.f`
:math:`\rho(\alpha) - \rho(\beta)`
.. c:var:: psi_average_norm_contrib
.. code:: text
@ -797,9 +959,9 @@ Providers
File: :file:`spindeterminants.irp.f`
Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b
Sparse coefficient matrix if the wave function is expressed in a bilinear form : :math:`D_\alpha^\dagger.C.D_\beta`
Rows are :math:`\alpha` determinants and columns are :math:`\beta.`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` .
Order refers to psi_det
@ -818,9 +980,9 @@ Providers
:math:`D_\alpha^\dagger.C.D_\beta`
Rows are :math:`\alpha` determinants and columns are :math:`\beta.`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` .
Order refers to psi_det
Order refers to ``psi_det``
@ -836,9 +998,9 @@ Providers
File: :file:`spindeterminants.irp.f`
Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b
Sparse coefficient matrix if the wave function is expressed in a bilinear form : :math:`D_\alpha^\dagger.C.D_\beta`
Rows are :math:`\alpha` determinants and columns are :math:`\beta.`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` .
Order refers to psi_det
@ -853,7 +1015,7 @@ Providers
File: :file:`spindeterminants.irp.f`
Order which allows to go from psi_bilinear_matrix to psi_det
Order which allows to go from ``psi_bilinear_matrix`` to ``psi_det``
@ -866,7 +1028,7 @@ Providers
File: :file:`spindeterminants.irp.f`
Order which allows to go from psi_bilinear_matrix_order_transp to psi_bilinear_matrix
Order which allows to go from ``psi_bilinear_matrix_order_transp`` to ``psi_bilinear_matrix``
@ -882,9 +1044,9 @@ Providers
File: :file:`spindeterminants.irp.f`
Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b
Sparse coefficient matrix if the wave function is expressed in a bilinear form : :math:`D_\alpha^\dagger.C.D_\beta`
Rows are :math:`\alpha` determinants and columns are :math:`\beta.`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` .
Order refers to psi_det
@ -902,11 +1064,11 @@ Providers
File: :file:`spindeterminants.irp.f`
Transpose of psi_bilinear_matrix
Transpose of ``psi_bilinear_matrix``
:math:`D_\beta^\dagger.C^\dagger.D_\alpha`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format.
@ -922,11 +1084,11 @@ Providers
File: :file:`spindeterminants.irp.f`
Transpose of psi_bilinear_matrix
Transpose of ``psi_bilinear_matrix``
:math:`D_\beta^\dagger.C^\dagger.D_\alpha`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format.
@ -942,11 +1104,11 @@ Providers
File: :file:`spindeterminants.irp.f`
Transpose of psi_bilinear_matrix
Transpose of ``psi_bilinear_matrix``
:math:`D_\beta^\dagger.C^\dagger.D_\alpha`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format.
@ -959,7 +1121,7 @@ Providers
File: :file:`spindeterminants.irp.f`
Location of the columns in the psi_bilinear_matrix
Location of the columns in the ``psi_bilinear_matrix``
@ -975,11 +1137,11 @@ Providers
File: :file:`spindeterminants.irp.f`
Transpose of psi_bilinear_matrix
Transpose of ``psi_bilinear_matrix``
:math:`D_\beta^\dagger.C^\dagger.D_\alpha`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format
Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format.
@ -995,9 +1157,9 @@ Providers
File: :file:`spindeterminants.irp.f`
Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b
Sparse coefficient matrix if the wave function is expressed in a bilinear form : :math:`D_\alpha^\dagger.C.D_\beta`
Rows are :math:`\alpha` determinants and columns are :math:`\beta.`
Rows are :math:`\alpha` determinants and columns are :math:`\beta` .
Order refers to psi_det
@ -1215,7 +1377,7 @@ Providers
integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size)
integer :: n_det_alpha_unique
File: :file:`spindeterminants.irp.f_template_143`
File: :file:`spindeterminants.irp.f_template_144`
Unique :math:`\alpha` determinants
@ -1242,7 +1404,7 @@ Providers
integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size)
integer :: n_det_beta_unique
File: :file:`spindeterminants.irp.f_template_143`
File: :file:`spindeterminants.irp.f_template_144`
Unique :math:`\beta` determinants
@ -1335,7 +1497,7 @@ Providers
psi_energy_h_core = :math:`\langle \Psi | h_{core} |\Psi \rangle`
computed using the :c:data:`one_body_dm_mo_alpha` + :c:data:`one_body_dm_mo_beta` and :c:data:`mo_one_e_integrals`
computed using the :c:data:`one_e_dm_mo_alpha` + :c:data:`one_e_dm_mo_beta` and :c:data:`mo_one_e_integrals`
@ -1624,7 +1786,7 @@ Providers
File: :file:`spindeterminants.irp.f`
Dimension of the singles_alpha array
Dimension of the ``singles_alpha`` array
@ -1638,7 +1800,7 @@ Providers
File: :file:`spindeterminants.irp.f`
Dimension of the singles_alpha array
Dimension of the ``singles_alpha`` array
@ -1651,7 +1813,7 @@ Providers
File: :file:`spindeterminants.irp.f`
Dimension of the singles_alpha array
Dimension of the ``singles_alpha`` array
@ -1929,7 +2091,7 @@ Subroutines / functions
File: :file:`spindeterminants.irp.f`
Overwrites psi_det and psi_coef with the wf in bilinear order
Overwrites ``psi_det`` and ``psi_coef`` with the wave function in bilinear order
@ -1985,7 +2147,7 @@ Subroutines / functions
File: :file:`spindeterminants.irp.f`
Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants
Generates a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants
@ -2289,7 +2451,7 @@ Subroutines / functions
File: :file:`spindeterminants.irp.f`
Create a wave function from all possible :math:`\alpha \times \beta` determinants
Creates a wave function from all possible :math:`\alpha \times \beta` determinants
@ -2337,7 +2499,7 @@ Subroutines / functions
subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2355,7 +2517,7 @@ Subroutines / functions
subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2373,7 +2535,7 @@ Subroutines / functions
subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2391,7 +2553,7 @@ Subroutines / functions
subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2445,7 +2607,7 @@ Subroutines / functions
subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2463,7 +2625,7 @@ Subroutines / functions
subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2481,7 +2643,7 @@ Subroutines / functions
subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2505,7 +2667,7 @@ Subroutines / functions
Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants.
/!\ : The buffer is transposed !
Warning: The buffer is transposed.
@ -2539,7 +2701,7 @@ Subroutines / functions
subroutine get_all_spin_singles_and_doubles_2(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2559,7 +2721,7 @@ Subroutines / functions
subroutine get_all_spin_singles_and_doubles_3(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2579,7 +2741,7 @@ Subroutines / functions
subroutine get_all_spin_singles_and_doubles_4(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2599,7 +2761,7 @@ Subroutines / functions
subroutine get_all_spin_singles_and_doubles_N_int(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -2619,7 +2781,7 @@ Subroutines / functions
subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles)
File: :file:`spindeterminants.irp.f_template_1221`
File: :file:`spindeterminants.irp.f_template_1223`
@ -3573,7 +3735,7 @@ Subroutines / functions
File: :file:`spindeterminants.irp.f`
Return an integer(8) corresponding to a determinant index for searching
Returns an integer(8) corresponding to a determinant index for searching

View File

@ -16,7 +16,7 @@ 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.
* `one_e_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points.
@ -31,6 +31,7 @@ Providers
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)
double precision, allocatable :: aos_grad_in_r_array_transp_xyz (3,n_points_final_grid,ao_num)
File: :file:`ao_in_r.irp.f`
@ -49,6 +50,26 @@ Providers
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)
double precision, allocatable :: aos_grad_in_r_array_transp_xyz (3,n_points_final_grid,ao_num)
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_xyz
.. 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)
double precision, allocatable :: aos_grad_in_r_array_transp_xyz (3,n_points_final_grid,ao_num)
File: :file:`ao_in_r.irp.f`
@ -315,6 +336,126 @@ Providers
.. c:var:: one_e_dm_alpha_at_r
.. code:: text
double precision, allocatable :: one_e_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_e_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_e_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_e_dm_alpha_in_r
.. code:: text
double precision, allocatable :: one_e_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states)
double precision, allocatable :: one_e_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_e_dm_and_grad_alpha_in_r
.. code:: text
double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_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_e_dm_and_grad_beta_in_r
.. code:: text
double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_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_e_dm_beta_at_r
.. code:: text
double precision, allocatable :: one_e_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_e_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_e_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_e_dm_beta_in_r
.. code:: text
double precision, allocatable :: one_e_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states)
double precision, allocatable :: one_e_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_e_grad_2_dm_alpha_at_r
.. code:: text
double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_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_e_grad_2_dm_beta_at_r
.. code:: text
double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states)
double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states)
File: :file:`dm_in_r.irp.f`
one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_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
Subroutines / functions
-----------------------

View File

@ -1344,7 +1344,7 @@ Providers
File: :file:`one_e_energy_dft.irp.f`
kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft
kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft
@ -1359,7 +1359,7 @@ Providers
File: :file:`one_e_energy_dft.irp.f`
kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft
kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft
@ -1374,7 +1374,7 @@ Providers
File: :file:`one_e_energy_dft.irp.f`
kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft
kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft

View File

@ -66,7 +66,45 @@ Subroutines / functions
File: :file:`fci.irp.f`
Selected Full Configuration Interaction with stochastic selection and PT2.
Selected Full Configuration Interaction with stochastic selection and PT2.
This program performs a CIPSI-like selected CI using a stochastic scheme for both
the selection of the important Slater determinants and the computation of the PT2 correction.
This CIPSI-like algorithm will be performed for the "n_states" lowest states of the variational space (see :option:`determinants n_det_max`)
The fci program will stop when reaching at least one the two following conditions:
* number of Slater determinant > "n_det_max" (see :option:`determinants n_det_max`)
* |PT2| < "pt2_max" (see :option:`perturbation pt2_max`)
The following other options can be of interest:
If "read_wf" = False, it starts with a ROHF-like Slater determinant as a guess wave function.
If "read_wf" = True , it starts with the wave function(s) stored in the EZFIO folder as guess wave function(s).
(see :option:`determinants read_wf`)
If "s2_eig" = True, it will systematically add all necessary Slater determinants in order
to have a pure spin wave function with an :math:`S^2` value corresponding to "expected_s2".
(see :option:`determinants s2_eig` and :option:`determinants expected_s2`)
For excited states calculations, it is recommended to start with a cis or cisd guess wave functions
for the "n_states", and to set "s2_eig" = True.
@ -80,7 +118,13 @@ Subroutines / functions
File: :file:`pt2.irp.f`
Second order perturbative correction to the wave function contained in the EZFIO directory.
Second order perturbative correction to the wave function contained in the EZFIO directory.
This programs runs the stochastic PT2 correction on all "n_states" wave function stored in the EZFIO folder (see :option:`determinant n_states`).
The option for the PT2 correction are the "pt2_relative_error" which is the relative stochastic
error on the PT2 to reach before stopping the stochastic sampling. (see :option:`perturbation pt2_relative_error`)

View File

@ -57,8 +57,8 @@ Providers
.. code:: text
double precision :: ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: two_e_energy
double precision :: one_e_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc

View File

@ -147,8 +147,25 @@ Providers
.. code:: text
double precision :: rs_ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: two_e_energy
double precision :: one_e_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_e_energy
.. code:: text
double precision :: rs_ks_energy
double precision :: two_e_energy
double precision :: one_e_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
@ -181,8 +198,8 @@ Providers
.. code:: text
double precision :: rs_ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: two_e_energy
double precision :: one_e_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc
@ -198,8 +215,25 @@ Providers
.. code:: text
double precision :: rs_ks_energy
double precision :: two_electron_energy
double precision :: one_electron_energy
double precision :: two_e_energy
double precision :: one_e_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_e_energy
.. code:: text
double precision :: rs_ks_energy
double precision :: two_e_energy
double precision :: one_e_energy
double precision :: fock_matrix_energy
double precision :: trace_potential_xc

View File

@ -268,7 +268,21 @@ Subroutines / functions
Transform A from the MO basis to the AO basis
(S.C).A_mo.(S.C)t
:math:`(S.C).A_{mo}.(S.C)^\dagger`
.. c:function:: mo_to_ao_no_overlap
.. code:: text
subroutine mo_to_ao_no_overlap(A_mo,LDA_mo,A_ao,LDA_ao)
File: :file:`ao_to_mo.irp.f`
:math:`C.A_{mo}.C^\dagger`

View File

@ -25,7 +25,7 @@ Subroutines / functions
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
program that extracts the `n_states` lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder
@ -39,7 +39,17 @@ Subroutines / functions
File: :file:`fcidump.irp.f`
Produce a FCIDUMP file
Produce a regular FCIDUMP file from the MOs stored in the EZFIO folder.
To specify an active space, the class of the mos have to set in the EZFIO folder (see set_mo_class/qp_set_mo_class).
The fcidump program supports 3 types of MO_class :
* the "core" orbitals which are always doubly occupied in the calculation
* the "del" orbitals that are never occupied in the calculation
* the "act" orbitals that will be occupied by a varying number of electrons
@ -53,7 +63,11 @@ Subroutines / functions
File: :file:`four_idx_transform.irp.f`
4-index transformation of two-electron integrals from AO to MO integrals
4-index transformation of two-electron integrals from AO to MO integrals.
This program will compute the two-electron integrals on the MO basis and store it into the EZFIO folder.
This program can be useful if the AO --> MO transformation is an expensive step by itself.
@ -81,7 +95,13 @@ Subroutines / functions
File: :file:`print_e_conv.irp.f`
program that prints in a human readable format the convergence of the CIPSI algorithm
program that prints in a human readable format the convergence of the CIPSI algorithm.
for all istate, this program produces
* a file "EZFIO.istate.conv" containing the variational and var+PT2 energies as a function of N_det
* for istate > 1, a file EZFIO.istate.delta_e.conv containing the energy difference (both var and var+PT2) with the ground state as a function of N_det
@ -95,7 +115,7 @@ Subroutines / functions
File: :file:`print_wf.irp.f`
print the wave function stored in the EZFIO folder in the intermediate normalization
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
@ -129,7 +149,15 @@ Subroutines / functions
File: :file:`save_natorb.irp.f`
Save natural MOs into the EZFIO
Save natural MOs into the EZFIO
This program reads the wave function stored in the EZFIO folder,
extracts the corresponding natural orbitals and set them as the new MOs
If this is a multi-state calculation, the density matrix that produces the natural orbitals
is obtained from a state-averaged of the density matrices of each state with the corresponding state_average_weight (see the doc of state_average_weight).
@ -153,6 +181,24 @@ Subroutines / functions
.. c:function:: save_one_e_dm
.. code:: text
subroutine save_one_e_dm
File: :file:`save_one_e_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_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read this density in a further calculation.
This can be used to perform damping on the density in RS-DFT calculation (see the density_for_dft module).
.. c:function:: save_ortho_mos
.. code:: text
@ -161,7 +207,13 @@ Subroutines / functions
File: :file:`save_ortho_mos.irp.f`
Save orthonormalized MOs in the EZFIO.
Save orthonormalized MOs in the EZFIO.
This program reads the current MOs, computes the corresponding overlap matrix in the MO basis
and perform a Lowdin orthonormalization : :math:`MO_{new} = S^{-1/2} MO_{guess}`.
Thanks to the Lowdin orthonormalization, the new MOs are the most similar to the guess MOs.
@ -203,7 +255,7 @@ Subroutines / functions
File: :file:`write_integrals_erf.irp.f`
Saves the two-electron erf integrals into the EZFIO
Saves the two-electron integrals with the :math:`erf(\mu r_{12})/r_{12}` oprerator into the EZFIO folder

View File

@ -92,6 +92,7 @@ Index of Providers
* :c:data:`aos_dvx_beta_pbe_w`
* :c:data:`aos_grad_in_r_array`
* :c:data:`aos_grad_in_r_array_transp`
* :c:data:`aos_grad_in_r_array_transp_xyz`
* :c:data:`aos_in_r_array`
* :c:data:`aos_in_r_array_transp`
* :c:data:`aos_lapl_in_r_array`
@ -152,6 +153,8 @@ Index of Providers
* :c:data:`data_energy_var`
* :c:data:`data_one_body_alpha_dm_mo`
* :c:data:`data_one_body_beta_dm_mo`
* :c:data:`data_one_e_dm_alpha_mo`
* :c:data:`data_one_e_dm_beta_mo`
* :c:data:`davidson_criterion`
* :c:data:`davidson_sze_max`
* :c:data:`degree_max_generators`
@ -470,9 +473,11 @@ Index of Providers
* :c:data:`one_body_dm_mo_alpha`
* :c:data:`one_body_dm_mo_alpha_average`
* :c:data:`one_body_dm_mo_alpha_for_dft`
* :c:data:`one_body_dm_mo_alpha_one_det`
* :c:data:`one_body_dm_mo_beta`
* :c:data:`one_body_dm_mo_beta_average`
* :c:data:`one_body_dm_mo_beta_for_dft`
* :c:data:`one_body_dm_mo_beta_one_det`
* :c:data:`one_body_dm_mo_diff`
* :c:data:`one_body_dm_mo_for_dft`
* :c:data:`one_body_dm_mo_spin_index`
@ -486,6 +491,33 @@ Index of Providers
* :c:data:`one_dm_and_grad_alpha_in_r`
* :c:data:`one_dm_and_grad_beta_in_r`
* :c:data:`one_dm_beta_in_r`
* :c:data:`one_e_dm_alpha_ao_for_dft`
* :c:data:`one_e_dm_alpha_at_r`
* :c:data:`one_e_dm_alpha_in_r`
* :c:data:`one_e_dm_and_grad_alpha_in_r`
* :c:data:`one_e_dm_and_grad_beta_in_r`
* :c:data:`one_e_dm_ao_alpha`
* :c:data:`one_e_dm_ao_beta`
* :c:data:`one_e_dm_average_mo_for_dft`
* :c:data:`one_e_dm_beta_ao_for_dft`
* :c:data:`one_e_dm_beta_at_r`
* :c:data:`one_e_dm_beta_in_r`
* :c:data:`one_e_dm_dagger_mo_spin_index`
* :c:data:`one_e_dm_mo`
* :c:data:`one_e_dm_mo_alpha`
* :c:data:`one_e_dm_mo_alpha_average`
* :c:data:`one_e_dm_mo_alpha_for_dft`
* :c:data:`one_e_dm_mo_beta`
* :c:data:`one_e_dm_mo_beta_average`
* :c:data:`one_e_dm_mo_beta_for_dft`
* :c:data:`one_e_dm_mo_diff`
* :c:data:`one_e_dm_mo_for_dft`
* :c:data:`one_e_dm_mo_spin_index`
* :c:data:`one_e_energy`
* :c:data:`one_e_grad_2_dm_alpha_at_r`
* :c:data:`one_e_grad_2_dm_beta_at_r`
* :c:data:`one_e_spin_density_ao`
* :c:data:`one_e_spin_density_mo`
* :c:data:`one_electron_energy`
* :c:data:`only_expected_s2`
* :c:data:`output_cpu_time_0`
@ -695,6 +727,7 @@ Index of Providers
* :c:data:`trace_v_hxc`
* :c:data:`trace_v_xc`
* :c:data:`transpose`
* :c:data:`two_e_energy`
* :c:data:`two_electron_energy`
* :c:data:`unpaired_alpha_electrons`
* :c:data:`used_weight`
@ -1112,6 +1145,7 @@ Index of Subroutines/Functions
* :c:func:`mo_as_svd_vectors_of_mo_matrix`
* :c:func:`mo_as_svd_vectors_of_mo_matrix_eig`
* :c:func:`mo_to_ao`
* :c:func:`mo_to_ao_no_overlap`
* :c:func:`mo_two_e_integral`
* :c:func:`mo_two_e_integral_erf`
* :c:func:`mo_two_e_integrals_erf_index`
@ -1256,6 +1290,7 @@ Index of Subroutines/Functions
* :c:func:`save_natorb`
* :c:func:`save_natural_mos`
* :c:func:`save_one_body_dm`
* :c:func:`save_one_e_dm`
* :c:func:`save_ortho_mos`
* :c:func:`save_ref_determinant`
* :c:func:`save_wavefunction`

View File

@ -5,6 +5,8 @@ configure
.. program:: configure
Program that can either configure the compilations options and download/install external dependencies (see the installation description).
Usage
-----

View File

@ -7,7 +7,7 @@ Working with external plugins
plugins need to be downloaded and installed in the ``$QP_ROOT/plugins``
directory.
Plugins are usually hosted in external repositories. To dowload a plugin,
Plugins are usually hosted in external repositories. To download a plugin,
the remote repository needs to be downloaded, and the plugins of the
repository can be selected for installation.
@ -47,5 +47,5 @@ To remove the module, run
qp_plugins uninstall ext_module
For a more detailed explanation and an example, see :ref:`qp_plugins`.

View File

@ -6,7 +6,7 @@ qp_plugins
.. program:: qp_plugins
This command deals with all external plugings of |qp|. Plugin repositories can
This command deals with all external plugins of |qp|. Plugin repositories can
be downloaded, and the plugins in these repositories can be
installed/uninstalled of created.
@ -62,3 +62,49 @@ Usage
Specify in which repository the new plugin will be created.
Example
-------
Let us download, install and compile some specific external plugins from `<https://gitlab.com/eginer/qp_plugins_eginer>`_ .
First, download the git repo associated to these plugins. To do so, first go to the `plugins` directory in the |QP| and execute:
.. code:: bash
qp_plugins download https://gitlab.com/eginer/qp_plugins_eginer
This will create in the directory `plugins` a local copy of the git repo located at the URL you indicated.
Then, go in `qp_plugins_eginer/stable/`
.. code:: bash
cd qp_plugins_eginer/stable/
In the directory `stable`, there are many directories which all correspond to a specific plugin that have been developed
by the person in charge of the git repo. All these plugins might use some global variables and routines contained
in the core modules of the |QP|.
Now let us install the plugin `rsdft_cipsi`:
.. code:: bash
qp_plugins install rsdft_cipsi
This will link this directory to the |QP| which means that when the code will be compiled, this plugin will be compiled to and therefore
all the executables/scripts/input keywords contained in this module will be available as if there were part of the core of the |QP|.
Then, to compile the new plugin, just recompile the |QP| as usual by going at the root of the |QP| directory:
.. code:: bash
cd $QP_ROOT
ninja
Then, if you go back to the plugin directory you just installed, you should see all the executables/scripts which have been created and
which are now available with the `qp_run` command.

View File

@ -30,6 +30,8 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
Program that can either configure the compilations options and download/install external dependencies (see the installation description).
.SH USAGE
.INDENT 0.0
.INDENT 3.5

View File

@ -35,7 +35,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
plugins need to be downloaded and installed in the \fB$QP_ROOT/plugins\fP
directory.
.sp
Plugins are usually hosted in external repositories. To dowload a plugin,
Plugins are usually hosted in external repositories. To download a plugin,
the remote repository needs to be downloaded, and the plugins of the
repository can be selected for installation.
.sp
@ -93,6 +93,8 @@ qp_plugins uninstall ext_module
.fi
.UNINDENT
.UNINDENT
.sp
For a more detailed explanation and an example, see qp_plugins\&.
.SH AUTHOR
A. Scemama, E. Giner
.SH COPYRIGHT

View File

@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
This command deals with all external plugings of \fIQuantum Package\fP\&. Plugin repositories can
This command deals with all external plugins of \fIQuantum Package\fP\&. Plugin repositories can
be downloaded, and the plugins in these repositories can be
installed/uninstalled of created.
.SH USAGE
@ -101,6 +101,69 @@ Create a new plugin named \fBplugin_name\fP (in local repository by default).
.B \-r <repository>
Specify in which repository the new plugin will be created.
.UNINDENT
.SH EXAMPLE
.sp
Let us download, install and compile some specific external plugins from \fI\%https://gitlab.com/eginer/qp_plugins_eginer\fP .
.sp
First, download the git repo associated to these plugins. To do so, first go to the \fIplugins\fP directory in the \fIQuantum Package\fP and execute:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
qp_plugins download https://gitlab.com/eginer/qp_plugins_eginer
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This will create in the directory \fIplugins\fP a local copy of the git repo located at the URL you indicated.
Then, go in \fIqp_plugins_eginer/stable/\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cd qp_plugins_eginer/stable/
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In the directory \fIstable\fP, there are many directories which all correspond to a specific plugin that have been developed
by the person in charge of the git repo. All these plugins might use some global variables and routines contained
in the core modules of the \fIQuantum Package\fP\&.
.sp
Now let us install the plugin \fIrsdft_cipsi\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
qp_plugins install rsdft_cipsi
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This will link this directory to the \fIQuantum Package\fP which means that when the code will be compiled, this plugin will be compiled to and therefore
all the executables/scripts/input keywords contained in this module will be available as if there were part of the core of the \fIQuantum Package\fP\&.
.sp
Then, to compile the new plugin, just recompile the \fIQuantum Package\fP as usual by going at the root of the \fIQuantum Package\fP directory:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cd $QP_ROOT
ninja
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Then, if you go back to the plugin directory you just installed, you should see all the executables/scripts which have been created and
which are now available with the \fIqp_run\fP command.
.SH AUTHOR
A. Scemama, E. Giner
.SH COPYRIGHT

View File

@ -90,6 +90,8 @@ def main(arguments):
f.write(f_new)
print "Done"
with open( os.path.join(QP_ROOT,"REPLACE"), 'a') as f:
print >>f, "qp_name "+" ".join(sys.argv[1:])

View File

@ -10,16 +10,16 @@ doc: Projected energy computed with the wave function
interface: ezfio, provider
size: (determinants.n_states)
[data_one_body_alpha_dm_mo]
[data_one_e_dm_alpha_mo]
interface: ezfio, provider
doc: Alpha one body density matrix on the MO basis computed with the wave function
doc: Alpha one body density matrix on the |MO| basis computed with the wave function
type: double precision
size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states)
[data_one_body_beta_dm_mo]
[data_one_e_dm_beta_mo]
interface: ezfio, provider
doc: Beta one body density matrix on the MO basis computed with the wave function
doc: Beta one body density matrix on the |MO| basis computed with the wave function
type: double precision
size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states)

View File

@ -12,7 +12,7 @@ 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
* `data_one_e_dm_alpha_mo` and `data_one_e_dm_beta_mo` which are the
one-body alpha and beta densities which are necessary read from the EZFIO
folder.

View File

@ -2,6 +2,41 @@ program cis
implicit none
BEGIN_DOC
! Configuration Interaction with Single excitations.
!
! This program takes a reference Slater determinant of ROHF-like occupancy,
!
! and performs all single excitations on top of it, disregarding spatial symmetry and compute the "n_states" lowest eigenstates of that CI matrix. (see :option:`determinants n_states`)
!
! This program can be useful in many cases:
!
! * GROUND STATE CALCULATION: to be sure to have the lowest scf solution, perform an scf (see the :ref:`hartree_fock` module), then a cis,
!
! save the natural orbitals (see :ref:`save_natorb`) and reperform an scf optimization from this MO guess
!
!
!
! * EXCITED STATES CALCULATIONS: the lowest excited states are much likely to be dominanted by single-excitations.
!
! Therefore, running a cis will save the "n_states" lowest states within the CIS space
!
! in the EZFIO folder, which can afterward be used as guess wave functions for a further
!
! multi-state fci calculation if you specify "read_wf" = True before running the fci executable.
!
! Also, if you specify "s2_eig" = True, the cis will only retain states having the good value :math:`S^2` value (see expected_s2).
!
! If "s2_eig" = False, it will take the lowest n_states, whatever multiplicity they are.
!
!
!
! Note: if you would like to discard some orbitals, use qp_set_mo_class to specify:
!
! * "core" orbitals which will be always doubly occupied
!
! * "act" orbitals where an electron can be either excited from or to
!
! * "del" orbitals which will be never occupied
END_DOC
read_wf = .False.
SOFT_TOUCH read_wf

View File

@ -2,6 +2,41 @@ program cisd
implicit none
BEGIN_DOC
! Configuration Interaction with Single and Double excitations.
!
! This program takes a reference Slater determinant of ROHF-like occupancy,
!
! and performs all single and double excitations on top of it, disregarding spatial symmetry and compute the "n_states" lowest eigenstates of that CI matrix.
!
! This program can be useful in many cases:
!
! * GROUND STATE CALCULATION: if even after a cis calculation, natural orbitals and then scf optimization, you are not sure to have the lowest scf solution,
! do the same strategy with the cisd executable to generate the natural orbitals as a guess for the scf.
!
!
!
! * EXCITED STATES CALCULATIONS: the lowest excited states are much likely to be dominanted by single- or double-excitations.
!
! Therefore, running a cis will save the "n_states" lowest states within the CISD space
!
! in the EZFIO folder, which can afterward be used as guess wave functions for a further
!
! multi-state fci calculation if you specify "read_wf" = True before running the fci executable.
!
! Also, if you specify "s2_eig" = True, the cisd will only retain states having the good value :math:`S^2` value (see expected_s2).
!
! If "s2_eig" = False, it will take the lowest n_states, whatever multiplicity they are.
!
!
!
! Note: if you would like to discard some orbitals, use qp_set_mo_class to specify:
!
! * "core" orbitals which will be always doubly occupied
!
! * "act" orbitals where an electron can be either excited from or to
!
! * "del" orbitals which will be never occupied
END_DOC
read_wf = .False.
SOFT_TOUCH read_wf

View File

@ -1,77 +1,95 @@
BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_num,mo_num, N_states)]
BEGIN_PROVIDER [double precision, one_e_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_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
delta_alpha = one_e_dm_mo_alpha - data_one_e_dm_alpha_mo
one_e_dm_mo_alpha_for_dft = data_one_e_dm_alpha_mo + damping_for_rs_dft * delta_alpha
else if (density_for_dft .EQ. "input_density")then
one_body_dm_mo_alpha_for_dft = data_one_body_alpha_dm_mo
one_e_dm_mo_alpha_for_dft = data_one_e_dm_alpha_mo
else if (density_for_dft .EQ. "WFT")then
provide mo_coef
one_body_dm_mo_alpha_for_dft = one_body_dm_mo_alpha
one_e_dm_mo_alpha_for_dft = one_e_dm_mo_alpha
else if (density_for_dft .EQ. "KS")then
provide mo_coef
one_e_dm_mo_alpha_for_dft = one_body_dm_mo_alpha_one_det
endif
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_num,mo_num, N_states)]
BEGIN_PROVIDER [double precision, one_e_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_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
delta_beta = one_e_dm_mo_beta - data_one_e_dm_beta_mo
one_e_dm_mo_beta_for_dft = data_one_e_dm_beta_mo + damping_for_rs_dft * delta_beta
else if (density_for_dft .EQ. "input_density")then
one_body_dm_mo_beta_for_dft = data_one_body_beta_dm_mo
one_e_dm_mo_beta_for_dft = data_one_e_dm_beta_mo
else if (density_for_dft .EQ. "WFT")then
provide mo_coef
one_body_dm_mo_beta_for_dft = one_body_dm_mo_beta
one_e_dm_mo_beta_for_dft = one_e_dm_mo_beta
else if (density_for_dft .EQ. "KS")then
provide mo_coef
one_e_dm_mo_beta_for_dft = one_body_dm_mo_beta_one_det
endif
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_mo_for_dft, (mo_num,mo_num, N_states)]
BEGIN_PROVIDER [double precision, one_e_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
one_e_dm_mo_for_dft = one_e_dm_mo_beta_for_dft + one_e_dm_mo_alpha_for_dft
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_average_mo_for_dft, (mo_num,mo_num)]
BEGIN_PROVIDER [double precision, one_e_dm_average_mo_for_dft, (mo_num,mo_num)]
implicit none
integer :: i
one_body_dm_average_mo_for_dft = 0.d0
one_e_dm_average_mo_for_dft = 0.d0
do i = 1, N_states
one_body_dm_average_mo_for_dft(:,:) += one_body_dm_mo_for_dft(:,:,i) * state_average_weight(i)
one_e_dm_average_mo_for_dft(:,:) += one_e_dm_mo_for_dft(:,:,i) * state_average_weight(i)
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_alpha_ao_for_dft, (ao_num,ao_num,N_states) ]
&BEGIN_PROVIDER [ double precision, one_body_dm_beta_ao_for_dft, (ao_num,ao_num,N_states) ]
BEGIN_PROVIDER [ double precision, one_e_dm_alpha_ao_for_dft, (ao_num,ao_num,N_states) ]
&BEGIN_PROVIDER [ double precision, one_e_dm_beta_ao_for_dft, (ao_num,ao_num,N_states) ]
BEGIN_DOC
! one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft
! one body density matrix on the AO basis based on one_e_dm_mo_alpha_for_dft
END_DOC
implicit none
integer :: i,j,k,l,istate
integer :: istate
double precision :: mo_alpha,mo_beta
one_body_dm_alpha_ao_for_dft = 0.d0
one_body_dm_beta_ao_for_dft = 0.d0
do k = 1, ao_num
do l = 1, ao_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)
one_body_dm_alpha_ao_for_dft(l,k,istate) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha
one_body_dm_beta_ao_for_dft(l,k,istate) += mo_coef(k,i) * mo_coef(l,j) * mo_beta
enddo
enddo
enddo
enddo
one_e_dm_alpha_ao_for_dft = 0.d0
one_e_dm_beta_ao_for_dft = 0.d0
do istate = 1, N_states
call mo_to_ao_no_overlap( one_e_dm_mo_alpha_for_dft(1,1,istate), &
size(one_e_dm_mo_alpha_for_dft,1), &
one_e_dm_alpha_ao_for_dft(1,1,istate), &
size(one_e_dm_alpha_ao_for_dft,1) )
call mo_to_ao_no_overlap( one_e_dm_mo_beta_for_dft(1,1,istate), &
size(one_e_dm_mo_beta_for_dft,1), &
one_e_dm_beta_ao_for_dft(1,1,istate), &
size(one_e_dm_beta_ao_for_dft,1) )
enddo
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_one_det, (mo_num,mo_num, N_states)]
&BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_one_det, (mo_num,mo_num, N_states)]
implicit none
BEGIN_DOC
! One body density matrix on the |MO| basis for a single determinant
END_DOC
integer :: i
one_body_dm_mo_alpha_one_det = 0.d0
one_body_dm_mo_beta_one_det = 0.d0
do i =1, elec_alpha_num
one_body_dm_mo_alpha_one_det(i,i, 1:N_states) = 1.d0
enddo
do i =1, elec_beta_num
one_body_dm_mo_beta_one_det(i,i, 1:N_states) = 1.d0
enddo
END_PROVIDER

View File

@ -1,19 +1,19 @@
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) ]
BEGIN_PROVIDER [ double precision, one_e_dm_mo_alpha_average, (mo_num,mo_num) ]
&BEGIN_PROVIDER [ double precision, one_e_dm_mo_beta_average, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! $\alpha$ and $\beta$ one-body density matrix for each state
END_DOC
integer :: i
one_body_dm_mo_alpha_average = 0.d0
one_body_dm_mo_beta_average = 0.d0
one_e_dm_mo_alpha_average = 0.d0
one_e_dm_mo_beta_average = 0.d0
do i = 1,N_states
one_body_dm_mo_alpha_average(:,:) += one_body_dm_mo_alpha(:,:,i) * state_average_weight(i)
one_body_dm_mo_beta_average(:,:) += one_body_dm_mo_beta(:,:,i) * state_average_weight(i)
one_e_dm_mo_alpha_average(:,:) += one_e_dm_mo_alpha(:,:,i) * state_average_weight(i)
one_e_dm_mo_beta_average(:,:) += one_e_dm_mo_beta(:,:,i) * state_average_weight(i)
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_states) ]
BEGIN_PROVIDER [ double precision, one_e_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
@ -23,9 +23,9 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_state
do istate=2,N_states
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)
one_e_dm_mo_diff(i,j,istate) = &
one_e_dm_mo_alpha(i,j,istate) - one_e_dm_mo_alpha(i,j,1) +&
one_e_dm_mo_beta (i,j,istate) - one_e_dm_mo_beta (i,j,1)
enddo
enddo
enddo
@ -33,14 +33,14 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_state
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_states,2) ]
BEGIN_PROVIDER [ double precision, one_e_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_num
do i = 1, mo_num
one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_alpha(i,j,istate)
one_e_dm_mo_spin_index(i,j,istate,ispin) = one_e_dm_mo_alpha(i,j,istate)
enddo
enddo
enddo
@ -49,7 +49,7 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_s
do istate = 1, N_states
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)
one_e_dm_mo_spin_index(i,j,istate,ispin) = one_e_dm_mo_beta(i,j,istate)
enddo
enddo
enddo
@ -57,16 +57,16 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_s
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_num,mo_num,N_states,2) ]
BEGIN_PROVIDER [ double precision, one_e_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_num
one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_alpha(j,j,istate)
one_e_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_e_dm_mo_alpha(j,j,istate)
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)
one_e_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_e_dm_mo_alpha(i,j,istate)
one_e_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_e_dm_mo_alpha(i,j,istate)
enddo
enddo
enddo
@ -74,18 +74,18 @@ BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_num,mo_
ispin = 2
do istate = 1, N_states
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)
one_e_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_e_dm_mo_beta(j,j,istate)
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)
one_e_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_e_dm_mo_beta(i,j,istate)
one_e_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_e_dm_mo_beta(i,j,istate)
enddo
enddo
enddo
END_PROVIDER
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) ]
BEGIN_PROVIDER [ double precision, one_e_dm_mo_alpha, (mo_num,mo_num,N_states) ]
&BEGIN_PROVIDER [ double precision, one_e_dm_mo_beta, (mo_num,mo_num,N_states) ]
implicit none
BEGIN_DOC
! $\alpha$ and $\beta$ one-body density matrix for each state
@ -103,13 +103,13 @@ END_PROVIDER
PROVIDE psi_det
one_body_dm_mo_alpha = 0.d0
one_body_dm_mo_beta = 0.d0
one_e_dm_mo_alpha = 0.d0
one_e_dm_mo_beta = 0.d0
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP PRIVATE(j,k,k_a,k_b,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc,&
!$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 elec_beta_num,one_e_dm_mo_alpha,one_e_dm_mo_beta,N_det,&
!$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,&
@ -168,7 +168,7 @@ END_PROVIDER
!$OMP END DO NOWAIT
!$OMP CRITICAL
one_body_dm_mo_alpha(:,:,:) = one_body_dm_mo_alpha(:,:,:) + tmp_a(:,:,:)
one_e_dm_mo_alpha(:,:,:) = one_e_dm_mo_alpha(:,:,:) + tmp_a(:,:,:)
!$OMP END CRITICAL
deallocate(tmp_a)
@ -223,7 +223,7 @@ END_PROVIDER
enddo
!$OMP END DO NOWAIT
!$OMP CRITICAL
one_body_dm_mo_beta(:,:,:) = one_body_dm_mo_beta(:,:,:) + tmp_b(:,:,:)
one_e_dm_mo_beta(:,:,:) = one_e_dm_mo_beta(:,:,:) + tmp_b(:,:,:)
!$OMP END CRITICAL
deallocate(tmp_b)
@ -231,103 +231,20 @@ END_PROVIDER
END_PROVIDER
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
END_DOC
integer :: j,k,l,m
integer :: occ(N_int*bit_kind_size,2)
double precision :: ck, cl, ckl
double precision :: phase
integer :: h1,h2,p1,p2,s1,s2, degree
integer :: exc(0:2,2,2),n_occ_alpha
double precision, allocatable :: tmp_a(:,:), tmp_b(:,:)
integer :: degree_respect_to_HF_k
integer :: degree_respect_to_HF_l
PROVIDE elec_alpha_num elec_beta_num
one_body_single_double_dm_mo_alpha = 0.d0
one_body_single_double_dm_mo_beta = 0.d0
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP PRIVATE(j,k,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc,&
!$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_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)
do k=1,N_det
call bitstring_to_list(psi_det(1,1,k), occ(1,1), n_occ_alpha, N_int)
call bitstring_to_list(psi_det(1,2,k), occ(1,2), n_occ_alpha, N_int)
call get_excitation_degree(ref_bitmask,psi_det(1,1,k),degree_respect_to_HF_k,N_int)
do m=1,N_states
ck = psi_coef(k,m)*psi_coef(k,m) * state_average_weight(m)
call get_excitation_degree(ref_bitmask,psi_det(1,1,k),degree_respect_to_HF_l,N_int)
if(degree_respect_to_HF_l.le.0)then
do l=1,elec_alpha_num
j = occ(l,1)
tmp_a(j,j) += ck
enddo
do l=1,elec_beta_num
j = occ(l,2)
tmp_b(j,j) += ck
enddo
endif
enddo
do l=1,k-1
call get_excitation_degree(ref_bitmask,psi_det(1,1,l),degree_respect_to_HF_l,N_int)
if(degree_respect_to_HF_k.ne.0)cycle
if(degree_respect_to_HF_l.eq.2.and.degree_respect_to_HF_k.ne.2)cycle
call get_excitation_degree(psi_det(1,1,k),psi_det(1,1,l),degree,N_int)
if (degree /= 1) then
cycle
endif
call get_mono_excitation(psi_det(1,1,k),psi_det(1,1,l),exc,phase,N_int)
call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2)
do m=1,N_states
ckl = psi_coef(k,m) * psi_coef(l,m) * phase * state_average_weight(m)
if (s1==1) then
tmp_a(h1,p1) += ckl
tmp_a(p1,h1) += ckl
else
tmp_b(h1,p1) += ckl
tmp_b(p1,h1) += ckl
endif
enddo
enddo
enddo
!$OMP END DO NOWAIT
!$OMP CRITICAL
one_body_single_double_dm_mo_alpha = one_body_single_double_dm_mo_alpha + tmp_a
!$OMP END CRITICAL
!$OMP CRITICAL
one_body_single_double_dm_mo_beta = one_body_single_double_dm_mo_beta + tmp_b
!$OMP END CRITICAL
deallocate(tmp_a,tmp_b)
!$OMP END PARALLEL
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_num,mo_num) ]
BEGIN_PROVIDER [ double precision, one_e_dm_mo, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! One-body density matrix
END_DOC
one_body_dm_mo = one_body_dm_mo_alpha_average + one_body_dm_mo_beta_average
one_e_dm_mo = one_e_dm_mo_alpha_average + one_e_dm_mo_beta_average
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_spin_density_mo, (mo_num,mo_num) ]
BEGIN_PROVIDER [ double precision, one_e_spin_density_mo, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! $\rho(\alpha) - \rho(\beta)$
END_DOC
one_body_spin_density_mo = one_body_dm_mo_alpha_average - one_body_dm_mo_beta_average
one_e_spin_density_mo = one_e_dm_mo_alpha_average - one_e_dm_mo_beta_average
END_PROVIDER
subroutine set_natural_mos
@ -340,7 +257,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_num,mo_num,mo_occ,label)
call mo_as_svd_vectors_of_mo_matrix_eig(one_e_dm_mo,size(one_e_dm_mo,1),mo_num,mo_num,mo_occ,label)
soft_touch mo_occ
end
@ -403,7 +320,7 @@ BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ]
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ]
BEGIN_PROVIDER [ double precision, one_e_spin_density_ao, (ao_num,ao_num) ]
BEGIN_DOC
! One body spin density matrix on the |AO| basis : $\rho_{AO}(\alpha) - \rho_{AO}(\beta)$
END_DOC
@ -411,14 +328,14 @@ BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ]
integer :: i,j,k,l
double precision :: dm_mo
one_body_spin_density_ao = 0.d0
one_e_spin_density_ao = 0.d0
do k = 1, ao_num
do l = 1, ao_num
do i = 1, mo_num
do j = 1, mo_num
dm_mo = one_body_spin_density_mo(j,i)
dm_mo = one_e_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
one_e_spin_density_ao(l,k) += mo_coef(k,i) * mo_coef(l,j) * dm_mo
enddo
enddo
@ -427,8 +344,8 @@ BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ]
END_PROVIDER
BEGIN_PROVIDER [ double precision, one_body_dm_ao_alpha, (ao_num,ao_num) ]
&BEGIN_PROVIDER [ double precision, one_body_dm_ao_beta, (ao_num,ao_num) ]
BEGIN_PROVIDER [ double precision, one_e_dm_ao_alpha, (ao_num,ao_num) ]
&BEGIN_PROVIDER [ double precision, one_e_dm_ao_beta, (ao_num,ao_num) ]
BEGIN_DOC
! One body density matrix on the |AO| basis : $\rho_{AO}(\alpha), \rho_{AO}(\beta)$.
END_DOC
@ -436,17 +353,17 @@ END_PROVIDER
integer :: i,j,k,l
double precision :: mo_alpha,mo_beta
one_body_dm_ao_alpha = 0.d0
one_body_dm_ao_beta = 0.d0
one_e_dm_ao_alpha = 0.d0
one_e_dm_ao_beta = 0.d0
do k = 1, ao_num
do l = 1, ao_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)
mo_alpha = one_e_dm_mo_alpha_average(j,i)
mo_beta = one_e_dm_mo_beta_average(j,i)
! if(dabs(dm_mo).le.1.d-10)cycle
one_body_dm_ao_alpha(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha
one_body_dm_ao_beta(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_beta
one_e_dm_ao_alpha(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha
one_e_dm_ao_beta(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_beta
enddo
enddo
enddo

View File

@ -6,14 +6,14 @@
BEGIN_DOC
! psi_energy_h_core = $\langle \Psi | h_{core} |\Psi \rangle$
!
! computed using the :c:data:`one_body_dm_mo_alpha` +
! :c:data:`one_body_dm_mo_beta` and :c:data:`mo_one_e_integrals`
! computed using the :c:data:`one_e_dm_mo_alpha` +
! :c:data:`one_e_dm_mo_beta` and :c:data:`mo_one_e_integrals`
END_DOC
psi_energy_h_core = 0.d0
do i = 1, N_states
do j = 1, mo_num
do k = 1, mo_num
psi_energy_h_core(i) += mo_one_e_integrals(k,j) * (one_body_dm_mo_alpha(k,j,i) + one_body_dm_mo_beta(k,j,i))
psi_energy_h_core(i) += mo_one_e_integrals(k,j) * (one_e_dm_mo_alpha(k,j,i) + one_e_dm_mo_beta(k,j,i))
enddo
enddo
enddo
@ -21,7 +21,7 @@
accu = 0.d0
do i = 1, N_states
do j = 1, mo_num
accu += one_body_dm_mo_alpha(j,j,i) + one_body_dm_mo_beta(j,j,i)
accu += one_e_dm_mo_alpha(j,j,i) + one_e_dm_mo_beta(j,j,i)
enddo
accu = (elec_alpha_num + elec_beta_num ) / accu
psi_energy_h_core(i) = psi_energy_h_core(i) * accu

View File

@ -135,33 +135,6 @@ BEGIN_TEMPLATE
END_PROVIDER
BEGIN_PROVIDER [ integer, n_singles_max_$alpha ]
implicit none
BEGIN_DOC
! Maximum number of single excitations with the $\\$alpha$ spin
END_DOC
n_singles_max_$alpha = elec_$alpha_num * (mo_num - elec_$alpha_num)
END_PROVIDER
BEGIN_PROVIDER [ integer, psi_det_$alpha_unique_singles, (n_singles_max_$alpha,N_det_$alpha_unique) ]
implicit none
BEGIN_DOC
! For each unique spin-determinant, the list of indices of spin-determinant that
! are singly excited.
END_DOC
integer :: i
integer, allocatable :: idx0(:)
allocate( idx0(N_det_$alpha_unique) )
call get_all_spin_singles_$N_int( &
psi_det_beta_unique, idx0, &
tmp_det(1,2), N_det_beta_unique, &
singles_b, n_singles_b)
endif
END_PROVIDER
SUBST [ alpha ]
@ -789,9 +762,7 @@ subroutine get_all_spin_singles_and_doubles(buffer, idx, spindet, Nint, size_buf
! Returns the indices of all the single and double excitations in the list of
! unique $\alpha$ determinants.
!
! ..warning::
!
! The buffer is transposed.
! Warning: The buffer is transposed.
!
END_DOC
integer, intent(in) :: Nint, size_buffer, idx(size_buffer)

View File

@ -10,5 +10,5 @@ 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.
* `one_e_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points.

View File

@ -22,6 +22,7 @@
BEGIN_PROVIDER[double precision, aos_grad_in_r_array, (ao_num,n_points_final_grid,3)]
&BEGIN_PROVIDER[double precision, aos_grad_in_r_array_transp, (n_points_final_grid,ao_num,3)]
&BEGIN_PROVIDER[double precision, aos_grad_in_r_array_transp_xyz, (3,n_points_final_grid,ao_num)]
implicit none
BEGIN_DOC
! aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point

View File

@ -13,11 +13,11 @@ subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b)
do istate = 1, N_states
aos_array_bis = aos_array
! alpha density
call dgemv('N',ao_num,ao_num,1.d0,one_body_dm_alpha_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1)
call dgemv('N',ao_num,ao_num,1.d0,one_e_dm_alpha_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1)
dm_a(istate) = u_dot_v(aos_array,aos_array_bis,ao_num)
! beta density
aos_array_bis = aos_array
call dgemv('N',ao_num,ao_num,1.d0,one_body_dm_beta_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1)
call dgemv('N',ao_num,ao_num,1.d0,one_e_dm_beta_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1)
dm_b(istate) = u_dot_v(aos_array,aos_array_bis,ao_num)
enddo
end
@ -40,11 +40,11 @@ subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array)
do istate = 1, N_states
aos_array_bis = aos_array
! alpha density
call dsymv('U',ao_num,1.d0,one_body_dm_alpha_ao_for_dft(1,1,istate),size(one_body_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
call dsymv('U',ao_num,1.d0,one_e_dm_alpha_ao_for_dft(1,1,istate),size(one_e_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
dm_a(istate) = u_dot_v(aos_array,aos_array_bis,ao_num)
! beta density
aos_array_bis = aos_array
call dsymv('U',ao_num,1.d0,one_body_dm_beta_ao_for_dft(1,1,istate),size(one_body_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
call dsymv('U',ao_num,1.d0,one_e_dm_beta_ao_for_dft(1,1,istate),size(one_e_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
dm_b(istate) = u_dot_v(aos_array,aos_array_bis,ao_num)
enddo
end
@ -80,7 +80,7 @@ end
do istate = 1, N_states
! alpha density
! aos_array_bis = \rho_ao * aos_array
call dsymv('U',ao_num,1.d0,one_body_dm_alpha_ao_for_dft(1,1,istate),size(one_body_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
call dsymv('U',ao_num,1.d0,one_e_dm_alpha_ao_for_dft(1,1,istate),size(one_e_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
dm_a(istate) = u_dot_v(aos_array,aos_array_bis,ao_num)
! grad_dm(1) = \sum_i aos_grad_array(i,1) * aos_array_bis(i)
@ -91,7 +91,7 @@ end
! aos_grad_array_bis = \rho_ao * aos_grad_array
! beta density
call dsymv('U',ao_num,1.d0,one_body_dm_beta_ao_for_dft(1,1,istate),size(one_body_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
call dsymv('U',ao_num,1.d0,one_e_dm_beta_ao_for_dft(1,1,istate),size(one_e_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1)
dm_b(istate) = u_dot_v(aos_array,aos_array_bis,ao_num)
! grad_dm(1) = \sum_i aos_grad_array(i,1) * aos_array_bis(i)
@ -103,8 +103,8 @@ end
enddo
end
BEGIN_PROVIDER [double precision, one_dm_alpha_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ]
&BEGIN_PROVIDER [double precision, one_dm_beta_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ]
BEGIN_PROVIDER [double precision, one_e_dm_alpha_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ]
&BEGIN_PROVIDER [double precision, one_e_dm_beta_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ]
implicit none
integer :: i,j,k,l,m,istate
double precision :: contrib
@ -114,8 +114,8 @@ end
do k = 1, n_points_radial_grid -1
do l = 1, n_points_integration_angular
do istate = 1, N_States
one_dm_alpha_in_r(l,k,j,istate) = 0.d0
one_dm_beta_in_r(l,k,j,istate) = 0.d0
one_e_dm_alpha_in_r(l,k,j,istate) = 0.d0
one_e_dm_beta_in_r(l,k,j,istate) = 0.d0
enddo
r(1) = grid_points_per_atom(1,l,k,j)
r(2) = grid_points_per_atom(2,l,k,j)
@ -124,8 +124,8 @@ end
double precision :: dm_a(N_states),dm_b(N_states)
call dm_dft_alpha_beta_at_r(r,dm_a,dm_b)
do istate=1,N_states
one_dm_alpha_in_r(l,k,j,istate) = dm_a(istate)
one_dm_beta_in_r(l,k,j,istate) = dm_b(istate)
one_e_dm_alpha_in_r(l,k,j,istate) = dm_a(istate)
one_e_dm_beta_in_r(l,k,j,istate) = dm_b(istate)
enddo
enddo
@ -135,12 +135,12 @@ end
END_PROVIDER
BEGIN_PROVIDER [double precision, one_body_dm_alpha_at_r, (n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_body_dm_beta_at_r, (n_points_final_grid,N_states) ]
BEGIN_PROVIDER [double precision, one_e_dm_alpha_at_r, (n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_e_dm_beta_at_r, (n_points_final_grid,N_states) ]
implicit none
BEGIN_DOC
! 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)
! one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate)
! one_e_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
END_DOC
integer :: i,istate
@ -153,24 +153,24 @@ END_PROVIDER
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
call dm_dft_alpha_beta_at_r(r,dm_a,dm_b)
one_body_dm_alpha_at_r(i,istate) = dm_a(istate)
one_body_dm_beta_at_r(i,istate) = dm_b(istate)
one_e_dm_alpha_at_r(i,istate) = dm_a(istate)
one_e_dm_beta_at_r(i,istate) = dm_b(istate)
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [double precision, one_dm_and_grad_alpha_in_r, (4,n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_dm_and_grad_beta_in_r, (4,n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_body_grad_2_dm_alpha_at_r, (n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_body_grad_2_dm_beta_at_r, (n_points_final_grid,N_states) ]
BEGIN_PROVIDER [double precision, one_e_dm_and_grad_alpha_in_r, (4,n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_e_dm_and_grad_beta_in_r, (4,n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_e_grad_2_dm_alpha_at_r, (n_points_final_grid,N_states) ]
&BEGIN_PROVIDER [double precision, one_e_grad_2_dm_beta_at_r, (n_points_final_grid,N_states) ]
BEGIN_DOC
! 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
! one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate)
! one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate)
! one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate)
! one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate)
! one_e_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
END_DOC
implicit none
@ -188,17 +188,17 @@ END_PROVIDER
r(3) = final_grid_points(3,i)
!!!! Works also with the ao basis
call density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r(r,dm_a,dm_b, dm_a_grad, dm_b_grad, aos_array, grad_aos_array)
one_dm_and_grad_alpha_in_r(1,i,istate) = dm_a_grad(1,istate)
one_dm_and_grad_alpha_in_r(2,i,istate) = dm_a_grad(2,istate)
one_dm_and_grad_alpha_in_r(3,i,istate) = dm_a_grad(3,istate)
one_dm_and_grad_alpha_in_r(4,i,istate) = dm_a(istate)
one_body_grad_2_dm_alpha_at_r(i,istate) = dm_a_grad(1,istate) * dm_a_grad(1,istate) + dm_a_grad(2,istate) * dm_a_grad(2,istate) + dm_a_grad(3,istate) * dm_a_grad(3,istate)
one_e_dm_and_grad_alpha_in_r(1,i,istate) = dm_a_grad(1,istate)
one_e_dm_and_grad_alpha_in_r(2,i,istate) = dm_a_grad(2,istate)
one_e_dm_and_grad_alpha_in_r(3,i,istate) = dm_a_grad(3,istate)
one_e_dm_and_grad_alpha_in_r(4,i,istate) = dm_a(istate)
one_e_grad_2_dm_alpha_at_r(i,istate) = dm_a_grad(1,istate) * dm_a_grad(1,istate) + dm_a_grad(2,istate) * dm_a_grad(2,istate) + dm_a_grad(3,istate) * dm_a_grad(3,istate)
one_dm_and_grad_beta_in_r(1,i,istate) = dm_b_grad(1,istate)
one_dm_and_grad_beta_in_r(2,i,istate) = dm_b_grad(2,istate)
one_dm_and_grad_beta_in_r(3,i,istate) = dm_b_grad(3,istate)
one_dm_and_grad_beta_in_r(4,i,istate) = dm_b(istate)
one_body_grad_2_dm_beta_at_r(i,istate) = dm_b_grad(1,istate) * dm_b_grad(1,istate) + dm_b_grad(2,istate) * dm_b_grad(2,istate) + dm_b_grad(3,istate) * dm_b_grad(3,istate)
one_e_dm_and_grad_beta_in_r(1,i,istate) = dm_b_grad(1,istate)
one_e_dm_and_grad_beta_in_r(2,i,istate) = dm_b_grad(2,istate)
one_e_dm_and_grad_beta_in_r(3,i,istate) = dm_b_grad(3,istate)
one_e_dm_and_grad_beta_in_r(4,i,istate) = dm_b(istate)
one_e_grad_2_dm_beta_at_r(i,istate) = dm_b_grad(1,istate) * dm_b_grad(1,istate) + dm_b_grad(2,istate) * dm_b_grad(2,istate) + dm_b_grad(3,istate) * dm_b_grad(3,istate)
enddo
enddo

View File

@ -20,8 +20,8 @@
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight = final_weight_at_r_vector(i)
rhoa(istate) = one_body_dm_alpha_at_r(i,istate)
rhob(istate) = one_body_dm_beta_at_r(i,istate)
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
rhob(istate) = one_e_dm_beta_at_r(i,istate)
call ec_LDA(rhoa(istate),rhob(istate),e_c,vc_a,vc_b)
call ex_LDA(rhoa(istate),rhob(istate),e_x,vx_a,vx_b)
energy_x_LDA(istate) += weight * e_x
@ -59,10 +59,10 @@
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight = final_weight_at_r_vector(i)
rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate)
rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate)
grad_rho_a_2 = 0.d0
grad_rho_b_2 = 0.d0
grad_rho_a_b = 0.d0

View File

@ -3,7 +3,7 @@
&BEGIN_PROVIDER [double precision, psi_dft_energy_h_core, (N_states) ]
implicit none
BEGIN_DOC
! kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft
! kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft
END_DOC
integer :: i,j,istate
double precision :: accu
@ -12,15 +12,15 @@
do istate = 1, N_states
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_integrals_n_e(j,i)
psi_dft_energy_kinetic(istate) += ( one_e_dm_mo_alpha_for_dft(j,i,istate)+one_e_dm_mo_beta_for_dft(j,i,istate)) * mo_kinetic_integrals(j,i)
psi_dft_energy_nuclear_elec(istate) += ( one_e_dm_mo_alpha_for_dft(j,i,istate)+one_e_dm_mo_beta_for_dft(j,i,istate)) * mo_integrals_n_e(j,i)
enddo
enddo
enddo
accu = 0.d0
do i = 1, N_states
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)
accu += one_e_dm_mo_alpha_for_dft(j,j,i) + one_e_dm_mo_beta_for_dft(j,j,i)
enddo
accu = (elec_alpha_num + elec_beta_num ) / accu
psi_dft_energy_kinetic(i) = psi_dft_energy_kinetic(i) * accu

View File

@ -15,21 +15,21 @@
mu_local = 1.d-9
allocate(rhoa(N_states), rhob(N_states))
do istate = 1, N_states
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)
weight = final_weight_at_r_vector(i)
rhoa(istate) = one_body_dm_alpha_at_r(i,istate)
rhob(istate) = one_body_dm_beta_at_r(i,istate)
call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b)
call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b)
do j =1, ao_num
aos_vc_alpha_LDA_w(i,j,istate) = vc_a * aos_in_r_array(j,i)*weight
aos_vc_beta_LDA_w(i,j,istate) = vc_b * aos_in_r_array(j,i)*weight
aos_vx_alpha_LDA_w(i,j,istate) = vx_a * aos_in_r_array(j,i)*weight
aos_vx_beta_LDA_w(i,j,istate) = vx_b * aos_in_r_array(j,i)*weight
enddo
do j =1, ao_num
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)
weight = final_weight_at_r_vector(i)
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
rhob(istate) = one_e_dm_beta_at_r(i,istate)
call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b)
call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b)
aos_vc_alpha_LDA_w(i,j,istate) = vc_a * aos_in_r_array_transp(i,j)*weight
aos_vc_beta_LDA_w(i,j,istate) = vc_b * aos_in_r_array_transp(i,j)*weight
aos_vx_alpha_LDA_w(i,j,istate) = vx_a * aos_in_r_array_transp(i,j)*weight
aos_vx_beta_LDA_w(i,j,istate) = vx_b * aos_in_r_array_transp(i,j)*weight
enddo
enddo
enddo
@ -58,10 +58,10 @@
END_PROVIDER
BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)]
&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]!(n_points_final_grid,ao_num,N_states)]
&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)]
&BEGIN_PROVIDER[double precision, aos_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]!(n_points_final_grid,ao_num,N_states)]
BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)]
&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]
&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)]
&BEGIN_PROVIDER[double precision, aos_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]
&BEGIN_PROVIDER[double precision, aos_dvc_alpha_PBE_w , (ao_num,n_points_final_grid,3,N_states)]
&BEGIN_PROVIDER[double precision, aos_dvc_beta_PBE_w , (ao_num,n_points_final_grid,3,N_states)]
&BEGIN_PROVIDER[double precision, aos_dvx_alpha_PBE_w , (ao_num,n_points_final_grid,3,N_states)]
@ -95,10 +95,10 @@
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight = final_weight_at_r_vector(i)
rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate)
rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate)
grad_rho_a_2 = 0.d0
grad_rho_b_2 = 0.d0
grad_rho_a_b = 0.d0
@ -112,33 +112,35 @@
call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange
ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation
ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b )
vx_rho_a(istate) *= weight
vc_rho_a(istate) *= weight
vx_rho_b(istate) *= weight
vc_rho_b(istate) *= weight
do m= 1,3
contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate))
contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate))
contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate))
contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate))
enddo
vx_rho_a(istate) *= weight
vc_rho_a(istate) *= weight
vx_rho_b(istate) *= weight
vc_rho_b(istate) *= weight
do m= 1,3
contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate))
contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate))
contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate))
contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate))
enddo
do j = 1, ao_num
aos_vc_alpha_PBE_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i)
aos_vc_beta_PBE_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i)
aos_vx_alpha_PBE_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i)
aos_vx_beta_PBE_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i)
enddo
do m = 1,3
do j = 1, ao_num
aos_vc_alpha_PBE_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i)
aos_vc_beta_PBE_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i)
aos_vx_alpha_PBE_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i)
aos_vx_beta_PBE_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i)
do m = 1,3
aos_dvc_alpha_PBE_w(j,i,m,istate) = contrib_grad_ca(m,istate) * aos_in_r_array(j,i)
aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_in_r_array(j,i)
aos_dvx_alpha_PBE_w(j,i,m,istate) = contrib_grad_xa(m,istate) * aos_in_r_array(j,i)
aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_in_r_array(j,i)
aos_dvc_alpha_PBE_w(j,i,m,istate) = contrib_grad_ca(m,istate) * aos_in_r_array(j,i)
aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_in_r_array(j,i)
aos_dvx_alpha_PBE_w(j,i,m,istate) = contrib_grad_xa(m,istate) * aos_in_r_array(j,i)
aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_in_r_array(j,i)
grad_aos_dvc_alpha_PBE_w (j,i,m,istate) = contrib_grad_ca(m,istate) * aos_grad_in_r_array(j,i,m)
grad_aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_grad_in_r_array(j,i,m)
grad_aos_dvx_alpha_PBE_w (j,i,m,istate) = contrib_grad_xa(m,istate) * aos_grad_in_r_array(j,i,m)
grad_aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_grad_in_r_array(j,i,m)
enddo
grad_aos_dvc_alpha_PBE_w (j,i,m,istate) = contrib_grad_ca(m,istate) * aos_grad_in_r_array(m,j,i)
grad_aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_grad_in_r_array(m,j,i)
grad_aos_dvx_alpha_PBE_w (j,i,m,istate) = contrib_grad_xa(m,istate) * aos_grad_in_r_array(m,j,i)
grad_aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_grad_in_r_array(m,j,i)
enddo
enddo
enddo
enddo

View File

@ -116,9 +116,9 @@ END_PROVIDER
Trace_v_H(istate) = 0.d0
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)
Trace_v_xc(istate) += (potential_x_alpha_mo(j,i,istate) + potential_c_alpha_mo(j,i,istate)) * one_e_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_e_dm_mo_beta_for_dft(j,i,istate)
dm = one_e_dm_mo_alpha_for_dft(j,i,istate) + one_e_dm_mo_beta_for_dft(j,i,istate)
Trace_v_H(istate) += dm * short_range_Hartree_operator(j,i,istate)
enddo
enddo

View File

@ -16,7 +16,7 @@
short_range_Hartree = 0.d0
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
if(dabs(one_e_dm_average_mo_for_dft(j,i)).le.1.d-12)cycle
call get_mo_two_e_integrals_i1j1(i,j,mo_num,integrals_array,mo_integrals_map)
call get_mo_two_e_integrals_erf_i1j1(i,j,mo_num,integrals_erf_array,mo_integrals_erf_map)
do istate = 1, N_states
@ -24,9 +24,9 @@
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)
contrib = one_e_dm_mo_for_dft(i,j,istate) * (integral - integral_erf)
short_range_Hartree_operator(l,k,istate) += contrib
short_range_Hartree(istate) += contrib * one_body_dm_mo_for_dft(k,l,istate)
short_range_Hartree(istate) += contrib * one_e_dm_mo_for_dft(k,l,istate)
enddo
enddo
enddo

View File

@ -20,8 +20,8 @@
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight = final_weight_at_r_vector(i)
rhoa(istate) = one_body_dm_alpha_at_r(i,istate)
rhob(istate) = one_body_dm_beta_at_r(i,istate)
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
rhob(istate) = one_e_dm_beta_at_r(i,istate)
call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,vc_a,vc_b)
call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,vx_a,vx_b)
energy_sr_x_LDA(istate) += weight * e_x
@ -59,10 +59,10 @@
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight = final_weight_at_r_vector(i)
rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate)
rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate)
grad_rho_a_2 = 0.d0
grad_rho_b_2 = 0.d0
grad_rho_a_b = 0.d0

View File

@ -18,8 +18,8 @@
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight=final_weight_at_r_vector(i)
rhoa(istate) = one_body_dm_alpha_at_r(i,istate)
rhob(istate) = one_body_dm_beta_at_r(i,istate)
rhoa(istate) = one_e_dm_alpha_at_r(i,istate)
rhob(istate) = one_e_dm_beta_at_r(i,istate)
call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b)
call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b)
do j =1, ao_num
@ -107,10 +107,10 @@ END_PROVIDER
r(2) = final_grid_points(2,i)
r(3) = final_grid_points(3,i)
weight = final_weight_at_r_vector(i)
rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate)
rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate)
rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate)
grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate)
grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate)
grad_rho_a_2 = 0.d0
grad_rho_b_2 = 0.d0
grad_rho_a_b = 0.d0

View File

@ -2,6 +2,40 @@ program fci
implicit none
BEGIN_DOC
! Selected Full Configuration Interaction with stochastic selection and PT2.
!
! This program performs a CIPSI-like selected CI using a stochastic scheme for both
!
! the selection of the important Slater determinants and the computation of the PT2 correction.
!
! This CIPSI-like algorithm will be performed for the "n_states" lowest states of the variational space (see :option:`determinants n_det_max`)
!
! The fci program will stop when reaching at least one the two following conditions:
!
! * number of Slater determinant > "n_det_max" (see :option:`determinants n_det_max`)
!
! * |PT2| < "pt2_max" (see :option:`perturbation pt2_max`)
!
!
! The following other options can be of interest:
!
! If "read_wf" = False, it starts with a ROHF-like Slater determinant as a guess wave function.
!
! If "read_wf" = True , it starts with the wave function(s) stored in the EZFIO folder as guess wave function(s).
!
! (see :option:`determinants read_wf`)
!
! If "s2_eig" = True, it will systematically add all necessary Slater determinants in order
!
! to have a pure spin wave function with an :math:`S^2` value corresponding to "expected_s2".
!
! (see :option:`determinants s2_eig` and :option:`determinants expected_s2`)
!
!
!
!
! For excited states calculations, it is recommended to start with a cis or cisd guess wave functions
!
! for the "n_states", and to set "s2_eig" = True.
END_DOC
if (.not.is_zmq_slave) then

View File

@ -1,8 +1,13 @@
program pt2
implicit none
BEGIN_DOC
! Second order perturbative correction to the wave function contained in the
! EZFIO directory.
! Second order perturbative correction to the wave function contained in the EZFIO directory.
!
! This programs runs the stochastic PT2 correction on all "n_states" wave function stored in the EZFIO folder (see :option:`determinant n_states`).
!
! The option for the PT2 correction are the "pt2_relative_error" which is the relative stochastic
!
! error on the PT2 to reach before stopping the stochastic sampling. (see :option:`perturbation pt2_relative_error`)
END_DOC
if (.not. is_zmq_slave) then
read_wf = .True.

View File

@ -1,6 +1,6 @@
BEGIN_PROVIDER [ double precision, KS_energy]
&BEGIN_PROVIDER [ double precision, two_electron_energy]
&BEGIN_PROVIDER [ double precision, one_electron_energy]
&BEGIN_PROVIDER [ double precision, two_e_energy]
&BEGIN_PROVIDER [ double precision, one_e_energy]
&BEGIN_PROVIDER [ double precision, Fock_matrix_energy]
&BEGIN_PROVIDER [ double precision, trace_potential_xc ]
implicit none
@ -11,22 +11,22 @@
integer :: i,j
double precision :: accu_mono,accu_fock
KS_energy = nuclear_repulsion
one_electron_energy = 0.d0
two_electron_energy = 0.d0
one_e_energy = 0.d0
two_e_energy = 0.d0
Fock_matrix_energy = 0.d0
trace_potential_xc = 0.d0
do j=1,ao_num
do i=1,ao_num
Fock_matrix_energy += Fock_matrix_ao_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) + &
Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j)
two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) &
two_e_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) &
+ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) )
one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) )
one_e_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) )
trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j)
enddo
enddo
KS_energy += e_exchange_dft + e_correlation_dft + one_electron_energy + two_electron_energy
KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_e_energy
END_PROVIDER
BEGIN_PROVIDER [double precision, extra_e_contrib_density]

View File

@ -10,10 +10,8 @@ program srs_ks_cf
touch io_mo_one_e_integrals
io_ao_one_e_integrals = "None"
touch io_ao_one_e_integrals
read_wf = .False.
density_for_dft ="WFT"
density_for_dft ="KS"
touch density_for_dft
touch read_wf
print*, '**************************'
print*, 'mu_erf_dft = ',mu_erf_dft
print*, '**************************'
@ -88,11 +86,10 @@ subroutine run
EHF = KS_energy
mo_label = "Canonical"
mo_label = "Orthonormalized"
! Choose SCF algorithm
! call damping_SCF ! Deprecated routine
call Roothaan_Hall_SCF
end

View File

@ -1,6 +1,6 @@
BEGIN_PROVIDER [ double precision, RS_KS_energy ]
&BEGIN_PROVIDER [ double precision, two_electron_energy]
&BEGIN_PROVIDER [ double precision, one_electron_energy]
&BEGIN_PROVIDER [ double precision, two_e_energy]
&BEGIN_PROVIDER [ double precision, one_e_energy]
&BEGIN_PROVIDER [ double precision, Fock_matrix_energy]
&BEGIN_PROVIDER [ double precision, trace_potential_xc ]
implicit none
@ -11,21 +11,21 @@
integer :: i,j
double precision :: accu_mono,accu_fock
one_electron_energy = 0.d0
two_electron_energy = 0.d0
one_e_energy = 0.d0
two_e_energy = 0.d0
Fock_matrix_energy = 0.d0
trace_potential_xc = 0.d0
do j=1,ao_num
do i=1,ao_num
Fock_matrix_energy += Fock_matrix_ao_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) + &
Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j)
two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) &
two_e_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) &
+ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) )
one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) )
one_e_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) )
trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j)
enddo
enddo
RS_KS_energy += e_exchange_dft + e_correlation_dft + one_electron_energy + two_electron_energy
RS_KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_e_energy
END_PROVIDER
BEGIN_PROVIDER [double precision, extra_e_contrib_density]

View File

@ -12,9 +12,8 @@ program rs_ks_scf
touch io_ao_one_e_integrals
read_wf = .False.
density_for_dft ="WFT"
density_for_dft ="KS"
touch density_for_dft
touch read_wf
print*, '**************************'
print*, 'mu_erf_dft = ',mu_erf_dft
print*, '**************************'
@ -90,13 +89,15 @@ subroutine run
EHF = RS_KS_energy
mo_label = "Canonical"
mo_label = "Orthonormalized"
level_shift += 1.d0
touch level_shift
call Roothaan_Hall_SCF
call ezfio_set_kohn_sham_rs_energy(SCF_energy)
write(*, '(A22,X,F16.10)') 'one_electron_energy = ',one_electron_energy
write(*, '(A22,X,F16.10)') 'two_electron_energy = ',two_electron_energy
write(*, '(A22,X,F16.10)') 'one_e_energy = ',one_e_energy
write(*, '(A22,X,F16.10)') 'two_e_energy = ',two_e_energy
write(*, '(A22,X,F16.10)') 'e_exchange_dft = ',e_exchange_dft
write(*, '(A22,X,F16.10)') 'e_correlation_dft = ',e_correlation_dft
write(*, '(A22,X,F16.10)') 'Fock_matrix_energy = ',Fock_matrix_energy

View File

@ -3,7 +3,7 @@ subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao)
BEGIN_DOC
! Transform A from the MO basis to the AO basis
!
! (S.C).A_mo.(S.C)t
! $(S.C).A_{mo}.(S.C)^\dagger$
END_DOC
integer, intent(in) :: LDA_ao,LDA_mo
double precision, intent(in) :: A_mo(LDA_mo,mo_num)
@ -25,6 +25,31 @@ subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao)
deallocate(T)
end
subroutine mo_to_ao_no_overlap(A_mo,LDA_mo,A_ao,LDA_ao)
implicit none
BEGIN_DOC
! $C.A_{mo}.C^\dagger$
END_DOC
integer, intent(in) :: LDA_ao,LDA_mo
double precision, intent(in) :: A_mo(LDA_mo,mo_num)
double precision, intent(out) :: A_ao(LDA_ao,ao_num)
double precision, allocatable :: T(:,:)
allocate ( T(mo_num,ao_num) )
call dgemm('N','T', mo_num, ao_num, mo_num, &
1.d0, A_mo,size(A_mo,1), &
mo_coef, size(mo_coef,1), &
0.d0, T, size(T,1))
call dgemm('N','N', ao_num, ao_num, mo_num, &
1.d0, mo_coef, size(mo_coef,1), &
T, size(T,1), &
0.d0, A_ao, size(A_ao,1))
deallocate(T)
end
BEGIN_PROVIDER [ double precision, S_mo_coef, (ao_num, mo_num) ]
implicit none
BEGIN_DOC

View File

@ -1,7 +1,7 @@
program diagonalize_h
implicit none
BEGIN_DOC
! program that extracts the N_states lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder
! program that extracts the `n_states` lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder
END_DOC
read_wf = .True.
touch read_wf

View File

@ -1,7 +1,17 @@
program fcidump
implicit none
BEGIN_DOC
! Produce a FCIDUMP file
! Produce a regular FCIDUMP file from the MOs stored in the EZFIO folder.
!
! To specify an active space, the class of the mos have to set in the EZFIO folder (see set_mo_class/qp_set_mo_class).
!
! The fcidump program supports 3 types of MO_class :
!
! * the "core" orbitals which are always doubly occupied in the calculation
!
! * the "del" orbitals that are never occupied in the calculation
!
! * the "act" orbitals that will be occupied by a varying number of electrons
END_DOC
character*(128) :: output
integer :: i_unit_output,getUnitAndOpen

View File

@ -1,7 +1,11 @@
program four_idx_transform
implicit none
BEGIN_DOC
! 4-index transformation of two-electron integrals from AO to MO integrals
! 4-index transformation of two-electron integrals from AO to MO integrals.
!
! This program will compute the two-electron integrals on the MO basis and store it into the EZFIO folder.
!
! This program can be useful if the AO --> MO transformation is an expensive step by itself.
END_DOC
io_mo_two_e_integrals = 'Write'

View File

@ -1,7 +1,13 @@
program print_e_conv
implicit none
BEGIN_DOC
! program that prints in a human readable format the convergence of the CIPSI algorithm
! program that prints in a human readable format the convergence of the CIPSI algorithm.
!
! for all istate, this program produces
!
! * a file "EZFIO.istate.conv" containing the variational and var+PT2 energies as a function of N_det
!
! * for istate > 1, a file EZFIO.istate.delta_e.conv containing the energy difference (both var and var+PT2) with the ground state as a function of N_det
END_DOC
provide ezfio_filename

View File

@ -1,9 +1,9 @@
program print_wf
implicit none
BEGIN_DOC
! print the wave function stored in the EZFIO folder in the intermediate normalization
! 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
! 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.
!

View File

@ -2,6 +2,14 @@ program save_natorb
implicit none
BEGIN_DOC
! Save natural MOs into the EZFIO
!
! This program reads the wave function stored in the EZFIO folder,
!
! extracts the corresponding natural orbitals and set them as the new MOs
!
! If this is a multi-state calculation, the density matrix that produces the natural orbitals
!
! is obtained from a state-averaged of the density matrices of each state with the corresponding state_average_weight (see the doc of state_average_weight).
END_DOC
read_wf = .True.
touch read_wf

View File

@ -1,20 +0,0 @@
program save_one_body_dm
implicit none
BEGIN_DOC
! 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).
END_DOC
read_wf = .True.
touch read_wf
call routine
end
subroutine routine
call ezfio_set_aux_quantities_data_one_body_alpha_dm_mo(one_body_dm_mo_alpha)
call ezfio_set_aux_quantities_data_one_body_beta_dm_mo(one_body_dm_mo_beta)
end

View File

@ -0,0 +1,22 @@
program save_one_e_dm
implicit none
BEGIN_DOC
! 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_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read this density in a further calculation.
!
! This can be used to perform damping on the density in RS-DFT calculation (see the density_for_dft module).
END_DOC
read_wf = .True.
touch read_wf
call routine
end
subroutine routine
call ezfio_set_aux_quantities_data_one_e_dm_alpha_mo(one_e_dm_mo_alpha)
call ezfio_set_aux_quantities_data_one_e_dm_beta_mo(one_e_dm_mo_beta)
end

View File

@ -2,6 +2,12 @@ program save_ortho_mos
implicit none
BEGIN_DOC
! Save orthonormalized MOs in the EZFIO.
!
! This program reads the current MOs, computes the corresponding overlap matrix in the MO basis
!
! and perform a Lowdin orthonormalization : :math:`MO_{new} = S^{-1/2} MO_{guess}`.
!
! Thanks to the Lowdin orthonormalization, the new MOs are the most similar to the guess MOs.
END_DOC
call orthonormalize_mos
call save_mos

View File

@ -1,7 +1,7 @@
program write_integrals
implicit none
BEGIN_DOC
! Saves the two-electron erf integrals into the EZFIO
! Saves the two-electron integrals with the :math:`erf(\mu r_{12})/r_{12}` oprerator into the EZFIO folder
END_DOC
io_mo_two_e_integrals = 'None'
touch io_mo_two_e_integrals