Tutorial: Studying higher-harmonic generation using RT-TDDFT
We detail here the uses of PLOT-multitask.py in the tutorial Studying higher-harmonic generation using RT-TDDFT. The first command:
$ PLOT-multitask.py --preprocess --get_efield -f AVEC.OUT --x -o EFIELD.OUT
is used to obtain the x component of electric field and write it into EFIELD.OUT, taking as input a file with the vector potential AVEC.OUT.
Calling the script as
$ PLOT-multitask.py --preprocess -f EFIELD.OUT --scale 1.0 0.1 -o EFIELD-SCALED.OUT
makes it to read EFIELD.OUT, taking the data from the columns 0 1 (default of -k), scaling them by 1.0 and 0.1 (columns 0 and 1, respectively), and outputing the result into EFIELD-SCALED.OUT.
With
$ PLOT-multitask.py -f PVEC.OUT EFIELD-SCALED.OUT -c '$P(t)$' '$E(t)/10$' --ylabel 'Field [a.u.]'
we plot columns 0 and 1 (default of -k) from the files PVEC.OUT and EFIELD-SCALED.OUT. The caption of each curve is provided by -c '$P(t)$' '$E(t)/10$'. And the label of the y-axis is 'Field [a.u.]'
When we employ
$ PLOT-multitask.py --preprocess --fourier -f PVEC.OUT -o P.OUT --wcut 0.025
we obtain the fourier transform, taking as time the column 0 of PVEC.OUT. Column 1 has the data to be transformed, considering a broadening of 0.025 Ha. The output with frequencies and the transform is written into P.OUT.
The command
$ PLOT-multitask.py --preprocess -f P.OUT --scale 4.0 27.52546105147261 --handle_complex abs -o P-SCALED.OUT
scales columns 0 and 1 from P.OUT by 4.0 and 27.52546105147261, respectively. Here the argument --handle_complex abs makes sure that the data from column 1 is complex, and we consider only its absolute value. If we wanted no further treatment of the complex data, we could have used --handle_complex full.
When used as
$ PLOT-multitask.py -f P-SCALED.OUT --xlabel '$\omega/\omega_0$' --ylabel '$P(\omega)/E_m$' --xlim 0 7 --ylim 1e-5 1 --semilog
the scripts provides a semilog plot of the columns 0 and 1 from P-SCALED.OUT. We provide extra information for the panel, such as: the label for the x and y axes, and the limits for both axes.
The last use in this tutorial
$ PLOT-multitask.py -f ampl-1/P-SCALED.OUT ampl-2/P-SCALED.OUT ampl-3/P-SCALED.OUT --xlabel '$\omega/\omega_0$' --ylabel '$P(\omega)/E_m$' --xlim 0 7 --ylim 1e-5 1 --semilog
is similar to the one commented before, with the difference that more data is plotted in the same figure.