Run singlepoint (serial) | Video tutorial to single-point calculation wrapper script (2/5)

Philip Zhu
41 followers
13 Video Views·Feb 11, 2025
Video tutorial to smart single-point calculation wrapper script. Github:
https://github.com/PhilipZhu/singlepoint-energy-batch
Let me show you an example.
Let me first show you an example of a normal ORCA calculation.
Here I have an input for ORCA.
ORCA is a software that performs electronic structure calculations
and I have already installed and configured these softwares on this computer.
So I can run these ORCA calculations by doing this.
And I'm going to redirect the output to a file.
This is the system and this is the coordinate of the system that we want to calculate.
It's two hydrogen atoms.
All of these lines are following the format of ORCA requirements.
And it specifies the level of theory and charges and multiplicity of these systems.
Now we see after the calculation it generated a bunch of files.
We don't need these PNP files for now for this demo purposes.
So I'm removing them.
And we want to get the energy and that can be found in this output file.
This output file contains a lot of information and the energies can be found towards the end right here.
This is the final single point energy in Hartree.
Normally if we want to write a script to get the number, that is the energy,
we could do this.
So we can grab that line and if we just want to get this number,
we can pipe it into ORC and get the fifth column and this energy is what we wanted.
So now let's see how do we calculate the same thing using the wrapper script.
For the wrapper script I prepared an input.xyz for the same system.
I duplicated this system for multiple times so it contains six frames.
Because I wanted to show how to perform multiple calculations in one line.
So in general all these frames can be in different coordinates, different configurations,
but now I just duplicate it so they have the same configuration and they will be run independently
but they will give us the same energy.
So for this system, this is a much more general file format.
Now we can clone this ripple here and we can see two executables.
The single point executable is the main executable that we need for this demo.
It will help us calculate the single point energies.
So we run it by giving it the xyz file with charge multiplicity.
So actually I have set this script so that the charge by default is 0 and multiplicity by default is 1.
You can specify it but for this system we don't need to.
So we can just run this. I will background it and see what else is happening.
And let's run it. You can ignore this 191 first.
Let's see. It created a calculation directory and let's see this file.
So it started calculating for the frame numbered by 2 and then frame 4, frame 1, frame 5.
So it is automatically calculating for all these frames.
And they are calculating all these frames in a random order.
But after all calculation is done, the script again collects all the results from the calculations and generates an input of that.
So the input of that contains the same information here.
So the first column is the 0th frame because the frame index started from 0.
So there are 6 frames. This is the energy for each frame in Hartree.
And I have also printed the energies in kkupper mode.
And let's see what does the calculation folder have.
So first the calculation folder has these files, the log files.
That is not very important but you can delete them.
But I just redirected the standard arrow or standard out to the log files.
The important folder is the calculation folder.
And you can see in the calculation folder it created 6 folders.
That means for the input.xyz, 6 frames, it automatically generated a folder for each frame.
And inside each frame, you can see there is a config.input which is the same as what we had, what we previously had.
It automatically generated the oca input and ran it and piped it into config.stdout.
And then after it finishes, it grabs all the energies and created this input.dat.
And this is the energies for all of your configurations in this xyz file.
So that is a simple example of how to run this wrapper script.
