From 4572aa1661614021059a8e959263aa59b7a5e7d5 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 4 Feb 2020 19:30:04 +0100 Subject: [PATCH] Added qp_basis --- bin/qp_basis | 54 +++++++++++++++++++++ configure | 8 +-- docs/source/users_guide/qp_create_ezfio.rst | 13 +++-- 3 files changed, 63 insertions(+), 12 deletions(-) create mode 100755 bin/qp_basis diff --git a/bin/qp_basis b/bin/qp_basis new file mode 100755 index 00000000..87a04ccc --- /dev/null +++ b/bin/qp_basis @@ -0,0 +1,54 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +""" +Installs basis sets in the data directory from Basis Set Exchange. + +Usage: + qp_basis list + qp_basis get BSE_BASIS + qp_basis install BSE_BASIS QP_BASIS + + +""" + +from __future__ import print_function +import sys +import os +import subprocess + +try: + from docopt import docopt + from qp_path import QP_ROOT +except ImportError: + print("Please check if you have sourced the ${QP_ROOT}/quantum_package.rc") + print("(`source ${QP_ROOT}/quantum_package.rc`)") + sys.exit(1) + + +def main(arguments): + """Main function""" + + if arguments["list"]: + os.system("bse list-basis-sets") + + elif arguments["install"]: + bse_basis = arguments["BSE_BASIS"] + qp_basis = arguments["QP_BASIS"] + for character in """"[]{}()*&%$#!;:,<>?'|\\""": + if character in qp_basis: + print("Invalid character %s in QP_BASIS"%character) + sys.exit(1) + path = QP_ROOT+"/data/basis/"+qp_basis + os.system("bse get-basis --unc-spdf '%s' gamess_us > %s"%(bse_basis, path)) + + elif arguments["get"]: + bse_basis = arguments["BSE_BASIS"] + os.system("bse get-basis --unc-spdf '%s' gamess_us"%(bse_basis)) + + +if __name__ == '__main__': + ARGS = docopt(__doc__) + main(ARGS) + + diff --git a/configure b/configure index 7237eb96..aad2f70d 100755 --- a/configure +++ b/configure @@ -507,14 +507,8 @@ echo "If you have PIP, you can install the Basis Sex Exchange command-line tool: echo "" echo " ./configure -i bse" echo "" -echo "Format is GAMESS/US, and combined sp, spd, ... contractions should be removed." -echo "For example:" +echo "This will enable the usage of qp_basis to install extra basis sets." echo "" -echo " bse get-basis --unc-spdf STO-3G gamess_us > sto-3g" -echo "" -echo "For help, run" -echo "" -echo " bse -h" echo "" printf "\e[m\n" diff --git a/docs/source/users_guide/qp_create_ezfio.rst b/docs/source/users_guide/qp_create_ezfio.rst index 266cc32a..3fe8bc07 100644 --- a/docs/source/users_guide/qp_create_ezfio.rst +++ b/docs/source/users_guide/qp_create_ezfio.rst @@ -34,9 +34,6 @@ Usage By default, the basis set is obtained from the local database of the. |qp| This option is mandatory . - If ```` is set to ``show``, the list of all available basis - sets is displayed. - .. option:: -c, --charge= @@ -83,8 +80,8 @@ following should be used:: qp_create_ezfio -b custom.basis molecule.xyz -Basis set files should be given in |GAMESS| format, where the full -names of the atoms are given, and the basis sets for each element are +Basis set files should be given in |GAMESS| format, without combined sp, spd, ... +contractions. The full names of the atoms are given, and the basis sets for each element are separated by a blank line. Here is an example :: HYDROGEN @@ -128,6 +125,12 @@ separated by a blank line. Here is an example :: 1 0.3430000 1.0000000 +Files can be extracted from the Basis Set Exchange database +https://www.basissetexchange.org , with the ``qp_basis`` tool. + + + + Using custom pseudo-potentials ------------------------------