mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Develop manus (#14)
* modified printing for rpt2 * Comment * Fixed plugins * Scripting for functionals * Documentation * 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 * some modifs * modified gfortran_debug.cfg * fixed automatization of functionals * modified e_xc_general.irp.f * minor modifs in ref_bitmask.irp.f * modifying functionals * rs_ks_scf and ks_scf compiles with the automatic handling of functionals * removed prints * fixed configure * fixed the new functionals * Merge toto * modified automatic functionals
This commit is contained in:
parent
1b1027765a
commit
c65ecce327
@ -28,72 +28,27 @@ So, at the end of the day, adding a new functional consists only in **setting a
|
|||||||
The general philosphy
|
The general philosphy
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
We have created a quite easy way to develop new functionals that is based on
|
The directory **functionals** contains only files ending with .irp.f whose name being the name of a specific functional.
|
||||||
|
All files in *a_functional*.irp.f **must** contain **at least** the following providers
|
||||||
|
|
||||||
* the used of **your own external plugins**
|
* :c:data:`energy_x_a_functional` and :c:data:`energy_c_a_functional` which are of course the exchange and correlation energies
|
||||||
|
|
||||||
* the module :ref:`module_new_functionals` acting as **hub**
|
* :c:data:`potential_x_alpha_ao_a_functional` and :c:data:`potential_x_beta_ao_a_functional` which are the exchange alpha/beta potentials
|
||||||
|
|
||||||
A pictorial representation of the main dependencies can be seen here:
|
* :c:data:`potential_c_alpha_ao_a_functional` and :c:data:`potential_c_beta_ao_a_functional` which are the correlation alpha/beta potentials
|
||||||
|
|
||||||
.. image:: /_static/dependencies_func.pdf
|
For instance, the file :file:`sr_lda.irp.f` contains the following providers
|
||||||
:align: center
|
|
||||||
:width: 200px
|
* :c:data:`energy_x_sr_lda` and :c:data:`energy_c_sr_lda` which are of course the exchange and correlation energies
|
||||||
:alt: Summary of dependencies
|
|
||||||
|
* :c:data:`potential_x_alpha_ao_sr_lda` and :c:data:`potential_x_beta_ao_sr_lda` which are the exchange alpha/beta potentials
|
||||||
|
|
||||||
|
* :c:data:`potential_c_alpha_ao_sr_lda` and :c:data:`potential_c_beta_ao_sr_lda` which are the correlation alpha/beta potentials
|
||||||
|
|
||||||
|
|
||||||
The main idea is the following:
|
Therefore, if you want to develop a new functional, just design a provider
|
||||||
|
|
||||||
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` (see below).
|
|
||||||
|
|
||||||
|
|
||||||
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".
|
|
||||||
|
|
||||||
|
To use a functional
|
||||||
|
|
||||||
Using the density for DFT calculations in the |QP|
|
Using the density for DFT calculations in the |QP|
|
||||||
==================================================
|
==================================================
|
||||||
|
7
ocaml/.gitignore
vendored
7
ocaml/.gitignore
vendored
@ -14,15 +14,20 @@ Input_davidson.ml
|
|||||||
Input_density_for_dft.ml
|
Input_density_for_dft.ml
|
||||||
Input_determinants.ml
|
Input_determinants.ml
|
||||||
Input_dft_keywords.ml
|
Input_dft_keywords.ml
|
||||||
|
Input_dft_mu_of_r.ml
|
||||||
Input_dressing.ml
|
Input_dressing.ml
|
||||||
|
Input_ijkl_ints_in_r3.ml
|
||||||
Input_mo_one_e_ints.ml
|
Input_mo_one_e_ints.ml
|
||||||
Input_mo_two_e_erf_ints.ml
|
Input_mo_two_e_erf_ints.ml
|
||||||
Input_mo_two_e_ints.ml
|
Input_mo_two_e_ints.ml
|
||||||
|
Input_mu_of_r_ints.ml
|
||||||
|
Input_mu_of_r.ml
|
||||||
Input_nuclei.ml
|
Input_nuclei.ml
|
||||||
Input_perturbation.ml
|
Input_perturbation.ml
|
||||||
Input_pseudo.ml
|
Input_pseudo.ml
|
||||||
|
Input_rsdft_ecmd.ml
|
||||||
Input_scf_utils.ml
|
Input_scf_utils.ml
|
||||||
Input_variance.ml
|
Input_two_body_dm.ml
|
||||||
qp_create_ezfio
|
qp_create_ezfio
|
||||||
qp_create_ezfio.native
|
qp_create_ezfio.native
|
||||||
qp_edit
|
qp_edit
|
||||||
|
@ -7,9 +7,8 @@ BEGIN_PROVIDER [double precision, energy_x, (N_states)]
|
|||||||
BEGIN_SHELL [ /usr/bin/env python ]
|
BEGIN_SHELL [ /usr/bin/env python ]
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import sys
|
from qp_path import QP_SRC
|
||||||
qproot=os.environ['QP_ROOT']
|
funcdir=QP_SRC+'/functionals/'
|
||||||
funcdir='../functionals/'
|
|
||||||
os.chdir(funcdir)
|
os.chdir(funcdir)
|
||||||
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
||||||
prefix = ""
|
prefix = ""
|
||||||
@ -42,9 +41,8 @@ print "endif"
|
|||||||
BEGIN_SHELL [ /usr/bin/env python ]
|
BEGIN_SHELL [ /usr/bin/env python ]
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import sys
|
from qp_path import QP_SRC
|
||||||
qproot=os.environ['QP_ROOT']
|
funcdir=QP_SRC+'/functionals/'
|
||||||
funcdir='../functionals/'
|
|
||||||
os.chdir(funcdir)
|
os.chdir(funcdir)
|
||||||
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
||||||
prefix = ""
|
prefix = ""
|
||||||
|
@ -8,9 +8,8 @@
|
|||||||
BEGIN_SHELL [ /usr/bin/env python ]
|
BEGIN_SHELL [ /usr/bin/env python ]
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import sys
|
from qp_path import QP_SRC
|
||||||
qproot=os.environ['QP_ROOT']
|
funcdir=QP_SRC+'/functionals/'
|
||||||
funcdir='../functionals/'
|
|
||||||
os.chdir(funcdir)
|
os.chdir(funcdir)
|
||||||
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
||||||
|
|
||||||
@ -45,9 +44,8 @@ print "endif"
|
|||||||
BEGIN_SHELL [ /usr/bin/env python ]
|
BEGIN_SHELL [ /usr/bin/env python ]
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import sys
|
from qp_path import QP_SRC
|
||||||
qproot=os.environ['QP_ROOT']
|
funcdir=QP_SRC+'/functionals/'
|
||||||
funcdir='../functionals/'
|
|
||||||
os.chdir(funcdir)
|
os.chdir(funcdir)
|
||||||
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
||||||
|
|
||||||
@ -205,9 +203,8 @@ print "endif"
|
|||||||
BEGIN_SHELL [ /usr/bin/env python ]
|
BEGIN_SHELL [ /usr/bin/env python ]
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import sys
|
from qp_path import QP_SRC
|
||||||
qproot=os.environ['QP_ROOT']
|
funcdir=QP_SRC+'/functionals/'
|
||||||
funcdir='../functionals/'
|
|
||||||
os.chdir(funcdir)
|
os.chdir(funcdir)
|
||||||
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user