PSI4: Example#

Here, we show you how to use the PSI4 image non-interactively.

Running PSI4 Non-interactively#

First, let’s create a temporary folder, temp in your home directory and cd to it

mkdir ~/temp && cd ~/temp

Use your favorite text editor to create a new input file. Let’s call it test.inp and copy-paste the following code block into it and then, save it.

molecule benz{
    pubchem:benzene
}

set {
   basis     sto-3g
   reference rhf
}

energy('scf')

This input file fetches the benzene molecule from the PubChem database and performs a simple self-consistent field calculation at the RHF/STO-3G level of theory. At this stage, the content of your directory should look like the following

temp
└── test.inp

It’s time to copy the docker run command from the catalog, paste it into your terminal and edit it to look like the following command line

docker run --rm -w /home -v $(pwd):/home molssi/psi4v180-mamba141:latest /bin/bash -c "psi4 test.inp"

then press Enter. If nothing goes wrong, you should see the following lines in your terminal

Searching PubChem database for benzene (single best match returned)
Found 1 result(s)

Your directory should now have the following structure

temp/
├── test.inp
├── test.log
├── test.out
└── timer.dat

Note

If you’re a pessimist, run the following command to see if the job has finished normally

grep "beer" test.out

You should see the following output in your terminal

*** Psi4 exiting successfully. Buy a developer a beer!

Note

The same Docker image recipe can also be used with Apptainer (Singularity) to obtain the same result via the following command

apptainer exec docker://molssi/psi4v180-mamba141:latest psi4 test.inp

Note that Apptainer binds /home/$USER, /tmp and current working directory ($PWD) from the host system to the running container by default. For further details see the Apptainer documentation.