Tutorial -- UV/Vis Absorption Spectroscopy with DR-TDDFT

Performing a parallel relativistic calculation of excitation energies and UV/Vis electronic absorption spectra (EAS) with damped-response TDDFT (DR-TDDFT), known also as complex polarization propagator TDDFT (CPP-TDDFT), is a simple two-step process

respect --scf --inp=my-input-file --nt=4 --scratch=/path/to/scratch/directory
respect --cpp --inp=my-input-file --nt=4 --scratch=/path/to/scratch/directory

The first call of respect with the argument --scf performs the self-consistent field (SCF) optimization of ground-state molecular orbitals, which is a necessary prerequisite for the following property calculation. The second call of respect with the argument --cpp actually performs the DR-TDDFT EAS simulation.

The other arguments mandatory to respect are

  • --inp
    specifies a name of the input file;

  • --nt
    specifies the number of physical cores required for parallel execution;

  • --scratch
    specifies a path to the scratch directory.

The input file my-input-file.inp should contain the input block scf: with some SCF-specific keywords, and the input block cpp: with some EAS-specific keywords. A comprehensive list of all keywords can be found for SCF here and for EAS here. A simple example of my-input-file.inp looks like

#SCF section
#DFT calculation of H2S molecule, employing the relativistic 2c
#amfX2C Hamiltonian, PBE0 functional and uncontracted cc-pvdz basis
scf:

    geometry:
        S        0.000000         0.000000         0.000000
        H        0.000000         0.000000         1.336000
        H        1.335103         0.000000        -0.048956

    method: ks-amfX2C/pbe0

    basis:
          H: ucc-pvdz
          S: ucc-pvdz

    charge:        0
    multiplicity:  1
    maxiterations: 30
    nc-model:      gauss
    convergence:   1.0e-6


#DR-TDDFT section
cpp:
    property:      eas
    maxiterations: 30
    convergence:   1.0e-4

    units:       ev
    damping:     0.1
    frequencies: 6.0 81x0.1  #81 frequency points with step 0.1 starting from 6.0 eV

Final output data from the DR-TDDFT calculation are saved in file my-input-file.out_cpp. Of relevance for EAS are absorption intensities, which are listed for all user-selected frequency points in the last column of a table at the bottom of the output file

Freq           Freq          Real part      Imag part    Polarizability     EAS
[au]           [eV]             [au]           [au]          [au]           [au]
----------------------------------------------------------------------------------
0.22050        6.00000       18.93943        0.22264       18.93943        0.00450
0.22417        6.10000       19.16782        0.25123       19.16782        0.00516
0.22785        6.20000       19.41202        0.28466       19.41202        0.00595
0.23152        6.30000       19.69815        0.32143       19.69815        0.00682
0.23520        6.40000       20.03665        0.38447       20.03665        0.00829
..................................................................................
0.49979       13.60000      -19.17521        3.44860      -19.17521        0.15805
0.50347       13.70000      -16.06140        2.92444      -16.06140        0.13502
0.50714       13.80000      -13.37748        2.54420      -13.37748        0.11832
0.51082       13.90000      -11.00911        2.26683      -11.00911        0.10618
0.51449       14.00000       -8.87109        2.06780       -8.87109        0.09756

These data can be used to plot the final EAS spectrum. For instance, the simple Linux command grep and the gnuplot program can be used to extract the table and to visualize the EAS spectrum.

grep -A87 'Final isotropic' my-input-file.out_cpp | tail -n +8 > spectrum.out
gnuplot -e "set xlabel 'Freq [ev]'; set ylabel 'Intensity [au]'; plot 'spectrum.out' using 2:6 smooth mcspline w lines; pause -1" 

EAS-UVVis

Finally, note that 81 frequencies from the example above will be treated together. Having more points helps the convergence and enables to cover the whole spectral region of interest. However, adding more points makes the calculation run longer and require more memory, while the convergence is not markedly improved beyond a certain number of points. Therefore, it is recommended to find some compromise and partition the spectral region into several smaller ones containing e.g. 20 to 50 points, and run these few calculations in parallel.

Finally, there are several important aspects associated with the input syntax, namely

  • the input is case-insensitive
    This means that the program does not distinguish between uppercase and lowercase letters.

  • the input is insensitive to the number of blank lines and/or comment lines
    All comments begin with the number sign (#), can start anywhere on a line and continue until the end of the line.

  • the input is compliant with the dictionary syntax of the YAML markup language
    This means that each input line is represented either by a single block: statement or by a simple keyword:value pair, such as

  • block1:
        keyword1: value1 
        keyword2: value2  
        ...
        block2: 
          keyword3: value3
          keyword4: value4
          ...
        block3: 
               keyword5: value5
               keyword6: value6
               ...
    

    It is essential to remember that all members of one block: are lines beginning at the same indentation level. Whitespace indentation is used to denote the block structure; however, tab characters are never allowed as indentation. The only exception to the YAML-based input syntax is the block geometry: which utilizes a simple xyz format for the molecular geometry specification.


TIPS & TRICKS

Q: How to scale the speed of light in the DR-TDDFT calculation?

Set the cscale option in the SCF calculation. The scaling value is then automatically transferred to the DR-TDDFT calculation.

Q: Is it possible to scale spin-orbit interaction in the DR-TDDFT calculation?

No. Currently this feature is not supported.

Q: Is there a way to launch DR-TDDFT calculations without the need to explicitly setup the scratch path by "--scratch=/path/to/scratch/directory"?

Yes, the argument "--scratch=/path/to/scratch/directory" can be saved to the file .respectrc in your home directory. If both the file and the command line argument exist, then ReSpect takes the scratch directory setting from the command line.

Q: How to restart a DR-TDDFT calculation?

DR-TDDFT calculations can be restarted simply by creating the symbolic link to the data file of the previous job

ln -sf my-old-job.50 my-new-job.50

and by adding an extra argument --restart to the command line when restarting new job

respect --cpp --inp=my-new-job --nt=4 --scratch=/path/to/scratch/directory --restart

The restart process build on the previously converged or uncoverged solution and starts new iteration cycle. If nothing was stored during a previous calculation (e.g. a job time out occured before it got to the given cartesian component), a calculation will start from the standard initial guess

Q: Is it possible to recover a DR-TDDFT job from a scratch directory?

If the ReSpect job for any reason fails and the scratch directory is still accessible, it is possible to recover the failed calculation. After running the command

respect --recover-job=/path/to/scratch/directory

file respect_checkpoint_file.50 will be created in the current directory. Using this file, you can now restart the DR-TDDFT calculation as described in the tip How to restart a DR-TDDFT calculation?.


Latest Posts


Useful Links

Our Contacts

Hylleraas Centre
Department of Chemistry
UiT The Arctic University of Norway
Tromsø, NO-9037 Norway
Email: info@respectprogram.eu