PREV | NEXT

Getting Started with Quantum Package

HOME

Table of Contents

QP.png

1 Introduction

Welcome to Quantum Package (QP), an open-source environment for developing quantum chemistry programs. QP is designed to be user-friendly and easy to use, while still providing powerful tools for quantum chemistry calculations. In this tutorial, we will guide you through the basics of using QP, including setting up the environment, creating an EZFIO database, and running calculations.

2 Environment Setup

Before using QP, you need to set up the environment. QP requires a few environment variables to be set, so that it can find the necessary libraries and programs. Here's how you can set up the environment:

  1. Clone QP from https://github.com/QuantumPackage/qp2
  2. Install the dependencies and configure the compilation by running:
./configure -i all
./configure -c ./config/gfortran_avx.cfg
source quantum_package.rc
ninja

Note that $QP_ROOT refers to the qp2 directory.

You can use your shell, or alternatively the QP shell to interact with QP. Here's how you can start the QP shell:

qpsh

Now you're ready to start using QP!

3 Creating an EZFIO Database

QP stores input and output data in a database, called the EZFIO directory. To interact with the database, QP provides multiple shell functions, scripts, and programs. Here's how you can create an EZFIO database:

  1. Create a file with a molecular geometry in either xyz or z-matrix format. For example, let's create a file for the water molecule in xyz format:
3
Water
O       0.                     0.   0.
H      -0.756950272703377558   0.  -0.585882234512562827
H       0.756950272703377558   0.  -0.585882234512562827
  1. Create an EZFIO database containing the geometry and the basis set parameters for the cc-pVDZ basis set:
qp create_ezfio --basis=cc-pvdz h2o.xyz

A directory named h2o.ezfio has been created, and is selected as the currently used EZFIO directory in the current shell. To switch to another EZFIO database, use

qp set_file other.ezfio

Note that when running interactively with qpsh, the current EZFIO database is displayed in the terminal prompt.

The EZFIO database is a directory containing subdirectories. Each subdirectory contains files. Each data is stored in a text file:

$ ls h2o.ezfio/
ao_basis              davidson         mol_properties     qmcchem
ao_one_e_ints         density_for_dft  mo_one_e_ints      scf_utils
ao_two_e_erf_ints     determinants     mo_two_e_erf_ints  tc_keywords
ao_two_e_ints         dft_keywords     mo_two_e_ints      trexio
basis                 dressing         mpn                two_body_rdm
becke_numerical_grid  electrons        mu_of_r            utils
cc_utils              ezfio            nuclei             utils_cc
cipsi                 fci_tc_bi        perturbation       utils_trust_region
cipsi_tc_bi_ortho     general_mrci     pseudo             work
$ ls h2o.ezfio/ao_basis/
ao_basis      ao_expo.gz     ao_nucl.gz   ao_prim_num.gz
ao_cartesian  ao_md5         ao_num       primitives_normalized
ao_coef.gz    ao_normalized  ao_power.gz
$ cat h2o.ezfio/ao_basis/ao_num
                  25

4 Running Calculations

Now that you have an EZFIO database, you can use QP to run calculations. Here's how you can run a Hartree-Fock calculation:

qp run scf | tee h2o.scf.out

This will run the SCF program of QP and save the standard output to the file h2o.scf.out. The Hartree-Fock orbitals are stored inside the EZFIO database, so if you run the SCF code again, it will converge in a single iteration because it takes the MOs stored inside the database as an initial guess.

To run a singles doubles configuration interaction (CISD) calculation, you can use the following commands:

qp set_frozen_core
qp run cisd | tee h2o.cisd.out

The qp set_frozen_core command is used to exclude the single- and double-excitations from the core s orbitals. The output of this command shows that orbital 1 is labeled as Core and orbitals 2-24 are labeled as Active.

You can modify the input parameters of the programs using the interactive command qp edit. This will open a temporary file filled-in with data coming from the EZFIO database. When the file is saved and the editor is exited, the data is saved back into the EZFIO.

You can change the text editor used by qp edit by setting the EDITOR environment variable to the desired editor, for example, to use Emacs as the editor, run export EDITOR=emacs before running the qp edit command.

Alternatively, all the input parameters can be inspected in the shell using qp get, for example:

qp get determinants n_det_max

The parameters can be set in the shell using qp set, for example:

qp set determinants n_det_max 2000

You can use Tab-completion with the qp command, which makes the shell interaction more user-friendly.

Author: A. Ammar, E. Giner, P.-F. Loos, A. Scemama

Created: 2023-04-19 Wed 07:10

Validate