9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 05:53:37 +01:00

added README.rst in new_functionals

This commit is contained in:
eginer 2019-02-04 16:13:42 +01:00
parent 981b563177
commit 44b9318bae
8 changed files with 173 additions and 91 deletions

View File

@ -0,0 +1,69 @@
#FIG 3.2 Produced by xfig version 3.2.5c
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
5 1 1 2 1 7 50 -1 -1 4.000 0 1 1 0 13522.825 11604.101 13950 13050 15030 11565 13815 10125
9 0 4.00 120.00 180.00
5 1 1 2 1 7 50 -1 -1 4.000 0 0 1 0 12568.409 3969.773 9360 9990 8010 9045 6975 7875
9 0 2.00 90.00 180.00
6 3375 8730 7650 11070
2 4 1 2 4 7 50 -1 -1 4.000 0 0 7 0 0 5
7605 11025 3420 11025 3420 8775 7605 8775 7605 11025
4 0 0 50 -1 0 12 0.0000 4 135 720 3825 10485 etc ... \001
4 0 0 50 -1 0 12 0.0000 4 165 2430 3825 10080 potential_sr_x_alpha_ao_LDA\001
4 0 0 50 -1 0 12 0.0000 4 165 2610 3825 9675 energy_x_LDA, energy_sr_c_PBE\001
4 0 1 50 -1 0 20 0.0000 4 165 2700 3465 9135 providers from dft_utils_one_e\001
-6
2 1 1 2 1 7 50 -1 -1 4.000 0 0 -1 1 0 2
9 0 2.00 90.00 180.00
5310 3555 5310 2790
2 4 1 2 4 7 50 -1 -1 4.000 0 0 7 0 0 5
7515 2745 3015 2745 3015 720 7515 720 7515 2745
2 4 1 2 4 7 50 -1 -1 4.000 0 0 7 0 0 5
7155 5535 3420 5535 3420 3645 7155 3645 7155 5535
2 1 1 2 1 7 50 -1 -1 4.000 0 0 -1 1 0 2
9 0 2.00 90.00 180.00
5175 6165 5175 5400
2 4 1 2 4 7 50 -1 -1 6.000 0 0 7 0 0 5
7380 7650 3645 7650 3645 6255 7380 6255 7380 7650
2 1 1 2 1 7 50 -1 -1 4.000 0 0 -1 1 0 2
9 0 2.00 90.00 180.00
5355 8640 5355 7695
2 2 0 3 15 7 50 -1 -1 0.000 0 0 -1 0 0 5
8820 11295 14850 11295 14850 14625 8820 14625 8820 11295
2 2 0 3 15 7 50 -1 -1 0.000 0 0 -1 0 0 5
2790 0 8190 0 8190 11475 2790 11475 2790 0
2 2 0 3 15 7 50 -1 -1 0.000 0 0 -1 0 0 5
8640 8100 14355 8100 14355 11160 8640 11160 8640 8100
2 4 1 2 4 7 50 -1 -1 4.000 0 0 7 0 0 5
13815 13950 9630 13950 9630 11700 13815 11700 13815 13950
2 4 1 2 4 7 50 -1 -1 4.000 0 0 7 0 0 5
13680 11070 9495 11070 9495 8820 13680 8820 13680 11070
4 0 1 50 -1 0 20 0.0000 4 165 2160 3690 4005 providers from dft_one_e\001
4 0 0 50 -1 0 12 0.0000 4 150 540 3465 1485 ks_scf\001
4 0 0 50 -1 0 12 0.0000 4 150 810 3465 1935 rs_ks_scf\001
4 0 0 50 -1 0 12 0.0000 4 165 2790 3465 2340 rsdft_cipsi, rsdft_ecmd etc ...\001
4 0 1 50 -1 0 20 0.0000 4 165 2070 3735 1035 DFT programs or plugins\001
4 0 0 50 -1 0 12 0.0000 4 165 3690 3825 4545 potential_x_alpha_ao, potential_x_beta_ao\001
4 0 0 50 -1 0 12 0.0000 4 135 720 3825 5355 etc ... \001
4 0 0 50 -1 0 12 0.0000 4 120 1620 3825 4950 energy_x, energy_c\001
4 0 1 50 -1 0 20 0.0000 4 165 2250 3780 6570 options from dft_keywords\001
4 0 0 50 -1 0 12 0.0000 4 165 1710 3870 6885 exchange_functional\001
4 0 0 50 -1 0 12 0.0000 4 150 1980 3870 7245 correlation_functional\001
4 0 15 50 -1 0 20 0.0000 4 150 1980 3645 315 Core modules of the QP\001
4 0 15 50 -1 0 20 0.0000 4 165 2700 10260 8505 link beetween core and plugins\001
4 0 0 50 -1 0 12 0.0000 4 165 1890 9765 12960 pot_ao_alpha_new_func\001
4 0 1 50 -1 0 20 0.0000 4 165 3060 9720 12105 providers from "fancy_functionals"\001
4 0 0 50 -1 0 12 0.0000 4 135 720 10035 13410 etc ... \001
4 0 0 50 -1 0 12 0.0000 4 165 3330 9765 12600 e_c_new_fancy_func,e_x_new_fancy_func\001
4 0 0 50 -1 0 12 0.0000 4 165 2070 9900 9720 energy_c_new_functional\001
4 0 0 50 -1 0 12 0.0000 4 135 720 9900 10530 etc ... \001
4 0 0 50 -1 0 12 0.0000 4 165 3060 9900 10125 potential_new_functional_x_beta_ao\001
4 0 1 50 -1 0 20 0.0000 4 165 2700 9585 9225 providers from new_functionals\001
4 0 15 50 -1 0 20 0.0000 4 165 1440 10485 11520 External plugins\001
4 0 1 50 -1 0 12 0.0000 4 165 3600 14670 10530 add "fancy_functionals" to the NEED file\001

Binary file not shown.

View File

@ -1,18 +0,0 @@
[new_exchange_functional]
type: character*(32)
doc: name of the exchange functional
interface: ezfio, provider, ocaml
default: short_range_LDA
[new_correlation_functional]
type: character*(32)
doc: name of the correlation functional
interface: ezfio, provider, ocaml
default: short_range_LDA
[new_HF_exchange]
type: double precision
doc: Percentage of HF exchange in the DFT model
interface: ezfio,provider,ocaml
default: 0.

View File

@ -0,0 +1,72 @@
new_functionals
===============
This module allows to add new |DFT| or |RSDFT| functionals in the |QP|.
It works as a **hub** between the *providers* that one can build in some external plugins and the main *providers*
used by the various |DFT| or |RSDFT| programs.
.. warning::
This module is not tracked by GIT and therefore, the modifications performed on this module
can be easily lost. Keep in mind this important fact in order not to loose your own work.
A pictorial representation of the main dependencies can be seen here:
.. image:: /_static/dependencies_func.pdf
:align: center
:width: 200px
:alt: Summary of dependencies
The main idea is the following:
1. Develop *new providers* for the new functionals (energy and potential for exchange and correlation) in some **external plugin**.
* Example:
* In an **external plugin** named **fancy_functionals**, you create *e_c_new_fancy_func* for the energy and *pot_ao_alpha_new_func* for the alpha potential
* If you want to be able to use the |DFT| programs already available in the |QP|, these *providers* must use the providers for the density defined in :ref:`module_density_for_dft` and :ref:`module_dft_utils_in_r`.
2. Add the name of your **external plugin** to the :file:`NEED` in order to link your new providers to **new_functionals**
* Example:
* add **fancy_functionals** to the NEED file of **new_functionals**
3. Change the file :file:`e_xc_new_func.irp.f` and :file:`pot_xc_new_func.irp.f` to set the value of your new providers to the providers defined in **new_functionals**
* Example:
* for the exchange/correlation energy
.. code:: fortran
BEGIN_PROVIDER[double precision, energy_x_new_functional, (N_states) ]
&BEGIN_PROVIDER[double precision, energy_c_new_functional, (N_states) ]
implicit none
BEGIN_DOC
! energy_x_new_functional = define here your functional
! energy_c_new_functional = define here your functional
END_DOC
energy_c_new_functional = e_c_new_fancy_func
energy_x_new_functional = e_x_new_fancy_func
END_PROVIDER
4. Compile at the root of the |QP|
* Example:
.. code:: bash
cd ${QP_ROOT}
ninja
5. When you want to execute a program with your new functional, just set the options :option:`dft_keywords exchange_functional` and :option:`dft_keywords correlation_functional` to "my_functional".

View File

@ -1,33 +0,0 @@
BEGIN_PROVIDER[double precision, energy_x_new_functional, (N_states) ]
&BEGIN_PROVIDER[double precision, energy_c_new_functional, (N_states) ]
implicit none
BEGIN_DOC
! energy_x_new_functional = define here your functional
! energy_c_new_functional = define here your functional
END_DOC
energy_x_new_functional = 0.d0
energy_c_new_functional = 0.d0
if(trim(new_exchange_functional)=="your_new_keyword")then
energy_x_new_functional = 0.d0 ! replace by your new provider
else if(new_exchange_functional.EQ."None")then
energy_x_new_functional = 0.d0 ! replace by your new provider
else
print*, 'Exchange functional required does not exist ...'
print*,'new_exchange_functional',new_exchange_functional
stop
endif
if(trim(new_correlation_functional)=="your_new_keyword")then
energy_c_new_functional = 0.d0 ! replace by your new provider
else if(new_correlation_functional.EQ."None")then
energy_c_new_functional = 0.d0 ! replace by your new provider
else
print*, 'Correlation functional required does not exist ...'
print*,'new_correlation_functional',new_correlation_functional
stop
endif
END_PROVIDER

View File

@ -0,0 +1,14 @@
BEGIN_PROVIDER[double precision, energy_x_new_functional, (N_states) ]
&BEGIN_PROVIDER[double precision, energy_c_new_functional, (N_states) ]
implicit none
BEGIN_DOC
! energy_x_new_functional = define here your functional
! energy_c_new_functional = define here your functional
END_DOC
energy_x_new_functional = 0.d0 ! replace by your new provider
energy_c_new_functional = 0.d0 ! replace by your new provider
END_PROVIDER

View File

@ -1,40 +0,0 @@
BEGIN_PROVIDER [double precision, potential_new_functional_x_alpha_ao,(ao_num,ao_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_new_functional_x_beta_ao,(ao_num,ao_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_new_functional_c_alpha_ao,(ao_num,ao_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_new_functional_c_beta_ao,(ao_num,ao_num,N_states)]
implicit none
BEGIN_DOC
! define here your exchange/correlation potentials for alpha/beta electrons
END_DOC
potential_new_functional_x_alpha_ao = 0.d0
potential_new_functional_c_alpha_ao = 0.d0
potential_new_functional_x_beta_ao = 0.d0
potential_new_functional_c_beta_ao = 0.d0
if(trim(new_exchange_functional)=="your_new_keyword")then
potential_new_functional_x_alpha_ao = 0.d0 ! replace by your new provider
potential_new_functional_x_beta_ao = 0.d0 ! replace by your new provider
else if(new_exchange_functional.EQ."None")then
potential_new_functional_x_alpha_ao = 0.d0
potential_new_functional_x_beta_ao = 0.d0
else
print*, 'Exchange functional required does not exist ...'
print*,'new_exchange_functional',new_exchange_functional
stop
endif
if(trim(new_correlation_functional)=="your_new_keyword")then
potential_new_functional_c_alpha_ao = 0.d0 ! replace by your new provider
potential_new_functional_c_beta_ao = 0.d0 ! replace by your new provider
else if(new_correlation_functional.EQ."None")then
potential_new_functional_c_alpha_ao = 0.d0
potential_new_functional_c_beta_ao = 0.d0
else
print*, 'Correlation functional required does not ecist ...'
print*,'new_correlation_functional',new_correlation_functional
stop
endif
END_PROVIDER

View File

@ -0,0 +1,18 @@
BEGIN_PROVIDER [double precision, potential_new_functional_x_alpha_ao,(ao_num,ao_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_new_functional_x_beta_ao,(ao_num,ao_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_new_functional_c_alpha_ao,(ao_num,ao_num,N_states)]
&BEGIN_PROVIDER [double precision, potential_new_functional_c_beta_ao,(ao_num,ao_num,N_states)]
implicit none
BEGIN_DOC
! define here your exchange/correlation potentials for alpha/beta electrons
END_DOC
potential_new_functional_x_alpha_ao = 0.d0 ! replace by your new provider
potential_new_functional_x_beta_ao = 0.d0 ! replace by your new provider
potential_new_functional_c_alpha_ao = 0.d0 ! replace by your new provider
potential_new_functional_c_beta_ao = 0.d0 ! replace by your new provider
END_PROVIDER