Tutorial:Time-dependent run

From OctopusWiki

Jump to: navigation, search

OK, it is about time to do TDDFT. Let us perform a calculation of the time evolution of the density of the Methane molecule. The reason to do ground-state DFT is that for any time-dependent calculation you will need first to do a ground-state calculation. You may start from the calculation that you have just done (Methane molecule).

Input

Once that you have a proper ground-state (stored in the restart directory), you should switch on a new run mode, CalculationMode = td, and add a few more variables to the input file:

CalculationMode = td
Units = eV_Angstrom

radius = 3.5
spacing = 0.175

CH = 1.094
%Coordinates
  "C" |           0 |          0 |           0
  "H" |  CH/sqrt(3) | CH/sqrt(3) |  CH/sqrt(3)
  "H" | -CH/sqrt(3) |-CH/sqrt(3) |  CH/sqrt(3)
  "H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)
%
 
T  = 0.1
dt = 0.002

TDEvolutionMethod = aetrs
TDMaximumIter = T/dt
TDTimeStep = dt

If you run Octopus, it will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are

Input: [RelativisticCorrection = non_relativistic]
Input: [TDGauge = length]
Input: [AbsorbingBoundaries = no_absorbing]
Input: [MoveIons = static_ions]
Input: [TDEvolutionMethod = aetrs]
Input: [TDExponentialMethod = taylor]

********************* Time-Dependent Simulation **********************
  Iter           Time        Energy     Elapsed Time
**********************************************************************

      1       0.002000   -218.716014         0.327
      2       0.004000   -218.716014         0.329
      3       0.006000   -218.716014         0.231
      4       0.008000   -218.716014         0.229
...
     50       0.100000   -218.716014         0.228

             Calculation ended on 2008/01/04 at 15:07:48

It is worthwhile to comment on a few things:

  • We have just performed the time-evolution of the system, departing from the ground-state, under the influence of no external perturbation. As a consequence, the electronic system does not evolve. The total energy does not change (this you may already see in the output file, the third column of numbers), nor should any other observable change. However, this kind of run is useful to check that the parameters that define the time evolution are correct.
  • As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory td.general, which should show up in the working directory. In this case, only two files show up, the td.general/energy, and the td.general/multipoles files. The td.general/multipoles file contains a large number of columns of data. Each line corresponds to one of the time steps of the evolution (except for the first three lines, that start with a # symbol, which give the meaning of the numbers contained in each column, and their units). A brief overview of the information contained in this file follows:
    • The first column is just the iteration number.
    • The second column is the time.
    • The third column is the dipole moment of the electronic system, along the x\, direction: \langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle =    \int\!\!{\rm d}^3r\; x\,n(r). Later columns show general electronic moments; the reason for singling out this specific dipole here is explained later.
    • The following columns present the multipoles of the system: \langle \Phi (t) \vert \hat{M}_{lm} \vert \Phi(t)\rangle =    \int\!\!{\rm d}^3r\; r^lY_{lm}(r)\,n(r). The index l\, runs, in this case, from zero to one, but higher order moments may be printed by making use of the input variable TDDipoleMax. Note that the first multipole is the monopole: \,(l,m)=(0,0) -- i.e. the charge, except for a 1/4\pi\, factor. The file td.general/energy contains the different components of the total energy.
  • The meaning of the three new variables that we have introduced in the input file is rather obvious: TDEvolutionMethod establishes which algorithm will be used to approximate the evolution operator; TDMaximumIter tells the code how may time steps to perform; and TDTimeStep fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, T and dt. We have made use of one of the possible propagators, aetrs. The manual explains about the possible options; in practice this choice is usually good.
  • It is possible to restart a time-dependent run. Just increase the value of TDMaximumIter and rerun Octopus. If, however, you want to start the evolution from scratch, you should set the variable FromScratch to yes.

The time step

A key parameter is, of course, the time step. Before making long-scale calculations, it is worthwhile spending some time choosing the largest time-step possible. This time-step depends crucially on the system under consideration, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. In this example, try to change the time-step and to restart the time-evolution. You will see that 0.002 is basically the largest time-step that you can use -- otherwise, the propagation gets unstable and the total energy of the system is no longer conserved (very often it diverges rapidly).

Also, there is another input variable that we did not set explicitly, relying on its default value, TDExponentialMethod. Since most propagators rely on algorithms to calculate the action of the exponential of the Hamiltonian, one can specify which algorithm can be used for this purpose.

You may want to learn about the possible options that may be taken by TDExponentialMethod, and TDEvolutionMethod -- take a look at the manual. You can now try some exercises:

  • Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (for example, the three polynomial schemes: standard, Chebyshev and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.
  • And fixing now the TDExponentialMethod, one can now play around with the various propagators (note that the ones based on the split-operator idea do not rely on any exponential method but their own).

Laser fields

Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file is now (note that we changed the value of some variables from the previous input)

FromScratch = yes

T  = 1
dt = 0.002
 
TDEvolutionMethod = aetrs
TDMaximumIter = T/dt
TDTimeStep = dt

amplitude = 1
omega = 18.0
tau0 = 0.5
t0 = tau0
%TDExternalFields
  electric_field | 1 | 0 | 0 | omega | "envelope_cos"
%

%TDFunctions

 "envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0

%

TDOutput = laser + multipoles

The most important variable here is the TDExternalFields block. You should carefully read the manual page dedicated to this variable: the particular laser pulse that we have employed is the one whose envelope function is a cosine.

Laser field used in the tutorial
Enlarge
Laser field used in the tutorial

Now you are ready to setup a run with a laser field. Be careful to set a total time of propagation able to accommodate the laser shot, or even more if you want to see what happens afterwards. You may also want to consult the meaning of the variable TDOutput.

A couple of important comments:

  • You may supply several laser pulses: simply add more lines to the TDExternalFields block.
  • The laser field is printed in the file td.general/laser.
  • You can have an idea of the response to the field by looking at the dipole moment in the td.general/multipoles.
  • When an external field is present, one may expect that unbound states may be excited, leading to ionization. In the calculations, this is reflected by density reaching the borders of the box. In these cases, the proper way to proceed is to setup absorbing boundaries (variables AbsorbingBoundaries, AbWidth and AbHeight).

Previous Tutorial:Benzene molecule - Next Tutorial:Optical Spectra from TD

Back to Tutorial

Personal tools