Skip to content
MartinPeschel edited this page Jun 20, 2024 · 9 revisions

General setup

The full tutorial we follow is found here: Tutorial. We will only give a rough outline here, and focus on differences when running with the FermiONs++ interface on the Ochsenfeld cluster. There is a module for SHARC and a corresponding conda environment. Before we start our simulations, we load these

unset MODULEPATH
source /opt/sw/Modules/4.7.1/init/bash
module load conda-venvs/3.11.7-latest
module load sharc/peschel-20240613

and execute

ls $SHARC

to see all the beautiful python3 scripts that SHARC provides.

Disclaimer

The quantum chemical method chosen here is NOT appropriate for the system under study! Do not simulate the photorelaxation of iminium ions after hard UV excitation using TDA-PBE/def2-SVP. We only chose this example to be consistent with the tutorial from the SHARC website. We will see later on, why TDA is not a good choice for this problem.

General Information

Many of the SHARC scripts are interactive. When you run $SHARC/my_script.py, there will be a file called KEYSTROKES.my_script. These document your inputs and are overwritten when you rerun the script. If you want to rerun a script with slightly modified inputs, you can modify the file and run cat KEYSTROKES.my_script | $SHARC/my_script.py.

Initial Conditions

Create a molden file from a Frequency Analysis of your Molecule of Interest: freq.mld. For larger systems, it might be more advisable to sample from a groundstate MD trajectory instead ($SHARC/amber_to_initconds.py, $SHARC/fermions_to_initconds.py (experimental, check command line options)) For the Tutorial: Download the file and place it in an empty folder. The initial conditions calculations and trajectories will be run in this folder and its subfolders. First, draw 50 samples from a Wigner distribution.

$SHARC/wigner.py -n 50 freq.mld 

Now we will set up the actual calculation. Download and inspect the PyFermions input: Fermions_config.py Be aware that SHARC does not check the setting in this file and should enable a calculation of all the things that SHARC needs (except wavefunction overlaps). That means nroots + 1 should be at least equal to the largest number of states for any multiplicity (but can be greater). trans_dipoles should be true. If you have triplet states, soc and triplets should be true. Since I did not write a proper basis set conversion from fermions to cis_nto, you need to provide your chosen basis set in turbomole format. Download it from basis set exchange or get the file for the tutorial here basis.

Execute

$SHARC/setup_init.py

and navigate through the interactive script (KEYSTROKES.setup_init). After a successful run, you should have directories ICOND_00000 to ICOND_00100. To run the calculations in these folders, via a slurm-batch script, download make_tasklist.sh and submit_tasklist.sh and run

bash make_tasklist.sh
sbatch submit_tasklist.sh

Inspect the QM.out files in the ICOND_* directories.

Selection of initial excited states

If they are all present, we can interactively select the states where we want to start the dynamics (KEYSTROKES.excite).

$SHARC/excite.py

The state selection will be saved in the initconds.excited file. We can then obtain a semiclassical UV/Vis spectrum by running

$SHARC/spectrum.py -e 5 12 initconds.excited

The output spectrum.out can be plotted using a plotting tool of your choice.

Setting up dynamics simulations

The directories can be set up using the interactive script

$SHARC/setup_traj.py

(KEYSTROKES.setup_traj). This creates directories called Singlet_x where x is your initial state. Inside are the directories for the trajectories, TRAJ_000XX. Inside are a lot of files, we will talk about input, geom, veloc, run.sh, runSHARC.sh, QM/runQM.sh.

Running the trajectories

The trajectories can be run by executing the run.sh scripts. Do this by running (appropriately modified)

bash make_tasklist.sh
sbatch submit_tasklist.sh

The TRAJ_000XX directories then contain output.xxx and restart.xxxx. We inspect output.log, output.lis, output.xyz. output.dat contains compressed data that can be decompressed using $SHARC/data_extractor.x output.dat. Trajectories can be restarted by adding restart and restart_rerun_last_qm_step (in case of a crash that was fixed) or restart_goto_new_qm_step in case you want to extend a successful trajectory (increased tmax).

Diagnostics on (running and finished) trajectories can be obtained interactively by running

$SHARC/diagnostics.py

KEYSTROKES.diagnostics

Analysing single trajectories

Go into one trajectory directory and execute

$SHARC/data_extractor.x output.dat
$SHARC/make_gnuscript.py 4 0 3 > plot.gp

Have a look by running

gnuplot plot.gp

The motion can be looked at by opening output.xyz using any molecular viewer that can read an XYZ file containing multiple structures (RECOMMEND: vmd, OK: molden, FAIL: chemcraft, gaussview). Internal coordinates can be extracted using

$SHARC/geo.py -g output.xyz -t 0.5 > geo.out

Analysing the trajectory ensemble

Population plots (KEYSTROKES.populations):

$SHARC/populations.py

Transition Matrizes (KEYSTROKES.transition):

$SHARC/transition.py

Population Fits:

$SHARC/make_fit.py

Crossing geometries (KEYSTROKES.crossing):

$SHARC/crossing.py