From 9b5106f5bc46154d4f4b71b3a50b9eb6fa11c4e3 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 18 Dec 2017 12:18:08 +0100 Subject: [PATCH] Update --- Parallelism.md | 8 +++++- Requirements.md | 2 +- Tutorial.md | 68 ++++++++++++++++++++++++++++++++++++------------- 3 files changed, 59 insertions(+), 19 deletions(-) diff --git a/Parallelism.md b/Parallelism.md index 304f6c3..3754b8c 100644 --- a/Parallelism.md +++ b/Parallelism.md @@ -12,7 +12,7 @@ the running program. The typical scheme is the following: -1. The program (IRPF90) asks `qp_run` to create a new queue for a state of the calculation +1. The program (Fortran) asks `qp_run` to create a new queue for a state of the calculation 2. The program adds multiple tasks to do to the queue @@ -105,3 +105,9 @@ Now, the main thread can send an `End_job` message to the scheduler to inform it that the parallel task is done. +MPI layer +--------- + +The ZeroMQ slave can be an MPI program. In that case, MPI is used to broadcast large arrays such +as the wave function, and the input data which are read only by the MPI master. But the communication +between the ZeroMQ slave and the ZeroMQ master is still done via ZeroMQ. diff --git a/Requirements.md b/Requirements.md index 921253b..3efab4a 100644 --- a/Requirements.md +++ b/Requirements.md @@ -10,4 +10,4 @@ * EMSL_Basis_Set_Exchange_Local : https://github.com/TApplencourt/EMSL_Basis_Set_Exchange_Local * Zlib : http://zlib.net * GNU patch : http://savannah.gnu.org/projects/patch -* ZeroMQ : http://zeromq.org/ \ No newline at end of file +* ZeroMQ : http://zeromq.org/ diff --git a/Tutorial.md b/Tutorial.md index f661b83..707b918 100644 --- a/Tutorial.md +++ b/Tutorial.md @@ -27,15 +27,31 @@ First, create an `xyz` file containing the coordinates of the molecule. The file N 0.0 0.0 -1.156 ``` +Note that you can also input the coordinates using a Z-matrix: + +``` + c + n 1 nc2 + h 1 hc3 2 hcn3 + +nc2 1.156 +hc3 1.064 +hcn3 180.0 + +``` + + Now, this `xyz` file is used to generate an `EZFIO` input directory using the ``qp_create_ezfio_from_xyz`` command. The main options of that command are ``` -b string Name of basis set. + [-au] Input geometry is in atomic units. [-c int] Total charge of the molecule. Default is 0. + [-cart] Compute AOs in the Cartesian basis set (6d, 10f, ...) [-d float] Add dummy atoms. x * (covalent radii of the atoms) [-m int] Spin multiplicity (2S+1) of the molecule. Default is 1. [-o file] Name of the created EZFIO file. - [-p string] Using pseudopotentials + [-p string] Name of the pseudopotential ``` To generate ``hcn.ezfio`` in the 6-31G basis set, we use:: @@ -43,25 +59,39 @@ To generate ``hcn.ezfio`` in the 6-31G basis set, we use:: `qp_create_ezfio_from_xyz -b "6-31G" hcn.xyz` -You can edit interactively the EZFIO file with all the options available for all the binaries installed using the `qp_edit` command. +With the `qp_edit` command, you can edit interactively the EZFIO file with all the options available for all the binaries installed. # Run the SCF and Full-CI calculations First, create the canonical MOs by running an SCF calculation:: + ``` qp_run SCF hcn.ezfio ``` The expected SCF energy is -92.8278567 au. -Now we want to run the Full-CI calculation. Type +In the selected FCI calculation, by default the program will stop when the 1.000.000 most important determinants are selected, or when the PT2 correction is below 1.e-4. +To make a quick test, we want to stop for 10.000 determinants. +To change this behavior, edit ``hcn.ezfio`` to modify the options of the selected Full-CI calculation:: + +``` + qp_edit hcn.ezfio +``` + +This will open a temporary file enabling the modification of the EZFIO directory. Search for the `Determinants` section, and set the ``n_det_max`` option to 10000:: + +``` + n_det_max = 10000 +``` + +Now we can run the Full-CI calculation. Type ``` qp_run fci_zmq hcn.ezfio ``` -By default, this will select the most important 10.000 determinants in the wave-function (this number is set by the `determinants/n_det_max` variable). When this point is reached, the second order perturbative correction is computed (handled by the `do_pt2_end` variable) to generate a really good approximation of the full-ci. -The variational energy should be '-93.043096' and the Full-CI approximation energy should be '-93.051924'. +The variational energy should be '-93.044945' and the Full-CI approximate energy should be '-93.052019'. # Freeze core electrons in the CI @@ -74,7 +104,7 @@ Then run the SCF ``` qp_run SCF hcn_large.ezfio ``` -The expected SCF energy is -92.8832967. +The expected SCF energy is -92.8829467. We want to run the selected Full-CI calculation in the valence only. For this, we will use the ``qp_set_mo_class`` utility. The options are ``` @@ -86,15 +116,20 @@ We want to run the selected Full-CI calculation in the valence only. For this, w ``` We set 2 first canonical orbitals as `core` and all the remaining MOs are set as active :: + ``` - qp_set_mo_class hcn_large.ezfio -core "[1,2]" -act "[3-35]" + qp_set_mo_class hcn_large.ezfio -core "[1,2]" -act "[3-33]" ``` or we can do it automatically: + ``` qp_set_frozen_core.py hcn_large.ezfio ``` +The `qp_set_frozen_core.py` script finds the heavy atoms and proposes a set of +core and active MOs. For atoms with few electrons in the valence such as Li or +Na, the script will propose a small core. Then, edit ``hcn_large.ezfio`` to modify the options of the selected Full-CI calculation:: ``` @@ -102,26 +137,25 @@ Then, edit ``hcn_large.ezfio`` to modify the options of the selected Full-CI cal ``` This will open a temporary file enabling the modification of the EZFIO directory. Search for the `Determinants` section, and set the ``n_det_max`` option to 10000:: + ``` n_det_max = 10000 ``` -De-activate the calculation of the PT2-energy:: -``` - do_pt2_end = false -``` + And run the Full-CI calculation:: + ``` qp_run fci_zmq hcn_large.ezfio ``` -The expected variational energy is -93.16819314. + +The expected variational energy is -93.16482111. From the current wave function, we can generate the corresponding natural orbitals:: + ``` qp_run save_natorb hcn_large.ezfio ``` -Re-activate the calculation of the PT2-energy using qp_edit:: -``` - do_pt2_end = true -``` -And run the calculation again. The expected variational energy is -93.176409148 and the energy + the PT2 contribution is -93.194541427. + +and run the selected FCI calculation again. +The expected variational energy is -93.172895441 and the energy + the PT2 contribution is -93.19059084.