9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-27 13:53:29 +01:00
qp2/scripts/functionals/do_not_touch_func
Anthony Scemama 49e9488f62
Develop (#10)
* fixed laplacian of aos

* corrected the laplacians of aos

* added dft_one_e

* added new feature for new dft functionals

* changed the configure to add new functionals

* changed the configure

* added dft_one_e/README.rst

* added README.rst in new_functionals

* added source/programmers_guide/new_ks.rst

* Thesis Yann

* Added gmp installation in configure

* improved qp_e_conv_fci

* Doc

* Typos

* Added variance_max

* Fixed completion in qp_create

* modif TODO

* fixed DFT potential for n_states gt 1

* improved pot pbe

* trying to improve sr PBE

* fixed potential pbe

* fixed the vxc smashed for pbe sr and normal

* Comments in selection

* bug fixed by peter

* Fixed bug with zero beta electrons

* Update README.rst

* Update e_xc_new_func.irp.f

* Update links.rst

* Update quickstart.rst

* Update quickstart.rst

* updated cipsi

* Fixed energies of non-expected s2 (#9)

* Moved diag_algorithm in Davdison
2019-02-22 19:19:58 +01:00
..
e_xc_new_func.irp.f Develop (#10) 2019-02-22 19:19:58 +01:00
NEED Develop (#10) 2019-02-22 19:19:58 +01:00
pot_xc_new_func.irp.f Develop (#10) 2019-02-22 19:19:58 +01:00
README.rst Develop (#10) 2019-02-22 19:19:58 +01:00

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 :file:`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".