iii) a "plugin_I.irp.f" file that is a program to be compiled and just printing "Hello world"
II) Specifying the dependencies
-------------------------------
The next step is to know what are the other modules/plugins that we need to do what we want.
We need here
a) the one-electron integrals on the AO basis, which are computed in qp2/src/ao_one_e_ints/
b) the one-electron integrals on the MO basis, which are computed in qp2/src/mo_one_e_ints/
c) the two-electron integrals on the AO basis, which are computed in qp2/src/ao_two_e_ints/
d) the two-electron integrals on the MO basis, which are computed in qp2/src/mo_two_e_ints/
Therefore, we will need the following four modules:
a) ao_one_e_ints
b) mo_one_e_ints
c) ao_two_e_ints
d) mo_two_e_ints
You can then create the following "NEED" file by executing the following command
$ cat <<EOF > NEED
ao_one_e_ints
mo_one_e_ints
ao_two_e_ints
mo_two_e_ints
EOF
II) Installing the plugin
-------------------------
Now that we have specified the various depenencies we need now to INSTALL the plugin, which means to create the equivalent of a Makefile for the compilation.
To do it we simply do
$ qp plugins install plugin_I
III) Compiling the void plugin
------------------------------
It is customary to compile first your "void" plugin, void in the sense that it does not contain anything else than the program printing "Hello world".
To do so, just go in the plugin and execute the following command
$ ninja
It does a lot of stuffs, but it must conclude with something like
Since that it has compiled, an executable "plugin_I" has been created.
Also, if you make "ls" in the "plugin_I" you will notice that many symbolink links have been created, and among which the four modules that you included in the NEED file.
All the other modules (Ex:"ao_basis", "utils") are here because they are need by some of the four modules that you need.
In the file you will see that we simply browse the two arrays "ao_one_e_integrals" and "mo_one_e_integrals", which are global variables (providers) and we browse them until either "ao_num" or "mo_num" which are also providers representing the number of AOs or MOs.
You can check these variables with irpman !
If you recompile using "ninja" as before, and another executable has been created "print_one_e_h".
Then, you can run the program on the ezfio file by doing
We will now create new providers that manipulates the objects that we just printed.
As an example, we will compute the trace of the one electron integrals in the AO and MO basis.
In the file "traces_one_e.irp.f" you will find the several new providers among which
a) trace_mo_one_e_ints : simply the sum of the diagonal matrix element of the one-electron integrals
b) trace_ao_one_e_ints : the corresponding trace on the AO basis : Sum(m,n) S^{-1}_{mn} h_{mn}
c) trace_ao_one_e_ints_from_mo : the trace on the AO basis with the integrals obtained first from the MO basis
As explained in these files, "trace_mo_one_e_ints" is equal to "trace_ao_one_e_ints" only if the number of AO basis functions is equal to the number of MO basis functions, which means if you work with cartesian functions.
(You can check with "qp create_ezfio -h" for the option to create an EZFIO with cartesian basis functions)
In the file "print_traces_on_e.irp.f" you will find an example of executable that prints out the various providers.
Copy these two files in your plugin and recompile to execute it.
Execute the program print_traces_on_e and check for the results !