PREV | NEXT

Introduction to Quantum Package

HOME

Table of Contents

QP.png

1 Overview

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

2 Environment

Before using Quantum Package, the environment must be set up. This can be done by running the following command:

source /project/project_465000321/qp2/quantum_package.rc

This is automatically done when you load the complete environment for this training:

source /project/project_465000321/environment.sh

If you are using QP interactively, an alternative is to run the QP shell:

/project/project_465000321/qp2/bin/qpsh

3 Running on LUMI

Note that it is not possible to run the code interactively on the login nodes of LUMI. To run interactively, you will need to request an interactive job. Here is an example command to request a compute node for one hour:

salloc -N 1 --reservation=enccs_training --account=project_465000321 --time=01:00:00 -n 1 -c 32 --partition=standard
source /project/project_465000321/environment.sh

The salloc command creates a new shell, so if you want to use qpsh you need to run qpsh after salloc.

Once you have an interactive job, instead of using the command qp_run you will need to run qp_srun to run the QP programs.

4 The EZFIO database

Quantum Package (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.

As an example, let's consider a water molecule. First, we need to create a file with the geometry in either XYZ or Z-matrix format. For this example, we will use 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

Next, we can create an EZFIO database containing the geometry and the basis set parameters for the cc-pVDZ basis set by running the following command:

qp create_ezfio --basis=cc-pvdz h2o.xyz

This command will create a directory named h2o.ezfio, and this directory is selected as the currently used EZFIO directory in the current shell. To switch to another EZFIO database, use the command:

qp set_file other.ezfio

Note that 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 is inaccessible.

5 Using QP commands

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

qp --help

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

To run a Hartree-Fock calculation, we will use the scf program of QP. To run a QP program, normally we use qp run. On LUMI, after allocating an interactive session, you can use qp_srun. For example:

qp_srun scf h2o.ezfio | tee h2o.scf.out

This command will run the SCF calculation and save the output in the file h2o.scf.out using the Linux command tee.

The Hartree-Fock orbitals are now stored inside the EZFIO database. 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.

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 1/s/ orbitals. For that, we need to run the command

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. To run the CISD calculation, use the command:

qp_srun cisd h2o.ezfio | 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 and set using qp set. For example:

qp get determinants n_det_max
qp set determinants n_det_max 2000

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

Author: Anthony Scemama

Created: 2023-05-05 Fri 12:57

Validate