UP | HOME

Introduction to Quantum Package

Table of Contents

QP.png

1 Environment

Quantum Package (QP) is an open-source environment for developing easily quantum chemistry programs. It was initially designed for code developers, but it is relatively simple to use.

Before doing anything with quantum package, the environment needs to be set up

source $QP_ROOT/quantum_package.rc

where $QP_ROOT is the path to the qp2 directory.

An alternative, when using QP interactively is to run the QP shell:

$QP_ROOT/bin/qpsh

2 The 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.

Let us take an example to show how to use QP. First, we need to create a file with a geometry in xyz or z-matrix format. Let us take the water molecule, and write the coordinates in the file h2o.xyz:

3
Water
O       0.                     0.   0.
H      -0.756950272703377558   0.  -0.585882234512562827
H       0.756950272703377558   0.  -0.585882234512562827

We can now 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

When running interactively with qpsh, the current EZFIO database is displayed in the terminal. You should see |h2o.ezfio> in green before the command line. If you change directory, |h2o.ezfio> will become red, meaning that the EZFIO database in inaccessible.

3 qp commands

To get the documentation of the qp command, you can use

qp --help

Note: all QP commands come with a --help option for documentation.

To run a Hartree-Fock calculation, we will run the scf program of QP. To run a QP program, use qp run:

qp run scf | tee h2o.scf.out

Here, we have copied the standard output into the file h2o.scf.out using the tee Linux command.

The Hartree-Fock orbitals are now stored inside the EZFIO database. If you run again the scf code, you will notice that the SCF will converge in a single iteration because it takes the MOs stored inside the database as an initial guess.

Now that we have a set of Hartree-Fock orbitals, we can run a singles doubles configuration interaction (CISD) calculation. But we don't want to include the single- and double-excitations from the \(1s\) orbitals. For that, we need to run

qp set_frozen_core

The output of this command shows that orbital 1 is labelled as Core and orbitals 2-24 are labelled as Active. We can now run the CISD calculation using

qp run cisd | tee h2o.cisd.out

To modify the input parameters of the programs, you can use 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. For example:

export EDITOR=emacs

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:

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: Anthony Scemama

Created: 2022-06-20 Mon 23:33

Validate