From cdd3d360c74b0acc68efd289c78e2b002c4d6dda Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sat, 15 Jul 2017 18:09:56 +0200 Subject: [PATCH 1/5] QMCPACK (#210) * Removed qmcpack * Solved bug for large calculations * Fixed QMCPACK interface --- plugins/QMC/qp_convert_qmcpack_to_ezfio.py | 7 ++++++- plugins/qmcpack/NEEDED_CHILDREN_MODULES | 1 - plugins/qmcpack/README.rst | 15 --------------- 3 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 plugins/qmcpack/NEEDED_CHILDREN_MODULES delete mode 100644 plugins/qmcpack/README.rst diff --git a/plugins/QMC/qp_convert_qmcpack_to_ezfio.py b/plugins/QMC/qp_convert_qmcpack_to_ezfio.py index 41204448..5d63f191 100755 --- a/plugins/QMC/qp_convert_qmcpack_to_ezfio.py +++ b/plugins/QMC/qp_convert_qmcpack_to_ezfio.py @@ -350,7 +350,12 @@ psi_coef = psi_coef[state] encode = 8*bit_kind -decode = lambda det: ''.join("{0:b}".format(i)[::-1].ljust(encode,'0') for i in det)[:mo_num] +def bindigits(n, bits): + s = bin(n & int("1"*bits, 2))[2:] + return ("{0:0>%s}" % (bits)).format(s) + +decode = lambda det: ''.join(bindigits(i,encode)[::-1] for i in det)[:mo_num] + for coef, (det_a, det_b) in zip(psi_coef, psi_det): print coef diff --git a/plugins/qmcpack/NEEDED_CHILDREN_MODULES b/plugins/qmcpack/NEEDED_CHILDREN_MODULES deleted file mode 100644 index e2422607..00000000 --- a/plugins/qmcpack/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -AO_Basis Determinants Hartree_Fock diff --git a/plugins/qmcpack/README.rst b/plugins/qmcpack/README.rst deleted file mode 100644 index b49b2144..00000000 --- a/plugins/qmcpack/README.rst +++ /dev/null @@ -1,15 +0,0 @@ -======= -qmcpack -======= - -Normalize the AO basis using GAMESS convention and save it inside the EZFIO. -Then the python script is called. - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. From 94893acab6fee59e764c7970a104cee11ea11f56 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 17 Jul 2017 08:33:26 -0500 Subject: [PATCH 2/5] Add Pt in Element.ml --- ocaml/Element.ml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ocaml/Element.ml b/ocaml/Element.ml index df85663f..ebfd5e17 100644 --- a/ocaml/Element.ml +++ b/ocaml/Element.ml @@ -10,6 +10,7 @@ type t = |Na|Mg |Al|Si|P |S |Cl|Ar |K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr |Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe + |Pt with sexp let of_string x = @@ -69,6 +70,7 @@ let of_string x = | "Te" | "Tellurium" -> Te | "I" | "Iodine" -> I | "Xe" | "Xenon" -> Xe +| "Pt" | "Platinum" -> Pt | x -> raise (ElementError ("Element "^x^" unknown")) @@ -128,6 +130,7 @@ let to_string = function | Te -> "Te" | I -> "I" | Xe -> "Xe" +| Pt -> "Pt" let to_long_string = function @@ -186,6 +189,7 @@ let to_long_string = function | Te -> "Tellurium" | I -> "Iodine" | Xe -> "Xenon" +| Pt -> "Platinum" let to_charge c = @@ -245,6 +249,7 @@ let to_charge c = | Te -> 52 | I -> 53 | Xe -> 54 + | Pt -> 78 in Charge.of_int result @@ -304,6 +309,7 @@ let of_charge c = match (Charge.to_int c) with | 52 -> Te | 53 -> I | 54 -> Xe +| 78 -> Pt | x -> raise (ElementError ("Element of charge "^(string_of_int x)^" unknown")) @@ -364,6 +370,7 @@ let covalent_radius x = | Te -> 1.38 | I -> 1.39 | Xe -> 1.40 + | Pt -> 1.30 in Units.angstrom_to_bohr *. (result x) |> Positive_float.of_float @@ -425,6 +432,7 @@ let vdw_radius x = | Te -> 2.06 | I -> 1.98 | Xe -> 2.16 + | Pt -> 1.75 in Units.angstrom_to_bohr *. (result x) |> Positive_float.of_float @@ -486,6 +494,7 @@ let mass x = | Te -> 127.60 | I -> 126.90447 | Xe -> 131.293 + | Pt -> 195.084 in result x |> Positive_float.of_float From c56c48ba6e6f8c801c15e67b89e435c8fe5cefe8 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 17 Jul 2017 08:37:18 -0500 Subject: [PATCH 3/5] Update Element.mli --- ocaml/Element.mli | 1 + 1 file changed, 1 insertion(+) diff --git a/ocaml/Element.mli b/ocaml/Element.mli index 2c899b3b..e78a57ad 100644 --- a/ocaml/Element.mli +++ b/ocaml/Element.mli @@ -7,6 +7,7 @@ type t = |Na|Mg |Al|Si|P |S |Cl|Ar |K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr |Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe + |Pt with sexp (** String conversion functions *) From 68da8654fc954712d4346be4af44832e74acada5 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 17 Jul 2017 08:53:49 -0500 Subject: [PATCH 4/5] Update README.md --- README.md | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b593c54f..831f1e29 100644 --- a/README.md +++ b/README.md @@ -32,27 +32,21 @@ Demo ### 1) Configure - $ ./configure (--production | --development) - -For example you can type `./configure config/gfortran.cfg --production` + $ ./configure + +For example you can type `./configure config/gfortran.cfg` This command has two purposes : - Download and install all the requirements. Installing OCaml and the Core library may take some time (up to 20min on an old machine). - Create the file which contains all the dependencies for the binaries. - It's not a Makefile, but a Ninja file (so don't type `make` is hopeless, type `ninja` instead) + It's not a Makefile, but a Ninja file (so don't type `make` it's hopeless, type `ninja` instead) -####Compilation Flags (``) +#### Compilation Flags (``) `` is the path to the file which contains all the compilation flags (optimization flags, Lapack libary, etc). There are two example configure files in ``$QP_ROOT/config`` : ``ifort.cfg`` and ``gfortran.cfg``. You can copy these files to create a new file adapted to your architecture. -#### What utilization of the code will you do? - -* If you only want the binaries (for production workflow) use the flag - `--production`. It compiles faster. -* Else if you are a developer and you want to be able to compile specific modules use: `--development`. It will create the `build.ninja` in each module. - ### 2) Load environment variables source quantum_package.rc @@ -75,21 +69,13 @@ Usage: ### 3) Compiling the Fortran -Just type `ninja` if you are in `$QP_ROOT` (or `ninja -f $QP_ROOT/build.ninja` elsewhere). The compilation will take approximately 3 min. - -If you have set the `--developement` flag you can go in any module directory and run `ninja` to build only this particular module. You can type `ninja all` in a module to compile all the submodules. - - -### 4) Compiling the OCaml - - make -C $QP_ROOT/ocaml +Just type `ninja` if you are in `$QP_ROOT`. The compilation will take approximately 3 min. ### 5) Testing if all is ok cd tests ; ./run_tests.sh - # Note on EZFIO.cfg ##Format specification : @@ -135,19 +121,23 @@ doc: Calculated HF energy interface: ezfio ``` -#FAQ +# FAQ + +### My hartree-Fock segfault ! + +A old version of Lapack have a bug. Just relax your convergence criterium + ### Error: ezfio_* is already defined. #### Why ? -You have two or more ezfio configuration files for the same variable. Check files in `$QP_ROOT/install/EZFIO/config/` +You have two or more ezfio configuration files for the same variable. Check files in `$QP_ROOT/install/EZFIO/config/` and the all the `EZFIO.cfg`. #### Fix - rm $QP_ROOT/install/EZFIO/config/* - ninja - ### Error: Seg Fault (139) From 6c99b7aad12d20c0853791c29aae37b5a3d9510a Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 17 Jul 2017 08:54:47 -0500 Subject: [PATCH 5/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 831f1e29..eebb67dd 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Just type `ninja` if you are in `$QP_ROOT`. The compilation will take approximat # Note on EZFIO.cfg -##Format specification : +## Format specification: ``` Required: @@ -105,7 +105,7 @@ Optional: (by default is ) ``` -##Example of EZFIO.cfg: +## Example of EZFIO.cfg: ``` [thresh_SCF] @@ -150,7 +150,7 @@ Program exited with code 139. It's caused when we call the DGEMM routine of LAPACK. -##### Fix +#### Fix Set `ulimit -s unlimited`, before runing `qp_run`. It seems to fix the problem.