https://octopus-code.org/mediawiki/api.php?action=feedcontributions&user=Fnog&feedformat=atomOctopusWiki - User contributions [en]2021-01-27T11:06:25ZUser contributionsMediaWiki 1.33.0https://octopus-code.org/mediawiki/index.php?title=Tutorial:Time-dependent_propagation&diff=8564Tutorial:Time-dependent propagation2016-09-12T14:26:38Z<p>Fnog: /* Input */</p>
<hr />
<div>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 usually for a real-time calculation you will need first to do a ground-state calculation to set the initial conditions.<br />
<br />
== Input ==<br />
<br />
Run the input file below to obtain a proper ground-state (stored in the <tt>restart</tt> directory) as from a [[Tutorial:Methane_molecule | previous tutorial]]. (Now we are using a more accurate bond length than before.)<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.097<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
T = 0.1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
Then switch on a new run mode, {{variable|CalculationMode|Calculation_Modes}} <tt>= td</tt> instead of <tt>gs</tt>, to do a time-dependent run. {{octopus}} will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are<br />
<br />
<pre><br />
Input: [IonsConstantVelocity = no]<br />
Input: [Thermostat = none]<br />
Input: [MoveIons = no]<br />
Input: [TDIonicTimeScale = 1.000]<br />
Input: [TDTimeStep = 0.2000E-02 hbar/eV]<br />
Input: [TDPropagationTime = 0.1000 hbar/eV]<br />
Input: [TDMaxSteps = 50]<br />
Input: [TDDynamics = ehrenfest]<br />
Input: [TDPropagator = aetrs]<br />
Input: [TDExponentialMethod = taylor]<br />
</pre><br />
...<br />
<pre><br />
********************* Time-Dependent Simulation **********************<br />
Iter Time Energy SC Steps Elapsed Time<br />
**********************************************************************<br />
<br />
1 0.002000 -218.785409 1 0.064<br />
2 0.004000 -218.785409 1 0.060<br />
3 0.006000 -218.785409 1 0.067<br />
</pre><br />
...<br />
<pre><br />
49 0.098000 -218.785409 1 0.062<br />
50 0.100000 -218.785409 1 0.072<br />
</pre><br />
<br />
It is worthwhile to comment on a few things:<br />
<br />
* 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.<br />
* As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory {{file|td.general}}, which should show up in the working directory. In this case, only two files show up, the {{file|td.general/energy}}, and the {{file|td.general/multipoles}} files. The {{file|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 <tt>#</tt> 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:<br />
** The first column is just the iteration number.<br />
** The second column is the time.<br />
** The third column is the dipole moment of the electronic system, along the <math>x</math>-direction: <math><br />
\langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle = <br />
\int\!\!{\rm d}^3r\; x\,n(r)<br />
</math>. Next are the <math>y</math>- and <math>z</math>-components of the dipole moment.<br />
** The file {{file|td.general/energy}} contains the different components of the total energy.<br />
<br />
* The meaning of the three new variables that we have introduced in the input file is rather obvious: {{variable|TDPropagator|Time-Dependent}} establishes which algorithm will be used to approximate the evolution operator; {{variable|TDMaxSteps|Time-Dependent}} tells the code how may time steps to perform; and {{variable|TDTimeStep|Time-Dependent}} fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, <tt>T</tt> and <tt>dt</tt>. We have made use of one of the possible propagators, <tt>aetrs</tt>. The manual explains about the possible options; in practice this choice is usually good except for very long propagation where the <tt>etrs</tt> propagator can be more stable.<br />
<br />
* It is possible to restart a time-dependent run. Try that now. Just increase the value of {{variable|TDMaxSteps|Time-Dependent}} and rerun {{octopus}}. If, however, you want to start the evolution from scratch, you should set the variable {{variable|FromScratch|Execution}} to <tt>yes</tt>.<br />
<br />
== The time step ==<br />
<br />
A key parameter is, of course, the time step, {{variable|TDTimeStep|Time-Dependent}}. Before making long calculations, it is worthwhile spending some time choosing the largest time-step possible, to reduce the number of steps needed. This time-step depends crucially on the system under consideration, the spacing, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. <br />
<br />
In this example, try to change the time-step and to rerun the time-evolution. Make sure you are using {{variable|TDMaxSteps|Time-Dependent}} of at least 100, as with shorter runs an instability might not appear yet. You will see that for time-steps larger than <tt>0.0024</tt> the propagation gets unstable and the total energy of the system is no longer conserved. Very often it diverges rapidly or even becomes NaN.<br />
<br />
Also, there is another input variable that we did not set explicitly, relying on its default value, {{variable|TDExponentialMethod|Time-Dependent}}. 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.<br />
<br />
You may want to learn about the possible options that may be taken by {{Variable|TDExponentialMethod|Time-Dependent}}, and {{Variable|TDPropagator|Time-Dependent}} -- take a look at the manual. You can now try some exercises:<br />
<br />
* Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (Taylor, Chebyshev, and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.<br />
<br />
* And fixing now the {{variable|TDExponentialMethod|Time-Dependent}}, one can now play around with the various propagators.<br />
<br />
== Laser fields ==<br />
<br />
Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file (adding some variables) is:<br />
<br />
{{variable|FromScratch|Execution}} = yes<br />
<br />
T = 1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
amplitude = 1<br />
omega = 18.0<br />
tau0 = 0.5<br />
t0 = tau0<br />
<br />
%{{variable|TDExternalFields|Time-Dependent}}<br />
electric_field | 1 | 0 | 0 | omega | "envelope_cos"<br />
%<br />
<br />
%{{variable|TDFunctions|Time-Dependent}}<br />
"envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0<br />
%<br />
<br />
{{variable|TDOutput|Time-Dependent}} = laser + multipoles<br />
<br />
The most important variable here is the {{variable|TDExternalFields|Time-Dependent}} 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.<br />
<br />
[[Image:Tutorial_TD_Laser.png|thumb|350px|Laser field used in the tutorial]]<br />
<br />
Now you are ready to set up 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 {{variable|TDOutput|Time-Dependent}}.<br />
<br />
A couple of important comments:<br />
* You may supply several laser pulses: simply add more lines to the {{variable|TDExternalFields|Time-Dependent}} block.<br />
* The laser field is printed in the file {{file|td.general/laser}}. This is done immediately at the beginning of the run, so you can check that the laser is correct without waiting. <br />
* You can have an idea of the response to the field by looking at the dipole moment in the {{file|td.general/multipoles}}. What physical observable can be calculated from the response?<br />
* 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 {{variable|AbsorbingBoundaries|Time-Dependent}}, {{variable|ABWidth|Time-Dependent}} and {{variable|ABHeight|Time-Dependent}}).<br />
<br />
{{tutorial_foot|prev=Tutorial:Benzene molecule|next=Tutorial:Optical Spectra from TD}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8563Tutorial:Optical spectra from time-propagation2016-09-12T14:20:51Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a quick coffee (this should take around 5 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}} (you will have to rename the {{file|multipoles}} file after the runs in each direction).<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would have four files: {{file|cross_section_vector.1}}, {{file|cross_section_vector.2}}, {{file|cross_section_vector.3}}, and {{file|cross_section_tensor}}. The latter would be similar to:<br />
<br />
<pre><br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 3<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 -0.13418360E-08 0.15451245E-11 -0.13419076E-08 -0.70225570E-12 -0.70246323E-12 ...<br />
0.20000000E-01 -0.53782093E-08 0.61731913E-11 -0.53784954E-08 -0.28056821E-11 -0.28065087E-11 ...<br />
...<br />
</pre><br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_tensor}}, but you can use {{file|cross_section_vector}} for this exercise in case you did not propagate in all three directions), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8562Tutorial:Optical spectra from time-propagation2016-09-12T14:16:49Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a quick coffee (this should take around 5 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would have four files: {{file|cross_section_vector.1}}, {{file|cross_section_vector.2}}, {{file|cross_section_vector.3}}, and {{file|cross_section_tensor}}. The latter would be similar to:<br />
<br />
<pre><br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 3<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 -0.13418360E-08 0.15451245E-11 -0.13419076E-08 -0.70225570E-12 -0.70246323E-12 ...<br />
0.20000000E-01 -0.53782093E-08 0.61731913E-11 -0.53784954E-08 -0.28056821E-11 -0.28065087E-11 ...<br />
...<br />
</pre><br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_tensor}}, but you can use {{file|cross_section_vector}} for this exercise in case you did not propagate in all three directions), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8561Tutorial:Optical spectra from time-propagation2016-09-12T14:13:48Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a quick coffee (this should take around 5 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
<pre><br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 3<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 -0.13418360E-08 0.15451245E-11 -0.13419076E-08 -0.70225570E-12 -0.70246323E-12 ...<br />
0.20000000E-01 -0.53782093E-08 0.61731913E-11 -0.53784954E-08 -0.28056821E-11 -0.28065087E-11 ...<br />
...<br />
</pre><br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_tensor}}, but you can use {{file|cross_section_vector}} for this exercise in case you did not propagate in all three directions), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8560Tutorial:Optical spectra from time-propagation2016-09-12T14:11:49Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a quick coffee (this should take around 5 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
<pre><br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 3<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 -0.13418360E-08 0.15451245E-11 -0.13419076E-08 -0.70225570E-12 -0.70246323E-12 ...<br />
0.20000000E-01 -0.53782093E-08 0.61731913E-11 -0.53784954E-08 -0.28056821E-11 -0.28065087E-11 ...<br />
...<br />
</pre><br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8559Tutorial:Optical spectra from time-propagation2016-09-12T14:10:55Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a quick coffee (this should take around 5 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
<pre><br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 3<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 -0.13418360E-08 0.15451245E-11 -0.13419076E-08 -0.70225570E-12 -0.70246323E-12 ...<br />
0.20000000E-01 -0.53782093E-08 0.61731913E-11 -0.53784954E-08 -0.28056821E-11 -0.28065087E-11 ...<br />
...<br />
</pre><br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Time-dependent_propagation&diff=8558Tutorial:Time-dependent propagation2016-09-12T14:05:12Z<p>Fnog: /* Input */</p>
<hr />
<div>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 usually for a real-time calculation you will need first to do a ground-state calculation to set the initial conditions.<br />
<br />
== Input ==<br />
<br />
Run the input file below to obtain a proper ground-state (stored in the <tt>restart</tt> directory) as from a [[Tutorial:Methane_molecule | previous tutorial]]. (Now we are using a more accurate bond length than before.)<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.094<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
T = 0.1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
Then switch on a new run mode, {{variable|CalculationMode|Calculation_Modes}} <tt>= td</tt> instead of <tt>gs</tt>, to do a time-dependent run. {{octopus}} will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are<br />
<br />
<pre><br />
Input: [IonsConstantVelocity = no]<br />
Input: [Thermostat = none]<br />
Input: [MoveIons = no]<br />
Input: [TDIonicTimeScale = 1.000]<br />
Input: [TDTimeStep = 0.2000E-02 hbar/eV]<br />
Input: [TDPropagationTime = 0.1000 hbar/eV]<br />
Input: [TDMaxSteps = 50]<br />
Input: [TDDynamics = ehrenfest]<br />
Input: [TDPropagator = aetrs]<br />
Input: [TDExponentialMethod = taylor]<br />
</pre><br />
...<br />
<pre><br />
********************* Time-Dependent Simulation **********************<br />
Iter Time Energy SC Steps Elapsed Time<br />
**********************************************************************<br />
<br />
1 0.002000 -218.785409 1 0.064<br />
2 0.004000 -218.785409 1 0.060<br />
3 0.006000 -218.785409 1 0.067<br />
</pre><br />
...<br />
<pre><br />
49 0.098000 -218.785409 1 0.062<br />
50 0.100000 -218.785409 1 0.072<br />
</pre><br />
<br />
It is worthwhile to comment on a few things:<br />
<br />
* 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.<br />
* As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory {{file|td.general}}, which should show up in the working directory. In this case, only two files show up, the {{file|td.general/energy}}, and the {{file|td.general/multipoles}} files. The {{file|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 <tt>#</tt> 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:<br />
** The first column is just the iteration number.<br />
** The second column is the time.<br />
** The third column is the dipole moment of the electronic system, along the <math>x</math>-direction: <math><br />
\langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle = <br />
\int\!\!{\rm d}^3r\; x\,n(r)<br />
</math>. Next are the <math>y</math>- and <math>z</math>-components of the dipole moment.<br />
** The file {{file|td.general/energy}} contains the different components of the total energy.<br />
<br />
* The meaning of the three new variables that we have introduced in the input file is rather obvious: {{variable|TDPropagator|Time-Dependent}} establishes which algorithm will be used to approximate the evolution operator; {{variable|TDMaxSteps|Time-Dependent}} tells the code how may time steps to perform; and {{variable|TDTimeStep|Time-Dependent}} fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, <tt>T</tt> and <tt>dt</tt>. We have made use of one of the possible propagators, <tt>aetrs</tt>. The manual explains about the possible options; in practice this choice is usually good except for very long propagation where the <tt>etrs</tt> propagator can be more stable.<br />
<br />
* It is possible to restart a time-dependent run. Try that now. Just increase the value of {{variable|TDMaxSteps|Time-Dependent}} and rerun {{octopus}}. If, however, you want to start the evolution from scratch, you should set the variable {{variable|FromScratch|Execution}} to <tt>yes</tt>.<br />
<br />
== The time step ==<br />
<br />
A key parameter is, of course, the time step, {{variable|TDTimeStep|Time-Dependent}}. Before making long calculations, it is worthwhile spending some time choosing the largest time-step possible, to reduce the number of steps needed. This time-step depends crucially on the system under consideration, the spacing, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. <br />
<br />
In this example, try to change the time-step and to rerun the time-evolution. Make sure you are using {{variable|TDMaxSteps|Time-Dependent}} of at least 100, as with shorter runs an instability might not appear yet. You will see that for time-steps larger than <tt>0.0024</tt> the propagation gets unstable and the total energy of the system is no longer conserved. Very often it diverges rapidly or even becomes NaN.<br />
<br />
Also, there is another input variable that we did not set explicitly, relying on its default value, {{variable|TDExponentialMethod|Time-Dependent}}. 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.<br />
<br />
You may want to learn about the possible options that may be taken by {{Variable|TDExponentialMethod|Time-Dependent}}, and {{Variable|TDPropagator|Time-Dependent}} -- take a look at the manual. You can now try some exercises:<br />
<br />
* Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (Taylor, Chebyshev, and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.<br />
<br />
* And fixing now the {{variable|TDExponentialMethod|Time-Dependent}}, one can now play around with the various propagators.<br />
<br />
== Laser fields ==<br />
<br />
Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file (adding some variables) is:<br />
<br />
{{variable|FromScratch|Execution}} = yes<br />
<br />
T = 1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
amplitude = 1<br />
omega = 18.0<br />
tau0 = 0.5<br />
t0 = tau0<br />
<br />
%{{variable|TDExternalFields|Time-Dependent}}<br />
electric_field | 1 | 0 | 0 | omega | "envelope_cos"<br />
%<br />
<br />
%{{variable|TDFunctions|Time-Dependent}}<br />
"envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0<br />
%<br />
<br />
{{variable|TDOutput|Time-Dependent}} = laser + multipoles<br />
<br />
The most important variable here is the {{variable|TDExternalFields|Time-Dependent}} 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.<br />
<br />
[[Image:Tutorial_TD_Laser.png|thumb|350px|Laser field used in the tutorial]]<br />
<br />
Now you are ready to set up 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 {{variable|TDOutput|Time-Dependent}}.<br />
<br />
A couple of important comments:<br />
* You may supply several laser pulses: simply add more lines to the {{variable|TDExternalFields|Time-Dependent}} block.<br />
* The laser field is printed in the file {{file|td.general/laser}}. This is done immediately at the beginning of the run, so you can check that the laser is correct without waiting. <br />
* You can have an idea of the response to the field by looking at the dipole moment in the {{file|td.general/multipoles}}. What physical observable can be calculated from the response?<br />
* 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 {{variable|AbsorbingBoundaries|Time-Dependent}}, {{variable|ABWidth|Time-Dependent}} and {{variable|ABHeight|Time-Dependent}}).<br />
<br />
{{tutorial_foot|prev=Tutorial:Benzene molecule|next=Tutorial:Optical Spectra from TD}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Time-dependent_propagation&diff=8557Tutorial:Time-dependent propagation2016-09-12T14:04:02Z<p>Fnog: /* The time step */</p>
<hr />
<div>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 usually for a real-time calculation you will need first to do a ground-state calculation to set the initial conditions.<br />
<br />
== Input ==<br />
<br />
Run the input file below to obtain a proper ground-state (stored in the <tt>restart</tt> directory) as from a [[Tutorial:Methane_molecule | previous tutorial]]. (Now we are using a more accurate bond length than before.)<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.094<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
T = 0.1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
Then switch on a new run mode, <tt>CalculationMode = td</tt> instead of <tt>gs</tt>, to do a time-dependent run. {{octopus}} will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are<br />
<br />
<pre><br />
Input: [IonsConstantVelocity = no]<br />
Input: [Thermostat = none]<br />
Input: [MoveIons = no]<br />
Input: [TDIonicTimeScale = 1.000]<br />
Input: [TDTimeStep = 0.2000E-02 hbar/eV]<br />
Input: [TDPropagationTime = 0.1000 hbar/eV]<br />
Input: [TDMaxSteps = 50]<br />
Input: [TDDynamics = ehrenfest]<br />
Input: [TDPropagator = aetrs]<br />
Input: [TDExponentialMethod = taylor]<br />
</pre><br />
...<br />
<pre><br />
********************* Time-Dependent Simulation **********************<br />
Iter Time Energy SC Steps Elapsed Time<br />
**********************************************************************<br />
<br />
1 0.002000 -218.785409 1 0.064<br />
2 0.004000 -218.785409 1 0.060<br />
3 0.006000 -218.785409 1 0.067<br />
</pre><br />
...<br />
<pre><br />
49 0.098000 -218.785409 1 0.062<br />
50 0.100000 -218.785409 1 0.072<br />
</pre><br />
<br />
It is worthwhile to comment on a few things:<br />
<br />
* 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.<br />
* As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory {{file|td.general}}, which should show up in the working directory. In this case, only two files show up, the {{file|td.general/energy}}, and the {{file|td.general/multipoles}} files. The {{file|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 <tt>#</tt> 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:<br />
** The first column is just the iteration number.<br />
** The second column is the time.<br />
** The third column is the dipole moment of the electronic system, along the <math>x</math>-direction: <math><br />
\langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle = <br />
\int\!\!{\rm d}^3r\; x\,n(r)<br />
</math>. Next are the <math>y</math>- and <math>z</math>-components of the dipole moment.<br />
** The file {{file|td.general/energy}} contains the different components of the total energy.<br />
<br />
* The meaning of the three new variables that we have introduced in the input file is rather obvious: {{variable|TDPropagator|Time-Dependent}} establishes which algorithm will be used to approximate the evolution operator; {{variable|TDMaxSteps|Time-Dependent}} tells the code how may time steps to perform; and {{variable|TDTimeStep|Time-Dependent}} fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, <tt>T</tt> and <tt>dt</tt>. We have made use of one of the possible propagators, <tt>aetrs</tt>. The manual explains about the possible options; in practice this choice is usually good except for very long propagation where the <tt>etrs</tt> propagator can be more stable.<br />
<br />
* It is possible to restart a time-dependent run. Try that now. Just increase the value of {{variable|TDMaxSteps|Time-Dependent}} and rerun {{octopus}}. If, however, you want to start the evolution from scratch, you should set the variable {{variable|FromScratch|Execution}} to <tt>yes</tt>.<br />
<br />
== The time step ==<br />
<br />
A key parameter is, of course, the time step, {{variable|TDTimeStep|Time-Dependent}}. Before making long calculations, it is worthwhile spending some time choosing the largest time-step possible, to reduce the number of steps needed. This time-step depends crucially on the system under consideration, the spacing, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. <br />
<br />
In this example, try to change the time-step and to rerun the time-evolution. Make sure you are using {{variable|TDMaxSteps|Time-Dependent}} of at least 100, as with shorter runs an instability might not appear yet. You will see that for time-steps larger than <tt>0.0024</tt> the propagation gets unstable and the total energy of the system is no longer conserved. Very often it diverges rapidly or even becomes NaN.<br />
<br />
Also, there is another input variable that we did not set explicitly, relying on its default value, {{variable|TDExponentialMethod|Time-Dependent}}. 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.<br />
<br />
You may want to learn about the possible options that may be taken by {{Variable|TDExponentialMethod|Time-Dependent}}, and {{Variable|TDPropagator|Time-Dependent}} -- take a look at the manual. You can now try some exercises:<br />
<br />
* Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (Taylor, Chebyshev, and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.<br />
<br />
* And fixing now the {{variable|TDExponentialMethod|Time-Dependent}}, one can now play around with the various propagators.<br />
<br />
== Laser fields ==<br />
<br />
Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file (adding some variables) is:<br />
<br />
{{variable|FromScratch|Execution}} = yes<br />
<br />
T = 1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
amplitude = 1<br />
omega = 18.0<br />
tau0 = 0.5<br />
t0 = tau0<br />
<br />
%{{variable|TDExternalFields|Time-Dependent}}<br />
electric_field | 1 | 0 | 0 | omega | "envelope_cos"<br />
%<br />
<br />
%{{variable|TDFunctions|Time-Dependent}}<br />
"envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0<br />
%<br />
<br />
{{variable|TDOutput|Time-Dependent}} = laser + multipoles<br />
<br />
The most important variable here is the {{variable|TDExternalFields|Time-Dependent}} 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.<br />
<br />
[[Image:Tutorial_TD_Laser.png|thumb|350px|Laser field used in the tutorial]]<br />
<br />
Now you are ready to set up 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 {{variable|TDOutput|Time-Dependent}}.<br />
<br />
A couple of important comments:<br />
* You may supply several laser pulses: simply add more lines to the {{variable|TDExternalFields|Time-Dependent}} block.<br />
* The laser field is printed in the file {{file|td.general/laser}}. This is done immediately at the beginning of the run, so you can check that the laser is correct without waiting. <br />
* You can have an idea of the response to the field by looking at the dipole moment in the {{file|td.general/multipoles}}. What physical observable can be calculated from the response?<br />
* 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 {{variable|AbsorbingBoundaries|Time-Dependent}}, {{variable|ABWidth|Time-Dependent}} and {{variable|ABHeight|Time-Dependent}}).<br />
<br />
{{tutorial_foot|prev=Tutorial:Benzene molecule|next=Tutorial:Optical Spectra from TD}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Time-dependent_propagation&diff=8556Tutorial:Time-dependent propagation2016-09-12T14:03:46Z<p>Fnog: /* The time step */</p>
<hr />
<div>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 usually for a real-time calculation you will need first to do a ground-state calculation to set the initial conditions.<br />
<br />
== Input ==<br />
<br />
Run the input file below to obtain a proper ground-state (stored in the <tt>restart</tt> directory) as from a [[Tutorial:Methane_molecule | previous tutorial]]. (Now we are using a more accurate bond length than before.)<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.094<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
T = 0.1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
Then switch on a new run mode, <tt>CalculationMode = td</tt> instead of <tt>gs</tt>, to do a time-dependent run. {{octopus}} will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are<br />
<br />
<pre><br />
Input: [IonsConstantVelocity = no]<br />
Input: [Thermostat = none]<br />
Input: [MoveIons = no]<br />
Input: [TDIonicTimeScale = 1.000]<br />
Input: [TDTimeStep = 0.2000E-02 hbar/eV]<br />
Input: [TDPropagationTime = 0.1000 hbar/eV]<br />
Input: [TDMaxSteps = 50]<br />
Input: [TDDynamics = ehrenfest]<br />
Input: [TDPropagator = aetrs]<br />
Input: [TDExponentialMethod = taylor]<br />
</pre><br />
...<br />
<pre><br />
********************* Time-Dependent Simulation **********************<br />
Iter Time Energy SC Steps Elapsed Time<br />
**********************************************************************<br />
<br />
1 0.002000 -218.785409 1 0.064<br />
2 0.004000 -218.785409 1 0.060<br />
3 0.006000 -218.785409 1 0.067<br />
</pre><br />
...<br />
<pre><br />
49 0.098000 -218.785409 1 0.062<br />
50 0.100000 -218.785409 1 0.072<br />
</pre><br />
<br />
It is worthwhile to comment on a few things:<br />
<br />
* 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.<br />
* As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory {{file|td.general}}, which should show up in the working directory. In this case, only two files show up, the {{file|td.general/energy}}, and the {{file|td.general/multipoles}} files. The {{file|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 <tt>#</tt> 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:<br />
** The first column is just the iteration number.<br />
** The second column is the time.<br />
** The third column is the dipole moment of the electronic system, along the <math>x</math>-direction: <math><br />
\langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle = <br />
\int\!\!{\rm d}^3r\; x\,n(r)<br />
</math>. Next are the <math>y</math>- and <math>z</math>-components of the dipole moment.<br />
** The file {{file|td.general/energy}} contains the different components of the total energy.<br />
<br />
* The meaning of the three new variables that we have introduced in the input file is rather obvious: {{variable|TDPropagator|Time-Dependent}} establishes which algorithm will be used to approximate the evolution operator; {{variable|TDMaxSteps|Time-Dependent}} tells the code how may time steps to perform; and {{variable|TDTimeStep|Time-Dependent}} fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, <tt>T</tt> and <tt>dt</tt>. We have made use of one of the possible propagators, <tt>aetrs</tt>. The manual explains about the possible options; in practice this choice is usually good except for very long propagation where the <tt>etrs</tt> propagator can be more stable.<br />
<br />
* It is possible to restart a time-dependent run. Try that now. Just increase the value of {{variable|TDMaxSteps|Time-Dependent}} and rerun {{octopus}}. If, however, you want to start the evolution from scratch, you should set the variable {{variable|FromScratch|Execution}} to <tt>yes</tt>.<br />
<br />
== The time step ==<br />
<br />
A key parameter is, of course, the time step, {{variable|TDTimeStep|Time-Dependent}}. Before making long calculations, it is worthwhile spending some time choosing the largest time-step possible, to reduce the number of steps needed. This time-step depends crucially on the system under consideration, the spacing, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. <br />
<br />
In this example, try to change the time-step and to rerun the time-evolution. Make sure you are using {{variable|TDMaxSteps|Time-Dependent}} of at least 100, as with shorter runs an instability might not appear yet. You will see that for time-steps larger than <tt>0.0025</tt> the propagation gets unstable and the total energy of the system is no longer conserved. Very often it diverges rapidly or even becomes NaN.<br />
<br />
Also, there is another input variable that we did not set explicitly, relying on its default value, {{variable|TDExponentialMethod|Time-Dependent}}. 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.<br />
<br />
You may want to learn about the possible options that may be taken by {{Variable|TDExponentialMethod|Time-Dependent}}, and {{Variable|TDPropagator|Time-Dependent}} -- take a look at the manual. You can now try some exercises:<br />
<br />
* Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (Taylor, Chebyshev, and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.<br />
<br />
* And fixing now the {{variable|TDExponentialMethod|Time-Dependent}}, one can now play around with the various propagators.<br />
<br />
== Laser fields ==<br />
<br />
Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file (adding some variables) is:<br />
<br />
{{variable|FromScratch|Execution}} = yes<br />
<br />
T = 1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
amplitude = 1<br />
omega = 18.0<br />
tau0 = 0.5<br />
t0 = tau0<br />
<br />
%{{variable|TDExternalFields|Time-Dependent}}<br />
electric_field | 1 | 0 | 0 | omega | "envelope_cos"<br />
%<br />
<br />
%{{variable|TDFunctions|Time-Dependent}}<br />
"envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0<br />
%<br />
<br />
{{variable|TDOutput|Time-Dependent}} = laser + multipoles<br />
<br />
The most important variable here is the {{variable|TDExternalFields|Time-Dependent}} 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.<br />
<br />
[[Image:Tutorial_TD_Laser.png|thumb|350px|Laser field used in the tutorial]]<br />
<br />
Now you are ready to set up 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 {{variable|TDOutput|Time-Dependent}}.<br />
<br />
A couple of important comments:<br />
* You may supply several laser pulses: simply add more lines to the {{variable|TDExternalFields|Time-Dependent}} block.<br />
* The laser field is printed in the file {{file|td.general/laser}}. This is done immediately at the beginning of the run, so you can check that the laser is correct without waiting. <br />
* You can have an idea of the response to the field by looking at the dipole moment in the {{file|td.general/multipoles}}. What physical observable can be calculated from the response?<br />
* 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 {{variable|AbsorbingBoundaries|Time-Dependent}}, {{variable|ABWidth|Time-Dependent}} and {{variable|ABHeight|Time-Dependent}}).<br />
<br />
{{tutorial_foot|prev=Tutorial:Benzene molecule|next=Tutorial:Optical Spectra from TD}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8555Tutorial:Optical spectra from time-propagation2016-09-12T14:02:30Z<p>Fnog: /* Time-dependent run */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a quick coffee (this should take around 5 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8554Tutorial:Optical spectra from time-propagation2016-09-12T13:48:25Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4350<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0050<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.946570<br />
# Static polarizability (from sum rule) = 2.145862 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 -0.13419076E-08 -0.33805821E-12 -0.85198023E-12 -0.12225726E-08<br />
0.20000000E-01 -0.53784954E-08 -0.13506268E-11 -0.34038646E-11 -0.49001891E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8553Tutorial:Optical spectra from time-propagation2016-09-12T13:45:42Z<p>Fnog: /* Optical spectra */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
<pre><br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 -5.105069841261e-11 -2.458728679159e-11 -6.191777548908e-11<br />
1 2.300000000000e-03 7.999999999898e+00 -1.441204189916e-03 -2.454483489431e-11 -6.178536414960e-11<br />
2 4.600000000000e-03 7.999999999794e+00 -2.849596623682e-03 -2.441311503813e-11 -6.139129111463e-11<br />
3 6.900000000000e-03 7.999999999692e+00 -4.212595751069e-03 -2.420204397245e-11 -6.075589410104e-11<br />
</pre><br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8551Tutorial:Optical spectra from time-propagation2016-09-12T13:41:35Z<p>Fnog: /* Time-dependent run */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Calculation_Modes}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 7.294675056604e-10 6.918081048288e-10 8.787611914453e-10<br />
1 2.300000000000e-03 7.999999999878e+00 -1.440784736897e-03 6.914481697163e-10 8.783419203663e-10<br />
2 4.600000000000e-03 7.999999999758e+00 -2.846132320210e-03 6.903990795945e-10 8.771037408444e-10<br />
3 6.900000000000e-03 7.999999999640e+00 -4.206637071678e-03 6.886225285892e-10 8.750036277646e-10<br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8550Tutorial:Optical spectra from time-propagation2016-09-12T13:40:47Z<p>Fnog: /* Ground state */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Time-Dependent}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 7.294675056604e-10 6.918081048288e-10 8.787611914453e-10<br />
1 2.300000000000e-03 7.999999999878e+00 -1.440784736897e-03 6.914481697163e-10 8.783419203663e-10<br />
2 4.600000000000e-03 7.999999999758e+00 -2.846132320210e-03 6.903990795945e-10 8.771037408444e-10<br />
3 6.900000000000e-03 7.999999999640e+00 -4.206637071678e-03 6.886225285892e-10 8.750036277646e-10<br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8548Tutorial:Optical spectra from time-propagation2016-09-12T13:39:17Z<p>Fnog: /* Ground state */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Calculation Modes}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Time-Dependent}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 7.294675056604e-10 6.918081048288e-10 8.787611914453e-10<br />
1 2.300000000000e-03 7.999999999878e+00 -1.440784736897e-03 6.914481697163e-10 8.783419203663e-10<br />
2 4.600000000000e-03 7.999999999758e+00 -2.846132320210e-03 6.903990795945e-10 8.771037408444e-10<br />
3 6.900000000000e-03 7.999999999640e+00 -4.206637071678e-03 6.886225285892e-10 8.750036277646e-10<br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8547Tutorial:Optical spectra from time-propagation2016-09-12T13:38:19Z<p>Fnog: /* Time-dependent run */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Execution}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file (don't forget to change the {{variable|CalculationMode|Time-Dependent}} to "td"):<br />
<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 7.294675056604e-10 6.918081048288e-10 8.787611914453e-10<br />
1 2.300000000000e-03 7.999999999878e+00 -1.440784736897e-03 6.914481697163e-10 8.783419203663e-10<br />
2 4.600000000000e-03 7.999999999758e+00 -2.846132320210e-03 6.903990795945e-10 8.771037408444e-10<br />
3 6.900000000000e-03 7.999999999640e+00 -4.206637071678e-03 6.886225285892e-10 8.750036277646e-10<br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8546Tutorial:Optical spectra from time-propagation2016-09-12T13:35:14Z<p>Fnog: /* Ground state */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|CalculationMode|Execution}} = gs<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = td<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 7.294675056604e-10 6.918081048288e-10 8.787611914453e-10<br />
1 2.300000000000e-03 7.999999999878e+00 -1.440784736897e-03 6.914481697163e-10 8.783419203663e-10<br />
2 4.600000000000e-03 7.999999999758e+00 -2.846132320210e-03 6.903990795945e-10 8.771037408444e-10<br />
3 6.900000000000e-03 7.999999999640e+00 -4.206637071678e-03 6.886225285892e-10 8.750036277646e-10<br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Optical_spectra_from_time-propagation&diff=8544Tutorial:Optical spectra from time-propagation2016-09-12T13:33:27Z<p>Fnog: /* Ground state */</p>
<hr />
<div>In this tutorial we will learn how to obtain the absorption spectrum of a molecule from the explicit solution of the time-dependent Kohn-Sham equations. We choose as a test case methane (CH<sub>4</sub>).<br />
<br />
== Ground state ==<br />
<br />
Before starting out time-dependent simulations, we need to obtain the ground state of the system. For this we use basically the same {{file|inp}} file as in a previous [[Tutorial:Methane_molecule|tutorial]]:<br />
<br />
{{variable|Units|Execution}} = eV_angstrom<br />
<br />
{{variable|Radius|Mesh}} = 4<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.087<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
After running {{octopus}}, we will have the Kohn-Sham wave-functions of the ground-state in the directory {{file|restart/gs}}. As we are going to propagate these wave-functions, they have to be well converged. It is important not only to converge the energy (that is relatively easy to converge), but the density. The default <tt>{{variable|ConvRelDens|SCF}} = 1e-05</tt> is usually enough, though.<br />
<br />
== Time-dependent run ==<br />
<br />
To calculate absorption, we excite the system with an infinitesimal electric-field pulse, and then propagate the time-dependent Kohn-Sham equations for a certain time ''T''. The spectrum can then be evaluated from the time-dependent dipole moment.<br />
<br />
This is what you need to add to the input file:<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = td<br />
{{variable|TDDeltaStrength|Time-Dependent}} = 0.01<br />
{{variable|TDPolarizationDirection|Time-Dependent}} = 1<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDTimeStep|Time-Dependent}} = 0.0023<br />
{{variable|TDMaxSteps|Time-Dependent}} = 4350 # ~ 10.0/{{variable|TDTimeStep|Time-Dependent}}<br />
<br />
First we define our perturbation. Its strength is given by {{variable|TDDeltaStrength|Time-Dependent}}. This number should be small to keep the response linear, but should be sufficiently large to avoid numerical problems. The variable {{variable|TDPolarizationDirection|Time-Dependent}} sets the polarization of our perturbation to be on the first axis (''x'').<br />
<br />
We then set up the time-evolution. {{octopus}} has a large number of possible propagators that you can use (see [http://dx.doi.org/10.1063/1.1774980 J. Chem. Phys '''121''' 3425-3433 (2004)] for an overview). Here we use the simple Approximately Enforced Time-Reversal Symmetry (aetrs). Then we need a time step (variable {{variable|TDTimeStep|Time-Dependent}}). The choice of this number depends on the propagation method, and it is a quite crucial parameter. You should have learned how to set it up in the previous [[Tutorial:Time-dependent_run|tutorial]]. Finally, we set the number of time steps with the variable {{variable|TDMaxSteps|Time-Dependent}}. To have a maximum propagation time of 10 <math>\hbar/{\rm eV}</math> we will need around 4350 iterations.<br />
<br />
Note that you will be calculating the singlet dipole spectrum. You can also obtain the triplet by using {{variable|TDDeltaStrengthMode|Time-Dependent}}, and other multipole responses by using {{variable|TDKickFunction|Time-Dependent}}. For details on triplet calculations see [[Tutorial:Triplet Excitations]].<br />
<br />
You can now start {{octopus}} and go for a coffee (this should take around 20 minutes depending on your machine). Propagations are slow, but the good news is that they scale very well with the size of the system. This means that even if methane is very slow, a molecule with 200 atoms can still be calculated without big problems.<br />
<br />
== Symmetries ==<br />
<br />
The proper way to get the spectrum from fewer than three runs is to take advantage of the symmetries of the system. However, this is fairly complicated to understand for the purposes of this introductory tutorial. To learn more about symmetry, look at this page: [[Tutorial:Optical Spectra from TD:Symmetries]]. In this case, we can actually just do one run, and plot the absorption spectrum for ''x''-polarization, and that will in fact be equivalent to the spectrum averaged over the three directions.<br />
<br />
== Optical spectra ==<br />
<br />
When the run is finished, you should find the file {{file|td.general/multipoles}} that contains all the information needed to compute the spectrum of methane. For a general system we need three time-dependent runs to get the {{file|multipoles}} files called {{file|td.general/multipoles.1}}, {{file|td.general/multipoles.2}}, and {{file|td.general/multipoles.3}}.<br />
<br />
The beginning of the {{file|multipoles}} file will look similar to this:<br />
<br />
################################################################################<br />
# HEADER<br />
# nspin 1<br />
# lmax 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# Iter t Electronic charge(1) <x>(1) <y>(1) <z>(1) <br />
#[Iter n.] [hbar/eV] Electrons [A] [A] [A] <br />
################################################################################<br />
0 0.000000000000e+00 8.000000000000e+00 7.294675056604e-10 6.918081048288e-10 8.787611914453e-10<br />
1 2.300000000000e-03 7.999999999878e+00 -1.440784736897e-03 6.914481697163e-10 8.783419203663e-10<br />
2 4.600000000000e-03 7.999999999758e+00 -2.846132320210e-03 6.903990795945e-10 8.771037408444e-10<br />
3 6.900000000000e-03 7.999999999640e+00 -4.206637071678e-03 6.886225285892e-10 8.750036277646e-10<br />
<br />
To obtain the spectrum, in your working directory run the utility {{file|oct-propagation_spectrum}}. Don't worry about the warnings generated, we know what we are doing!<br />
<br />
File "multipoles" found. This will be the only file to be processed.<br />
(If more than one file is to be used, the files should be called<br />
"multipoles.1", "multipoles.2", etc.<br />
<br />
<br />
** Warning:<br />
** The file "multipoles" tells me that the system has no usable symmetry.<br />
** However, I am only using this file; cannot calculate the full tensor.<br />
** A file "XXXX_vector" will be generated instead.<br />
<br />
<br />
Octopus emitted 1 warning(s).<br />
<br />
You will notice that the file {{file|cross_section_vector}} is created. If you have all the information (either a symmetric molecule and one multipole file, or a less symmetric molecule and multiple multipole files), {{file|oct-propagation_spectrum}} will generate the whole polarizability tensor, {{file|cross_section_tensor}}. If not enough multipole files are available, it can only generate the response to the particular polarization you chose in you time-dependent run, {{file|cross_section_vector}}. Let us look first at {{file|cross_section_vector}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.005291772086<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axes 0<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
#%<br />
<br />
The beginning of the file just repeats some information concerning the run.<br />
<br />
<pre><br />
# Number of time steps = 4348<br />
# PropagationSpectrumDampMode = 2<br />
# PropagationSpectrumDampFactor = 4.0817<br />
# PropagationSpectrumStartTime = 0.0000<br />
# PropagationSpectrumEndTime = 10.0004<br />
# PropagationSpectrumMaxEnergy = 20.0000<br />
# PropagationSpectrumEnergyStep = 0.0100<br />
</pre><br />
<br />
Now comes a summary of the variables used to calculate the spectra. Note that you can change all these settings just by adding these variables to the input file before running {{file|oct-propagation_spectrum}}. Of special importance are perhaps {{variable|PropagationSpectrumMaxEnergy|Utilities}} that sets the maximum energy that will be calculated, and {{variable|PropagationSpectrumEnergyStep|Utilities}} that determines how many points your spectrum will contain. To have smoother curves, you should reduce this last variable.<br />
<br />
# Electronic sum rule = 3.882265<br />
# Static polarizability (from sum rule) = 2.104828 A<br />
<br />
Now comes some information from the sum rules. The first is just the ''f''-sum rule, which should yield the number of active electrons in the calculations. We have 8 valence electrons (4 from carbon and 4 from hydrogen), but the sum rule gives a number that is much smaller than 8! The reason is that we are just summing our spectrum up to 20 eV (see {{variable|PropagationSpectrumMaxEnergy|Utilities}}), but for the sum rule to be fulfilled, we should go to infinity. Of course infinity is a bit too large, but increasing 20 eV to a somewhat larger number will improve dramatically the ''f''-sum rule. The second number is the static polarizability also calculated from the sum rule. Again, do not forget to converge this number with {{variable|PropagationSpectrumMaxEnergy|Utilities}}.<br />
<br />
# Energy sigma(1, nspin=1) sigma(2, nspin=1) sigma(3, nspin=1) StrengthFunction(1)<br />
# [eV] [A^2] [A^2] [A^2] [1/eV] <br />
0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00 -0.00000000E+00<br />
0.10000000E-01 0.51922188E-09 0.46059130E-12 -0.60378030E-11 0.47304780E-09<br />
0.20000000E-01 0.20467566E-08 0.18401836E-11 -0.24122484E-10 0.18647398E-08<br />
...<br />
<br />
Finally comes the spectrum. The first column is the energy (frequency), the next three columns are a row of the cross-section tensor, and the last one is the strength function for this run.<br />
<br />
The dynamic polarizability is related to optical absorption cross-section via <math>\sigma \left( \omega \right) = \frac{4 \pi \omega}{c} \mathrm{Im}\ \alpha \left( \omega \right) </math> in atomic units, or more generally <math>4 \pi \omega \tilde{\alpha}\ \mathrm{Im}\ \alpha \left( \omega \right) </math> (where <math>\tilde{\alpha}</math> is the fine-structure constant) or <math>\frac{\omega e^2}{\epsilon_0 c} \mathrm{Im}\ \alpha \left( \omega \right) </math>. The cross-section is related to the strength function by <math>S \left( \omega \right) = \frac{mc}{2 \pi^2 \hbar^2} \sigma \left( \omega \right)</math>.<br />
<br />
If all three directions were done, we would also have a second file, {{file|cross_section_tensor}}:<br />
<br />
# nspin 1<br />
# kick mode 0<br />
# kick strength 0.010000000000<br />
# pol(1) 1.000000000000 0.000000000000 0.000000000000<br />
# pol(2) 0.000000000000 1.000000000000 0.000000000000<br />
# pol(3) 0.000000000000 0.000000000000 1.000000000000<br />
# direction 1<br />
# Equiv. axis 3<br />
# wprime 0.000000000000 0.000000000000 1.000000000000<br />
# kick time 0.000000000000<br />
# Energy (1/3)*Tr[sigma] Anisotropy[sigma] sigma(1,1,1) sigma(1,2,1) sigma(1,3,1) ...<br />
# [eV] [A^2] [A^2] [A^2] [A^2] [A^2] ...<br />
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 ...<br />
0.10000000E-01 0.51922187E-09 0.12093134E-10 0.51922187E-09 0.46057845E-12 -0.60377899E-11 ...<br />
0.20000000E-01 0.20467565E-08 0.48314996E-10 0.20467565E-08 0.18401322E-11 0.20467565E-08 ...<br />
...<br />
<br />
[[Image:Absorption_spectrum_CH4.png|thumb|400px|Absorption spectrum of CH<sub>4</sub>]]<br />
<br />
The columns are now the energy, the average absorption coefficient (Tr <math>\sigma/3</math>), the anisotropy, and <br />
then all the 9 components of the tensor. The third number is the spin component, just 1 here since it is unpolarized. The anisotropy is defined as<br />
<br />
<math><br />
(\Delta \sigma)^2 = \frac{1}{3} \{ 3{\rm Tr}(\sigma^2) - [{\rm Tr}(\sigma)]^2 \}<br />
</math><br />
<br />
The reason for this definition is that it is identically equal to:<br />
<br />
<math><br />
(\Delta \sigma)^2 = (1/3) [ (\sigma_1-\sigma_2)^2 + (\sigma_1-\sigma_3)^2 + (\sigma_2-\sigma_3)^2 ]\,<br />
</math><br />
<br />
where <math>\{\sigma_1, \sigma_2, \sigma_3\}\,</math> are the eigenvalues of <math>\sigma\,</math>. An "isotropic" tensor is characterized by having three equal eigenvalues, which leads to zero anisotropy. The more different that the eigenvalues are, the larger the anisotropy is.<br />
<br />
If you now plot the absorption spectrum (column 5 vs 1 in {{file|cross_section_vector}}), you should obtain the plot shown on the right. Of course, you should now try to converge this spectrum with respect to the calculation parameters. In particular:<br />
<br />
* Increasing the total propagation time will reduce the width of the peaks. In fact, the width of the peaks in this methods is absolutely artificial, and is inversely proportional to the total propagation time. Do not forget, however, that the area under the peaks has a physical meaning: it is the oscillator strength of the transition.<br />
* As you are running in a box with zero boundary conditions, you will see the box states in the spectrum. This can be improved by increasing the radius of the box. However, as one is usually interested in bound-bound transitions in the optical or near-ultraviolet regimes, a fairly small box (like the one used in this tutorial) is often enough.<br />
<br />
Some questions to think about:<br />
* What is the equation for the peak width in terms of the propagation time? How does the observed width compare to your expectation?<br />
* What is the highest energy excitation obtainable with the calculation parameters here? Which is the key one controlling the maximum energy?<br />
* Why does the spectrum go below zero? Is this physical? What calculation parameters might change this?<br />
<br />
{{tutorial_foot|next=Tutorial:Optical Spectra from Casida|prev=Tutorial:Time-dependent run}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Time-dependent_propagation&diff=8543Tutorial:Time-dependent propagation2016-09-12T13:32:38Z<p>Fnog: /* Input */</p>
<hr />
<div>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 usually for a real-time calculation you will need first to do a ground-state calculation to set the initial conditions.<br />
<br />
== Input ==<br />
<br />
Run the input file below to obtain a proper ground-state (stored in the <tt>restart</tt> directory) as from a [[Tutorial:Methane_molecule | previous tutorial]]. (Now we are using a more accurate bond length than before.)<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.18<br />
<br />
CH = 1.094<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
T = 0.1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
Then switch on a new run mode, <tt>CalculationMode = td</tt> instead of <tt>gs</tt>, to do a time-dependent run. {{octopus}} will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are<br />
<br />
<pre><br />
Input: [IonsConstantVelocity = no]<br />
Input: [Thermostat = none]<br />
Input: [MoveIons = no]<br />
Input: [TDIonicTimeScale = 1.000]<br />
Input: [TDTimeStep = 0.2000E-02 hbar/eV]<br />
Input: [TDPropagationTime = 0.1000 hbar/eV]<br />
Input: [TDMaxSteps = 50]<br />
Input: [TDDynamics = ehrenfest]<br />
Input: [TDPropagator = aetrs]<br />
Input: [TDExponentialMethod = taylor]<br />
</pre><br />
...<br />
<pre><br />
********************* Time-Dependent Simulation **********************<br />
Iter Time Energy SC Steps Elapsed Time<br />
**********************************************************************<br />
<br />
1 0.002000 -218.785409 1 0.064<br />
2 0.004000 -218.785409 1 0.060<br />
3 0.006000 -218.785409 1 0.067<br />
</pre><br />
...<br />
<pre><br />
49 0.098000 -218.785409 1 0.062<br />
50 0.100000 -218.785409 1 0.072<br />
</pre><br />
<br />
It is worthwhile to comment on a few things:<br />
<br />
* 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.<br />
* As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory {{file|td.general}}, which should show up in the working directory. In this case, only two files show up, the {{file|td.general/energy}}, and the {{file|td.general/multipoles}} files. The {{file|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 <tt>#</tt> 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:<br />
** The first column is just the iteration number.<br />
** The second column is the time.<br />
** The third column is the dipole moment of the electronic system, along the <math>x</math>-direction: <math><br />
\langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle = <br />
\int\!\!{\rm d}^3r\; x\,n(r)<br />
</math>. Next are the <math>y</math>- and <math>z</math>-components of the dipole moment.<br />
** The file {{file|td.general/energy}} contains the different components of the total energy.<br />
<br />
* The meaning of the three new variables that we have introduced in the input file is rather obvious: {{variable|TDPropagator|Time-Dependent}} establishes which algorithm will be used to approximate the evolution operator; {{variable|TDMaxSteps|Time-Dependent}} tells the code how may time steps to perform; and {{variable|TDTimeStep|Time-Dependent}} fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, <tt>T</tt> and <tt>dt</tt>. We have made use of one of the possible propagators, <tt>aetrs</tt>. The manual explains about the possible options; in practice this choice is usually good except for very long propagation where the <tt>etrs</tt> propagator can be more stable.<br />
<br />
* It is possible to restart a time-dependent run. Try that now. Just increase the value of {{variable|TDMaxSteps|Time-Dependent}} and rerun {{octopus}}. If, however, you want to start the evolution from scratch, you should set the variable {{variable|FromScratch|Execution}} to <tt>yes</tt>.<br />
<br />
== The time step ==<br />
<br />
A key parameter is, of course, the time step, {{variable|TDTimeStep|Time-Dependent}}. Before making long calculations, it is worthwhile spending some time choosing the largest time-step possible, to reduce the number of steps needed. This time-step depends crucially on the system under consideration, the spacing, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. <br />
<br />
In this example, try to change the time-step and to rerun the time-evolution. Make sure you are using {{variable|TDMaxSteps|Time-Dependent}} of at least 100, as with shorter runs an instability might not appear yet. You will see that <tt>0.0023</tt> 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 or even becomes NaN.<br />
<br />
Also, there is another input variable that we did not set explicitly, relying on its default value, {{variable|TDExponentialMethod|Time-Dependent}}. 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.<br />
<br />
You may want to learn about the possible options that may be taken by {{Variable|TDExponentialMethod|Time-Dependent}}, and {{Variable|TDPropagator|Time-Dependent}} -- take a look at the manual. You can now try some exercises:<br />
<br />
* Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (Taylor, Chebyshev, and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.<br />
<br />
* And fixing now the {{variable|TDExponentialMethod|Time-Dependent}}, one can now play around with the various propagators.<br />
<br />
== Laser fields ==<br />
<br />
Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file (adding some variables) is:<br />
<br />
{{variable|FromScratch|Execution}} = yes<br />
<br />
T = 1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
amplitude = 1<br />
omega = 18.0<br />
tau0 = 0.5<br />
t0 = tau0<br />
<br />
%{{variable|TDExternalFields|Time-Dependent}}<br />
electric_field | 1 | 0 | 0 | omega | "envelope_cos"<br />
%<br />
<br />
%{{variable|TDFunctions|Time-Dependent}}<br />
"envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0<br />
%<br />
<br />
{{variable|TDOutput|Time-Dependent}} = laser + multipoles<br />
<br />
The most important variable here is the {{variable|TDExternalFields|Time-Dependent}} 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.<br />
<br />
[[Image:Tutorial_TD_Laser.png|thumb|350px|Laser field used in the tutorial]]<br />
<br />
Now you are ready to set up 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 {{variable|TDOutput|Time-Dependent}}.<br />
<br />
A couple of important comments:<br />
* You may supply several laser pulses: simply add more lines to the {{variable|TDExternalFields|Time-Dependent}} block.<br />
* The laser field is printed in the file {{file|td.general/laser}}. This is done immediately at the beginning of the run, so you can check that the laser is correct without waiting. <br />
* You can have an idea of the response to the field by looking at the dipole moment in the {{file|td.general/multipoles}}. What physical observable can be calculated from the response?<br />
* 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 {{variable|AbsorbingBoundaries|Time-Dependent}}, {{variable|ABWidth|Time-Dependent}} and {{variable|ABHeight|Time-Dependent}}).<br />
<br />
{{tutorial_foot|prev=Tutorial:Benzene molecule|next=Tutorial:Optical Spectra from TD}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Time-dependent_propagation&diff=8541Tutorial:Time-dependent propagation2016-09-12T13:27:42Z<p>Fnog: /* Input */</p>
<hr />
<div>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 usually for a real-time calculation you will need first to do a ground-state calculation to set the initial conditions.<br />
<br />
== Input ==<br />
<br />
Run the input file below to obtain a proper ground-state (stored in the <tt>restart</tt> directory) as from a [[Tutorial:Methane_molecule | previous tutorial]]. (Now we are using a more accurate bond length than before.)<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.175<br />
<br />
CH = 1.094<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
T = 0.1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
Then switch on a new run mode, <tt>CalculationMode = td</tt> instead of <tt>gs</tt>, to do a time-dependent run. {{octopus}} will run for a few seconds, depending on the speed of your machine. The most relevant chunks of the standard output are<br />
<br />
<pre><br />
Input: [IonsConstantVelocity = no]<br />
Input: [Thermostat = none]<br />
Input: [MoveIons = no]<br />
Input: [TDIonicTimeScale = 1.000]<br />
Input: [TDTimeStep = 0.2000E-02 hbar/eV]<br />
Input: [TDPropagationTime = 0.1000 hbar/eV]<br />
Input: [TDMaxSteps = 50]<br />
Input: [TDDynamics = ehrenfest]<br />
Input: [TDPropagator = aetrs]<br />
Input: [TDExponentialMethod = taylor]<br />
</pre><br />
...<br />
<pre><br />
********************* Time-Dependent Simulation **********************<br />
Iter Time Energy SC Steps Elapsed Time<br />
**********************************************************************<br />
<br />
1 0.002000 -218.785409 1 0.064<br />
2 0.004000 -218.785409 1 0.060<br />
3 0.006000 -218.785409 1 0.067<br />
</pre><br />
...<br />
<pre><br />
49 0.098000 -218.785409 1 0.062<br />
50 0.100000 -218.785409 1 0.072<br />
</pre><br />
<br />
It is worthwhile to comment on a few things:<br />
<br />
* 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.<br />
* As the evolution is performed, the code probes some observables and prints them out. These are placed in some files under the directory {{file|td.general}}, which should show up in the working directory. In this case, only two files show up, the {{file|td.general/energy}}, and the {{file|td.general/multipoles}} files. The {{file|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 <tt>#</tt> 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:<br />
** The first column is just the iteration number.<br />
** The second column is the time.<br />
** The third column is the dipole moment of the electronic system, along the <math>x</math>-direction: <math><br />
\langle \Phi (t) \vert \hat{x} \vert \Phi(t)\rangle = <br />
\int\!\!{\rm d}^3r\; x\,n(r)<br />
</math>. Next are the <math>y</math>- and <math>z</math>-components of the dipole moment.<br />
** The file {{file|td.general/energy}} contains the different components of the total energy.<br />
<br />
* The meaning of the three new variables that we have introduced in the input file is rather obvious: {{variable|TDPropagator|Time-Dependent}} establishes which algorithm will be used to approximate the evolution operator; {{variable|TDMaxSteps|Time-Dependent}} tells the code how may time steps to perform; and {{variable|TDTimeStep|Time-Dependent}} fixes the length of each time step. And note that, for convenience, we have previously defined a couple of variables, <tt>T</tt> and <tt>dt</tt>. We have made use of one of the possible propagators, <tt>aetrs</tt>. The manual explains about the possible options; in practice this choice is usually good except for very long propagation where the <tt>etrs</tt> propagator can be more stable.<br />
<br />
* It is possible to restart a time-dependent run. Try that now. Just increase the value of {{variable|TDMaxSteps|Time-Dependent}} and rerun {{octopus}}. If, however, you want to start the evolution from scratch, you should set the variable {{variable|FromScratch|Execution}} to <tt>yes</tt>.<br />
<br />
== The time step ==<br />
<br />
A key parameter is, of course, the time step, {{variable|TDTimeStep|Time-Dependent}}. Before making long calculations, it is worthwhile spending some time choosing the largest time-step possible, to reduce the number of steps needed. This time-step depends crucially on the system under consideration, the spacing, on the applied perturbation, and on the algorithm chosen to approximate the evolution operator. <br />
<br />
In this example, try to change the time-step and to rerun the time-evolution. Make sure you are using {{variable|TDMaxSteps|Time-Dependent}} of at least 100, as with shorter runs an instability might not appear yet. You will see that <tt>0.0023</tt> 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 or even becomes NaN.<br />
<br />
Also, there is another input variable that we did not set explicitly, relying on its default value, {{variable|TDExponentialMethod|Time-Dependent}}. 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.<br />
<br />
You may want to learn about the possible options that may be taken by {{Variable|TDExponentialMethod|Time-Dependent}}, and {{Variable|TDPropagator|Time-Dependent}} -- take a look at the manual. You can now try some exercises:<br />
<br />
* Fixing the propagator algorithm (for example, to the default value), investigate how the several exponentiation methods work (Taylor, Chebyshev, and Lanczos). This means finding out what maximum time-step one can use without compromising the proper evolution.<br />
<br />
* And fixing now the {{variable|TDExponentialMethod|Time-Dependent}}, one can now play around with the various propagators.<br />
<br />
== Laser fields ==<br />
<br />
Now we will add a time-dependent external perturbation (a laser field) to the molecular Hamiltonian. The relevant part of the input file (adding some variables) is:<br />
<br />
{{variable|FromScratch|Execution}} = yes<br />
<br />
T = 1<br />
dt = 0.002<br />
<br />
{{variable|TDPropagator|Time-Dependent}} = aetrs<br />
{{variable|TDMaxSteps|Time-Dependent}} = T/dt<br />
{{variable|TDTimeStep|Time-Dependent}} = dt<br />
<br />
amplitude = 1<br />
omega = 18.0<br />
tau0 = 0.5<br />
t0 = tau0<br />
<br />
%{{variable|TDExternalFields|Time-Dependent}}<br />
electric_field | 1 | 0 | 0 | omega | "envelope_cos"<br />
%<br />
<br />
%{{variable|TDFunctions|Time-Dependent}}<br />
"envelope_cos" | tdf_cosinoidal | amplitude | tau0 | t0<br />
%<br />
<br />
{{variable|TDOutput|Time-Dependent}} = laser + multipoles<br />
<br />
The most important variable here is the {{variable|TDExternalFields|Time-Dependent}} 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.<br />
<br />
[[Image:Tutorial_TD_Laser.png|thumb|350px|Laser field used in the tutorial]]<br />
<br />
Now you are ready to set up 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 {{variable|TDOutput|Time-Dependent}}.<br />
<br />
A couple of important comments:<br />
* You may supply several laser pulses: simply add more lines to the {{variable|TDExternalFields|Time-Dependent}} block.<br />
* The laser field is printed in the file {{file|td.general/laser}}. This is done immediately at the beginning of the run, so you can check that the laser is correct without waiting. <br />
* You can have an idea of the response to the field by looking at the dipole moment in the {{file|td.general/multipoles}}. What physical observable can be calculated from the response?<br />
* 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 {{variable|AbsorbingBoundaries|Time-Dependent}}, {{variable|ABWidth|Time-Dependent}} and {{variable|ABHeight|Time-Dependent}}).<br />
<br />
{{tutorial_foot|prev=Tutorial:Benzene molecule|next=Tutorial:Optical Spectra from TD}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Centering_a_geometry&diff=8537Tutorial:Centering a geometry2016-09-12T11:17:40Z<p>Fnog: </p>
<hr />
<div>Before running an {{Octopus}} calculation of a molecule, it is always a good idea to run the [[Manual:External utilities:oct-center-geom|{{code|oct-center-geom}}]] utility, which will translate the center of mass to the origin, and align the molecule, by default so its main axis is along the ''x''-axis. Doing this is often helpful for visualization purposes, and making clear the symmetry of the system, and also it will help to construct the simulation box efficiently in the code. The current implementation in {{Octopus}} constructs a parallelepiped containing the simulation box and the origin, and it will be much larger than necessary if the system is not centered and aligned. For periodic systems, these considerations are not relevant (at least in the periodic directions).<br />
<br />
We need only a very simple input file, specifying the units and the coordinates.<br />
<br />
{{file|inp}}<br />
<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
{{variable|XYZCoordinates|System}} = "tAB.xyz"<br />
<br />
We will use this coordinates file, for the molecule [http://en.wikipedia.org/wiki/Azobenzene ''trans''-azobenzene], which has the interesting property of being able to switch between ''trans'' and ''cis'' isomers by absorption of light.<br />
<br />
{{file|tAB.xyz}}<br />
<br />
24<br />
<br />
C -0.520939 -1.29036 -2.47763<br />
C -0.580306 0.055376 -2.10547<br />
C 0.530312 0.670804 -1.51903<br />
C 1.71302 -0.064392 -1.30151<br />
C 1.76264 -1.41322 -1.67813<br />
C 0.649275 -2.02387 -2.26419<br />
H -1.38157 -1.76465 -2.93131<br />
H -1.48735 0.622185 -2.27142<br />
H 2.66553 -1.98883 -1.51628<br />
H 0.693958 -3.06606 -2.55287<br />
H 0.467127 1.71395 -1.23683<br />
N 2.85908 0.52877 -0.708609<br />
N 2.86708 1.72545 -0.355435<br />
C 4.01307 2.3187 0.237467<br />
C 3.96326 3.66755 0.614027<br />
C 5.0765 4.27839 1.20009<br />
C 6.2468 3.54504 1.41361<br />
C 6.30637 2.19928 1.04153<br />
C 5.19586 1.58368 0.455065<br />
H 5.25919 0.540517 0.17292<br />
H 3.06029 4.24301 0.4521<br />
H 5.03165 5.32058 1.48872<br />
H 7.10734 4.01949 1.86731<br />
H 7.21349 1.63261 1.20754<br />
<br />
[[Manual:External utilities:oct-center-geom|{{code|oct-center-geom}}]] is a serial utility, and it will be found in the {{code|bin}} directory after installation of {{Octopus}}.<br />
<br />
When you run the utility, you should obtain a new coordinates file {{code|adjusted.xyz}} for use in your calculations with {{Octopus}}. The output is not especially interesting (except for perhaps the symmetries and moment of inertia tensor). Visualize the original and new coordinates files with {{code|xcrysden}} or your favorite visualization program (''e.g.'' Jmol, Avogadro, VMD, Vesta, etc.), and see what transformations the utility performed. You can see more options about how to align the system at {{variable|AxisType|Utilities}} and {{variable|MainAxis|Utilities}}.<br />
<br />
{{tutorial_foot|next=Tutorial:Benzene molecule|prev=Tutorial:Methane molecule}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8535Tutorial:Total energy convergence2016-09-12T11:12:20Z<p>Fnog: /* Convergence */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.22<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -15.988934 2.000000<br />
2 -- -9.064039 2.000000<br />
3 -- -9.064039 2.000000<br />
4 -- -9.064039 2.000000<br />
<br />
Energy [eV]:<br />
Total = -219.01537542<br />
Free = -219.01537542<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.36210292<br />
Hartree = 393.44961913<br />
Int[n*v_xc] = -105.38115372<br />
Exchange = -69.66918783<br />
Correlation = -11.00060043<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 163.96741296<br />
External = -931.84569058<br />
Non-local = -49.74424172<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.02 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
<pre><br />
#Spacing Total Energy<br />
0.22 -219.01537542<br />
0.20 -218.58289833<br />
0.18 -218.20446230<br />
0.16 -218.14597804<br />
0.14 -218.14033248<br />
0.12 -218.13672950<br />
0.10 -218.12988174<br />
</pre><br />
<br />
If you give these numbers to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.18 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
<pre><br />
#Radius Total Energy<br />
2.5 -217.99419597<br />
3.0 -218.16990643<br />
3.5 -218.20446230<br />
4.0 -218.21157996<br />
4.5 -218.21300375<br />
5.0 -218.21356900<br />
</pre><br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8534Tutorial:Total energy convergence2016-09-12T11:11:16Z<p>Fnog: /* Convergence */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.22<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -15.988934 2.000000<br />
2 -- -9.064039 2.000000<br />
3 -- -9.064039 2.000000<br />
4 -- -9.064039 2.000000<br />
<br />
Energy [eV]:<br />
Total = -219.01537542<br />
Free = -219.01537542<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.36210292<br />
Hartree = 393.44961913<br />
Int[n*v_xc] = -105.38115372<br />
Exchange = -69.66918783<br />
Correlation = -11.00060043<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 163.96741296<br />
External = -931.84569058<br />
Non-local = -49.74424172<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.02 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
<pre><br />
#Spacing Total Energy<br />
0.22 -219.01537542<br />
0.20 -218.58289833<br />
0.18 -218.20446230<br />
0.16 -218.14597804<br />
0.14 -218.14033248<br />
0.12 -218.13672950<br />
0.10 -218.12988174<br />
</pre><br />
<br />
If you give these numbers to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.18 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
<pre><br />
#Radius Total Energy<br />
2.5 -217.99419597<br />
3.0 -218.16990643<br />
3.5 -218.20446230<br />
4.0 -218.21157996<br />
4.5 -218.21300375<br />
5.0 -218.21356900<br />
</pre><br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8530Tutorial:Total energy convergence2016-09-12T11:08:27Z<p>Fnog: /* Convergence */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.22<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -15.988934 2.000000<br />
2 -- -9.064039 2.000000<br />
3 -- -9.064039 2.000000<br />
4 -- -9.064039 2.000000<br />
<br />
Energy [eV]:<br />
Total = -219.01537542<br />
Free = -219.01537542<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.36210292<br />
Hartree = 393.44961913<br />
Int[n*v_xc] = -105.38115372<br />
Exchange = -69.66918783<br />
Correlation = -11.00060043<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 163.96741296<br />
External = -931.84569058<br />
Non-local = -49.74424172<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.02 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
<pre><br />
#Sp Energy s_eigen p_eigen<br />
0.22 -219.01537542 -15.988934 -9.064039<br />
0.20 -218.58289833 -16.068279 -9.054459<br />
0.18 -218.20446230 -16.141917 -9.044887<br />
0.16 -218.14597804 -16.151610 -9.043875<br />
0.14 -218.14033248 -16.149049 -9.042342<br />
0.12 -218.13672950 -16.149718 -9.042754<br />
0.1 -218.12988174 -16.148881 -9.042024<br />
</pre><br />
<br />
If you give the numbers in the first two columns to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.18 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
<pre><br />
#R Energy s_eigen p_eigen<br />
2.5 -217.99419597 -15.907573 -8.802904<br />
3.0 -218.16990643 -16.091354 -8.993250<br />
3.5 -218.20446230 -16.141917 -9.044887<br />
4.0 -218.21157996 -16.155216 -9.058309<br />
4.5 -218.21300375 -16.158677 -9.061771<br />
5.0 -218.21356900 -16.159553 -9.062642<br />
</pre><br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8529Tutorial:Total energy convergence2016-09-12T11:02:43Z<p>Fnog: /* Convergence */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.22<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -15.988934 2.000000<br />
2 -- -9.064039 2.000000<br />
3 -- -9.064039 2.000000<br />
4 -- -9.064039 2.000000<br />
<br />
Energy [eV]:<br />
Total = -219.01537542<br />
Free = -219.01537542<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.36210292<br />
Hartree = 393.44961913<br />
Int[n*v_xc] = -105.38115372<br />
Exchange = -69.66918783<br />
Correlation = -11.00060043<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 163.96741296<br />
External = -931.84569058<br />
Non-local = -49.74424172<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.02 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
<pre><br />
#Sp Energy s_eigen p_eigen<br />
0.22 -219.01537542 -15.988934 -9.064039<br />
0.20 -218.58289833 -16.068279 -9.054459<br />
0.18 -218.20446230 -16.141917 -9.044887<br />
0.16 -218.14597804 -16.151610 -9.043875<br />
0.14 -218.14033248 -16.149049 -9.042342<br />
0.12 -218.13672950 -16.149718 -9.042754<br />
0.1 -218.12988174 -16.148881 -9.042024<br />
</pre><br />
<br />
If you give the numbers in the first two columns to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.18 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
# Radius Total Energy<br />
2.5 -218.00107292<br />
3.0 -218.17888864<br />
3.5 -218.21314725<br />
4.0 -218.21996456<br />
4.5 -218.22132794<br />
5.0 -218.22061906<br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8528Tutorial:Total energy convergence2016-09-12T11:01:06Z<p>Fnog: /* Convergence */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.22<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -15.988934 2.000000<br />
2 -- -9.064039 2.000000<br />
3 -- -9.064039 2.000000<br />
4 -- -9.064039 2.000000<br />
<br />
Energy [eV]:<br />
Total = -219.01537542<br />
Free = -219.01537542<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.36210292<br />
Hartree = 393.44961913<br />
Int[n*v_xc] = -105.38115372<br />
Exchange = -69.66918783<br />
Correlation = -11.00060043<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 163.96741296<br />
External = -931.84569058<br />
Non-local = -49.74424172<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.02 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
<pre><br />
#Sp Energy s_eigen p_eigen<br />
0.22 -219.01537542 -15.988934 -9.064039<br />
0.20 -218.58289833 -16.068279 -9.054459<br />
0.18 -218.20446230 -16.141917 -9.044887<br />
0.16 -218.14597804 -16.151610 -9.043875<br />
0.14 -218.14033248 -16.149049 -9.042342<br />
0.12 -218.13672950 -16.149718 -9.042754<br />
0.1 -218.12988174 -16.148881 -9.042024<br />
</pre><br />
<br />
If you give the numbers in the first two columns to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.175 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
# Radius Total Energy<br />
2.5 -218.00107292<br />
3.0 -218.17888864<br />
3.5 -218.21314725<br />
4.0 -218.21996456<br />
4.5 -218.22132794<br />
5.0 -218.22061906<br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=File:Spacing_CH4.png&diff=8527File:Spacing CH4.png2016-09-12T10:59:38Z<p>Fnog: Fnog uploaded a new version of &quot;File:Spacing CH4.png&quot;</p>
<hr />
<div></div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8524Tutorial:Total energy convergence2016-09-12T10:42:51Z<p>Fnog: /* Input */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.22<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -16.158998 2.000000<br />
2 -- -9.055957 2.000000<br />
3 -- -9.055957 2.000000<br />
4 -- -9.055957 2.000000<br />
<br />
Energy [eV]:<br />
Total = -218.22140083<br />
Free = -218.22140083<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.65374012<br />
Hartree = 392.31922122<br />
Int[n*v_xc] = -105.19503349<br />
Exchange = -69.53566418<br />
Correlation = -10.99278997<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 161.00368677<br />
External = -927.09881764<br />
Non-local = -45.09601629<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.025 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
# Spacing Total Energy<br />
0.25 -218.91210792<br />
0.225 -218.58099678<br />
0.2 -218.30722313<br />
0.175 -218.21194720<br />
0.15 -218.13042356<br />
0.125 -218.14849946<br />
0.1 -218.14533429<br />
<br />
If you give these numbers to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.175 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
# Radius Total Energy<br />
2.5 -218.00107292<br />
3.0 -218.17888864<br />
3.5 -218.21314725<br />
4.0 -218.21996456<br />
4.5 -218.22132794<br />
5.0 -218.22061906<br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Tutorial:Total_energy_convergence&diff=8517Tutorial:Total energy convergence2016-09-12T10:15:14Z<p>Fnog: /* Convergence */</p>
<hr />
<div>In this example, for the methane molecule CH<sub>4</sub>, we will play a little bit with the spacing and the dimensions of the mesh.<br />
<br />
== Input ==<br />
<br />
In the input file we define a variable CH that represents the bond length between the carbon and the hydrogen atoms. From our basic chemistry class we know that methane has a tetrahedral structure. If we put the carbon atom at the origin, the hydrogen atoms have the coordinates given in the following input file.<br />
<br />
{{variable|CalculationMode|Calculation_Modes}} = gs<br />
{{variable|Units|Execution}} = eV_Angstrom<br />
<br />
{{variable|Radius|Mesh}} = 3.5<br />
{{variable|Spacing|Mesh}} = 0.25<br />
<br />
CH = 1.2<br />
%{{variable|Coordinates|System}}<br />
"C" | 0 | 0 | 0<br />
"H" | CH/sqrt(3) | CH/sqrt(3) | CH/sqrt(3)<br />
"H" | -CH/sqrt(3) |-CH/sqrt(3) | CH/sqrt(3)<br />
"H" | CH/sqrt(3) |-CH/sqrt(3) | -CH/sqrt(3)<br />
"H" | -CH/sqrt(3) | CH/sqrt(3) | -CH/sqrt(3)<br />
%<br />
<br />
We start with a bond length of 1.2 Å but that's not so important at the moment, since we can optimize it later (for more information see the tutorial on [[Tutorial:Geometry optimization|geometry optimization]]). (You should not use 5 Å or so, but something slightly bigger than 1 Å is fine.)<br />
<br />
Some notes concerning the input file:<br />
* We do not tell {{octopus}} explicitly which {{variable|BoxShape|Mesh}} to use. The default is a union of spheres centered around each atom. This turns out to be the most economical choice in almost all cases.<br />
* We also do not specify the %{{variable|Species|System}} block. In this way, {{octopus}} will use default pseudopotentials for both Carbon and Hydrogen. This should be OK in many cases, but, as a rule of thumb, you should do careful testing before using any pseudopotential for serious calculations.<br />
<br />
== Convergence ==<br />
<br />
If you use the given input file you should find the following values in the resulting <tt>static/info</tt> file.<br />
<br />
<pre><br />
Eigenvalues [eV]<br />
#st Spin Eigenvalue Occupation<br />
1 -- -16.158998 2.000000<br />
2 -- -9.055957 2.000000<br />
3 -- -9.055957 2.000000<br />
4 -- -9.055957 2.000000<br />
<br />
Energy [eV]:<br />
Total = -218.22140083<br />
Free = -218.22140083<br />
-----------<br />
Ion-ion = 236.08498119<br />
Eigenvalues = -86.65374012<br />
Hartree = 392.31922122<br />
Int[n*v_xc] = -105.19503349<br />
Exchange = -69.53566418<br />
Correlation = -10.99278997<br />
vanderWaals = 0.00000000<br />
Delta XC = 0.00000000<br />
Entropy = 0.00000000<br />
-TS = -0.00000000<br />
Kinetic = 161.00368677<br />
External = -927.09881764<br />
Non-local = -45.09601629<br />
</pre><br />
<br />
Now the question is whether these values are converged or not. This will depend on the {{variable|Spacing|Mesh}} and the {{variable|Radius|Mesh}}. The only way to answer this question is to try other values for these variables. We will start with the spacing. Since we are interested in the total energy of the system, we will look at the changes of its value. We will keep all entries in the input file fixed except for the spacing that we will make smaller by 0.025 Å all the way down to 0.1 Å. So you have to run {{octopus}} several times (you can use the [[Tutorial:Nitrogen_atom#Finding a good spacing|script]] from the Nitrogen tutorial) to get the following results.<br />
<br />
[[Image:spacing_CH4.png|thumb|350px]]<br />
<br />
# Spacing Total Energy<br />
0.25 -218.91210792<br />
0.225 -218.58099678<br />
0.2 -218.30722313<br />
0.175 -218.21194720<br />
0.15 -218.13042356<br />
0.125 -218.14849946<br />
0.1 -218.14533429<br />
<br />
If you give these numbers to gnuplot (or other software to plot) you will get a curve like the one shown on the right.<br />
<br />
As you can see from this picture, the total energy is converged to within 0.1 eV for a spacing of 0.175 Å. So we will use this spacing for the next calculations, and play with the {{variable|Radius|Mesh}} of the box. We will change the radius in steps of 0.5 Å. Doing this we get<br />
<br />
# Radius Total Energy<br />
2.5 -218.00107292<br />
3.0 -218.17888864<br />
3.5 -218.21314725<br />
4.0 -218.21996456<br />
4.5 -218.22132794<br />
5.0 -218.22061906<br />
<br />
If we again ask for a convergence up to 0.1 eV we should use a radius of 3.5 Å. How does this compare to the size of the molecule? Can you explain why the energy increases (becomes less negative) when one decreases the size of the box?<br />
<br />
{{tutorial_foot|next=Tutorial:Centering geometry|prev=Tutorial:Nitrogen atom}}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Developers:Git_migration&diff=8293Developers:Git migration2016-07-17T06:02:20Z<p>Fnog: </p>
<hr />
<div>Please add you full name and email address to match the user for the migration to git.<br />
<br />
<pre><br />
acastro<br />
adelgado<br />
alejandro<br />
appel<br />
askhl<br />
athimm<br />
cborca<br />
cvsusers<br />
dannert<br />
davidk<br />
dstrubbe<br />
fnog = Fernando Nogueira <fnog@uc.pt><br />
fulvio<br />
helbig<br />
huebener<br />
irina<br />
janwer<br />
jjornet<br />
johanna<br />
joseba<br />
jrfsousa<br />
juho<br />
kkrieger<br />
lehtola<br />
lorenzen<br />
marques<br />
micael<br />
mjv500<br />
nicolastd<br />
nitsche<br />
(noauthor)<br />
octopus-buildbot<br />
olivares<br />
philipp<br />
ravindra<br />
rozzi<br />
sakko<br />
ssato<br />
stella<br />
theophilou<br />
umberto<br />
walkenho<br />
xavier = Xavier Andrade <xavier@tddft.org><br />
</pre></div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Octopus_Developers&diff=7511Octopus Developers2015-01-28T16:38:13Z<p>Fnog: </p>
<hr />
<div>{|<br />
|<br />
Current developers<br />
<br />
* Alberto Castro<br />
* Angel Rubio<br />
* Miguel A.L. Marques (hyllios)<br />
* Micael Oliveira<br />
* [[ user:Carlo|Carlo Andrea Rozzi]]<br />
* [[ user:Xavier|Xavier Andrade]]<br />
* [[ user:Dstrubbe|David Strubbe]]<br />
* [[ user:umbe|Umberto De Giovannini]]<br />
<br />
Former developers<br />
<br />
* Florian Lorenzen<br />
* Heiko Appel<br />
* Arto Sakko<br />
* Danilo Nitsche<br />
|<br />
[[File:P1280019.JPG|600px|thumb|center|]]<br />
|}</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7510Meeting 20152015-01-28T16:36:33Z<p>Fnog: /* Program */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
{|<br />
|<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
|<br />
[[File:P1280019.JPG|600px|thumb|center|]]<br />
|}<br />
<br />
== Program ==<br />
<br />
How to add your slides: (1) click "Upload file" in the toolbox on the left of the screen. (2) Add a link like the ones below.<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, [[media:Talk-octopus2015-castro.pdf|What's new in optimal control]]<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, [[media:2014-12-14_MRS.pptx.pdf|Excited-state forces in TDDFT]]<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Alain<br />
<br />
Irina<br />
<br />
Joseba<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (forces)<br />
<br />
Alberto<br />
<br />
|David (GW/BSE)<br />
<br />
Iris<br />
<br />
Rene<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
[[File:P1280021.JPG|600px|thumb|center|]]<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature '''Accepted'''<br />
# Removal of the single precision code '''Accepted'''<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver '''To be discussed later, after the new libisf is included in the code'''<br />
# Changing the documention and wiki content license from GNU License to CC-BY '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar '''Rejected'''<br />
# Make pseudopotential filtering the default '''Accepted'''<br />
# Remove support for Siesta pseudopotential format '''Accepted'''<br />
# Add complete table of pseudopotentials '''Accepted'''<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2003 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Check the [http://www.tddft.org/programs/octopus/wiki/index.php/Developers:Starting_to_develop new page] for new developers for things missing and tell Nicole ('''everyone''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alain''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here])<br />
# Implement Tkatchenko's van der Waals functional<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7509Meeting 20152015-01-28T16:35:06Z<p>Fnog: /* Program */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
{|<br />
|<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
|<br />
[[File:P1280019.JPG|600px|thumb|center|]]<br />
|}<br />
<br />
== Program ==<br />
<br />
How to add your slides: (1) click "Upload file" in the toolbox on the left of the screen. (2) Add a link like the ones below.<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, [[media:Talk-octopus2015-castro.pdf|What's new in optimal control]]<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, [[media:2014-12-14_MRS.pptx.pdf|Excited-state forces in TDDFT]]<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Alain<br />
<br />
Irina<br />
<br />
Joseba<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (forces)<br />
<br />
Alberto<br />
<br />
|David (GW/BSE)<br />
<br />
Iris<br />
<br />
Rene<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
[[File:P1280021.JPG|600px|thumb|left]]<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature '''Accepted'''<br />
# Removal of the single precision code '''Accepted'''<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver '''To be discussed later, after the new libisf is included in the code'''<br />
# Changing the documention and wiki content license from GNU License to CC-BY '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar '''Rejected'''<br />
# Make pseudopotential filtering the default '''Accepted'''<br />
# Remove support for Siesta pseudopotential format '''Accepted'''<br />
# Add complete table of pseudopotentials '''Accepted'''<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2003 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Check the [http://www.tddft.org/programs/octopus/wiki/index.php/Developers:Starting_to_develop new page] for new developers for things missing and tell Nicole ('''everyone''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alain''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here])<br />
# Implement Tkatchenko's van der Waals functional<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7508Meeting 20152015-01-28T16:32:45Z<p>Fnog: /* List of participants (arrival and departure dates) */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
{|<br />
|<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
|<br />
[[File:P1280019.JPG|600px|thumb|center|]]<br />
|}<br />
<br />
== Program ==<br />
<br />
How to add your slides: (1) click "Upload file" in the toolbox on the left of the screen. (2) Add a link like the ones below.<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, [[media:Talk-octopus2015-castro.pdf|What's new in optimal control]]<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, [[media:2014-12-14_MRS.pptx.pdf|Excited-state forces in TDDFT]]<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Alain<br />
<br />
Irina<br />
<br />
Joseba<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (forces)<br />
<br />
Alberto<br />
<br />
|David (GW/BSE)<br />
<br />
Iris<br />
<br />
Rene<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature '''Accepted'''<br />
# Removal of the single precision code '''Accepted'''<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver '''To be discussed later, after the new libisf is included in the code'''<br />
# Changing the documention and wiki content license from GNU License to CC-BY '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar '''Rejected'''<br />
# Make pseudopotential filtering the default '''Accepted'''<br />
# Remove support for Siesta pseudopotential format '''Accepted'''<br />
# Add complete table of pseudopotentials '''Accepted'''<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2003 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Check the [http://www.tddft.org/programs/octopus/wiki/index.php/Developers:Starting_to_develop new page] for new developers for things missing and tell Nicole ('''everyone''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alain''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here])<br />
# Implement Tkatchenko's van der Waals functional<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=File:P1280021.JPG&diff=7507File:P1280021.JPG2015-01-28T16:28:09Z<p>Fnog: Developer's meeting 2015</p>
<hr />
<div>Developer's meeting 2015</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=File:P1280019.JPG&diff=7505File:P1280019.JPG2015-01-28T16:26:20Z<p>Fnog: Developers' meeting 2015</p>
<hr />
<div>Developers' meeting 2015</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7453Meeting 20152015-01-27T16:20:02Z<p>Fnog: /* Program */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, [[media:2014-12-14_MRS.pptx.pdf|Excited-state forces in TDDFT]]<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Alain<br />
<br />
Irina<br />
<br />
Joseba<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (forces)<br />
<br />
Alberto<br />
<br />
|David (GW/BSE)<br />
<br />
Iris<br />
<br />
Rene<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature '''Accepted'''<br />
# Removal of the single precision code '''Accepted'''<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver '''To be discussed later, after the new libisf is included in the code'''<br />
# Changing the documention and wiki content license from GNU License to CC-BY '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar '''Rejected'''<br />
# Make pseudopotential filtering the default '''Accepted'''<br />
# Remove support for Siesta pseudopotential format '''Accepted'''<br />
# Add complete table of pseudopotentials '''Accepted'''<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2013 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Organize information for new developers on wiki ('''Nicole''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alan''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]) ('''Xavier''')<br />
# Implement Tkatchenko's van der Waals functional ('''Xavier''')<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7444Meeting 20152015-01-27T15:41:12Z<p>Fnog: /* Discussions */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, Excited-state forces in TDDFT<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Irina<br />
<br />
Joseba<br />
<br />
Rene<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (GW/BSE)<br />
<br />
Alberto<br />
<br />
Alain<br />
|David (forces)<br />
<br />
Iris<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature '''Accepted'''<br />
# Removal of the single precision code '''Accepted'''<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver '''To be discussed later, after the new libisf is included in the code'''<br />
# Changing the documention and wiki content license from GNU License to CC-BY '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar '''Rejected'''<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2013 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Organize information for new developers on wiki ('''Nicole''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alan''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]) ('''Xavier''')<br />
# Implement Tkatchenko's van der Waals functional ('''Xavier''')<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7443Meeting 20152015-01-27T15:31:53Z<p>Fnog: /* Discussions */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, Excited-state forces in TDDFT<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Irina<br />
<br />
Joseba<br />
<br />
Rene<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (GW/BSE)<br />
<br />
Alberto<br />
<br />
Alain<br />
|David (forces)<br />
<br />
Iris<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature '''Accepted'''<br />
# Removal of the single precision code '''Accepted'''<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver.<br />
# Changing the documention and wiki content license from GNU License to CC-BY. '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2013 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Organize information for new developers on wiki ('''Nicole''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alan''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]) ('''Xavier''')<br />
# Implement Tkatchenko's van der Waals functional ('''Xavier''')<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7442Meeting 20152015-01-27T15:26:30Z<p>Fnog: /* Discussions */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, Excited-state forces in TDDFT<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Irina<br />
<br />
Joseba<br />
<br />
Rene<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (GW/BSE)<br />
<br />
Alberto<br />
<br />
Alain<br />
|David (forces)<br />
<br />
Iris<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature<br />
# Removal of the single precision code<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver.<br />
# Changing the documention and wiki content license from GNU License to CC-BY. '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2013 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Organize information for new developers on wiki ('''Nicole''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alan''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]) ('''Xavier''')<br />
# Implement Tkatchenko's van der Waals functional ('''Xavier''')<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7441Meeting 20152015-01-27T15:26:06Z<p>Fnog: /* Discussions */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, Excited-state forces in TDDFT<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Irina<br />
<br />
Joseba<br />
<br />
Rene<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (GW/BSE)<br />
<br />
Alberto<br />
<br />
Alain<br />
|David (forces)<br />
<br />
Iris<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.''' '''Accepted'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code '''Accepted'''<br />
# Removal of the "datasets" feature<br />
# Removal of the single precision code<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver.<br />
# Changing the documention and wiki content license from GNU License to CC-BY. '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2013 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Organize information for new developers on wiki ('''Nicole''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alan''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]) ('''Xavier''')<br />
# Implement Tkatchenko's van der Waals functional ('''Xavier''')<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7440Meeting 20152015-01-27T15:23:47Z<p>Fnog: /* Discussions */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, Excited-state forces in TDDFT<br />
# David Strubbe, [[media:Strubbe_Octopus_testsuite.pptx.pdf|The Octopus/APE/BerkeleyGW testsuite infrastructure]]<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
This is a preliminary program:<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|David (Testsuite infrastructure)<br />
<br />
Coding Party - II<br />
|Irina<br />
<br />
Joseba<br />
<br />
Rene<br />
<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
Coding Party I<br />
| David (GW/BSE)<br />
<br />
Alberto<br />
<br />
Alain<br />
|David (forces)<br />
<br />
Iris<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the Konferenzraum (take the right stairs) in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== New reference ==<br />
<br />
Paper recently submitted: http://arxiv.org/abs/1501.05654<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule: '''Decision to release every year on the 1st of February plus eventual bug-fix releases every few months.''' '''Accepted'''<br />
# Making sure all people doing development have commit access, and are committing their work regularly '''Accepted'''<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here]) '''Accepted'''<br />
# Removal of the "frozen" code '''Not yet'''<br />
# Removal of the open-quantum-systems code<br />
# Removal of the "datasets" feature<br />
# Removal of the single precision code<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver.<br />
# Changing the documention and wiki content license from GNU License to CC-BY. '''Decision to do it, pending approval by other major contributors'''<br />
# Migrate from SVN to Bazaar<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Detect unused variables in input (Miguel) and update interface to F2013 release and correct liboct_parser 2.0 ('''Miguel, Micael''').<br />
# Organize information for new developers on wiki ('''Nicole''').<br />
# Refactoring of the test farm ('''Micael, Alejandro''')<br />
# Migrating www.tddft.org to a new machine ('''Fernando, Miguel''')<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts ('''David, Micael''')<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref]) Note: With the new interpolation code it is possible to simplify the calculation by using the Hartree potential. ('''Carlo''') <br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library ('''Joseba, Micael''')<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials ('''Pedro Borlido, Matthieu/Nicole''') and complete tutorial of solids ('''David''')<br />
# Parallelization of photoemission ('''Tilman, Umberto, David''')<br />
# Revise coding standards<br />
# See whether everything set as experimental really needs to be<br />
# Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here]) ('''Ravindra, Matthieu, Umberto''')<br />
# Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here]) ('''Fernando''')<br />
# Exchange term in Casida for TD Hartree-Fock or hybrids ('''David, Nicole, Iris, Alan''')<br />
# Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this]) ('''Alejandro, Miguel''')<br />
# Parallelize exact exchange in states, by merging with OEP implementation<br />
# Make LCAO work properly for spinors<br />
# Make Sternheimer equation parallel in states ('''David''')<br />
# Start PAW implementation<br />
# Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0) <br />
# Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]) ('''Xavier''')<br />
# Implement Tkatchenko's van der Waals functional ('''Xavier''')<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2015&diff=7397Meeting 20152015-01-25T19:06:57Z<p>Fnog: /* List of participants (arrival and departure dates) */</p>
<hr />
<div>= Octopus developers meeting - 26-30 January 2015 =<br />
The second Octopus developers meeting will take place at the Friedrich-Schiller University of Jena, Germany from the 26 to the 30 of January 2015. <br />
It will consist of one or two days dedicated to presentations and discussions followed by a coding party. <br />
<br />
== Organizers ==<br />
<br />
Silvana Botti, Miguel Marques, Sylvia Hennig<br />
<br />
We thank the Faculty of Physics and Astronomy of the University of Jena<br />
for financial and logistical support.<br />
<br />
== List of participants (arrival and departure dates) ==<br />
<br />
# Micael Oliveira (Monday afternoon - Friday afternoon)<br />
# Miguel Marques (Monday afternoon - Friday afternoon)<br />
# Silvana Botti<br />
# Nicole Helbig (Monday afternoon - Friday afternoon)<br />
# Alberto Castro (Tuesday morning - Friday morning)<br />
# Joseba Alberdi (Monday evening - Friday midday)<br />
# Alain Delgado Gran (Monday evening - Friday morning)<br />
# Irina Lebedeva (Monday evening - Friday midday)<br />
# Umberto De Giovannini (Monday evening - Thursday morning)<br />
# Tiago Cerqueira <br />
# Rafael Sarmiento Pérez<br />
# Ravindra Shinde (Monday evening - Friday midday)<br />
# Matthieu Verstraete (Monday afternoon - Friday afternoon)<br />
# Philipp Wopperer (Monday evening - Friday midday)<br />
# Alejandro Varas (Monday evening - Friday midday)<br />
# Xavier Andrade<br />
# Iris Theophilou (Monday afternoon - Friday afternoon)<br />
# Fernando Nogueira (Monday evening - Friday early morning)<br />
# David Strubbe (Monday morning - Thursday morning)<br />
# Rene Jestaedt<br />
# Carlo Andrea Rozzi (Monday evening - Thursday morning)<br />
# Tilman Dannert (Monday morning - Wednesday afternoon)<br />
<br />
== Program ==<br />
<br />
Please add your name below (and a tentative title) if you intend to give a presentation at the meeting<br />
# Irina Lebedeva, Magneto-optical response of periodic insulators<br />
# Xavier Andrade, Real-time time-dependent functional theory for solids (will not make it)<br />
# (optional) Xavier Andrade, Compressed sensing for the fast calculation of matrices<br />
# (optional) Xavier Andrade, States, batches, and GPUs (short, technical talk about the code)<br />
# Alberto Castro, What's new in optimal control.<br />
# Tim Baldsiefen/Jan Werschnik, Short talk (15m), Real-world problems of interest in optics<br />
# Iris Theophilou, RDMFT implementation in octopus<br />
# Micael Oliveira, Short talk (10m), The CECAM Electronic Structure Library<br />
# Alain Delgado Gran, Polarizable Continuum Model implementation in Octopus.<br />
# Rene Jestaedt, Real-time propagation of coupled Maxwell-Schrödinger and time-dependent Kohn-Sham-Maxwell systems<br />
# David Strubbe, Octopus as starting point for GW/BSE calculations in BerkeleyGW<br />
# David Strubbe, Excited-state forces in TDDFT<br />
# David Strubbe, The Octopus/APE/BerkeleyGW testsuite infrastructure (short talk)<br />
# David Hilditch, Numerical general relativity (fun stuff that you can do with meshes)<br />
<br />
These is a preliminary program<br />
<br />
{|<br />
! <br />
!Monday <br />
!Tuesday <br />
!Wednesday <br />
!Thursday <br />
!Friday<br />
|- style="vertical-align:top;"<br />
!Morning<br />
| -<br />
|Coding Party - II<br />
|Irina<br />
<br />
Rene<br />
|David Hilditch<br />
<br />
Coding Party - III<br />
|Coding Party - IV<br />
|- style="vertical-align:top;"<br />
!Afternoon<br />
|Welcome<br />
<br />
David (Testsuite infrastructure)<br />
<br />
Coding Party I<br />
| David (GW/BSE)<br />
<br />
Alberto<br />
<br />
Alain<br />
|David (forces)<br />
<br />
Iris<br />
<br />
Micael<br />
<br />
Tim/Jan (short talk at at 6pm)<br />
|Visit to the Carl Zeiss factory<br />
|- style="vertical-align:top;"<br />
!Evening<br />
| -<br />
| -<br />
|Dinner at Landgrafen<br />
|Let us go for beer<br />
| -<br />
|}<br />
<br />
In the morning sessions will start at 9.00 (we are not a lazy bunch), coffee breaks at 10.30 (with wonderful cookies from Kahla, already tested by the organizers). Lunch is at 12.30 in the mensa. Afternoon sessions start at 13.30, coffee breaks at 15.00, end at 17.00.<br />
<br />
The sessions will take place at the seminar room in Max Wien Platz 1 (2nd floor). If you arrive Monday morning, you can find us in Silvana's offices in Fröbelstieg 1 (2nd floor).<br />
<br />
== Discussions ==<br />
<br />
These are topics we should discuss during the meeting<br />
<br />
# Release schedule<br />
# Making sure all people doing development have commit access, and are committing their work regularly<br />
# Adoption of Fortran 2003 features (a list of compiler support can be found [http://fortranwiki.org/fortran/show/Fortran+2003+status here])<br />
# Removal of the "frozen" code<br />
# Removal of the open-quantum-systems code<br />
# Removal of the "datasets" feature<br />
# Suggestion by Pablo García Risueño to change the default Poisson solver.<br />
# Changing the documention and wiki content license from GNU License to CC-BY.<br />
<br />
== Coding sessions ==<br />
<br />
Here is a list of proposed topics for the coding party. Feel free to add more items to the list.<br />
# Refactoring of the test farm<br />
# Migrating www.tddft.org to a new machine<br />
# Merge the different versions of the Octopus/APE/BerkeleyGW testsuite scripts<br />
# For partially periodic systems, fix Poisson solver and implement Ewald sums ([http://kfe.fjfi.cvut.cz/~klimo/mpf/Ewald_notes.pdf ref])<br />
# Implementation of the new LibISF API & start the extraction of the code, to include it as external library<br />
# Sort out whether there is any real issue regarding this warning: "Multiple periodic replicas in the same region will not be considered"<br />
# Review, update, and extend tutorials<br />
# Making a clear set of coding standards<br />
# Implementations (suggestions)<br />
## Non-orthogonal unit-cells (formulas can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.78.075109 here])<br />
## Use fxc from libxc for GGAs (the formula can be found [http://journals.aps.org/prb/pdf/10.1103/PhysRevB.69.115106 here] and [http://www.tddft.org/TDDFT2004/PracticalSessions/papers/ahlrichs_casida.pdf here])<br />
## Range-separated hybrids (''e.g.'' HSE, CAM-B3LYP, PBE0)<br />
## Exchange term in Casida for TD Hartree-Fock or hybrids<br />
## Constraints in geometry optimization (make a real C library out of [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/constraints.py this])<br />
## Start PAW implementation<br />
## Implement Swedish van der Waals functionals (Soler's formulation is [http://arxiv.org/abs/0812.0244 here]).<br />
## Implement Tkatchenko's van der Waals functional.<br />
## Make Sternheimer equation parallel in states<br />
## Parallelize exact exchange in states, by merging with OEP implementation<br />
## Make LCAO work properly for spinors<br />
<br />
== Practical information ==<br />
<br />
The meeting will be in [https://maps.google.com/maps?q=Max-Wien-Platz+1,+Jena,+Germany&hl=en&ll=50.93407,11.583954&spn=0.001114,0.002216&sll=37.0625,-95.677068&sspn=45.601981,72.597656&oq=Max+Wien+Platz+1&t=h&hnear=Max-Wien-Platz+1,+07743+Jena,+Germany&z=19 Max Wien Platz 1] in the Conference Room. Silvana's group is located 100 meters away in another building. You can find information how to reach it [http://www.ifto.uni-jena.de/en/find.html here].<br />
<br />
The [http://en.steigenberger.com/Jena/Steigenberger-Esplanade hotel] is [https://maps.google.de/maps?q=steigenberger+esplanade+hotel+jena&ll=50.927414,11.581897&spn=0.002228,0.004431&oe=utf-8&client=firefox-a&fb=1&gl=de&cid=15124743449003887317&t=h&z=18 here]<br />
<br />
Notice that Jena is a very small (and charming) city, so you can basically go everywhere walking.</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Meeting_2012&diff=6493Meeting 20122012-08-21T14:10:50Z<p>Fnog: /* list of participants */</p>
<hr />
<div>= Octopus developers meeting - 22/23 October 2012 =<br />
The first octopus developers meeting will take place at the [https://maps.google.com/maps?q=45.781916,4.867321&num=1&t=h&sspn=0,0&hl=en&ie=UTF8&ll=45.781965,4.867681&spn=0.000632,0.001062&z=20 LPMCN] in Lyon, France on the 22 and 23 of October 2012. I will consist in a "scientific" day dedicated to recent or future scientific developments, and a "technical" day to discuss all technical issues related to paralellization, libraries, efficiency, etc.<br />
<br />
== list of participants ==<br />
<br />
* Miguel Marques<br />
* Alberto Castro<br />
* Xavier Andrade<br />
* Nicole Helbig<br />
* Micael Oliveira<br />
* David Strubbe<br />
* Joseba Alberdi<br />
* Angel Rubio<br />
* Umberto De Giovannini<br />
* Lorenzo Stella<br />
* Matthieu Verstraete<br />
* Theodoros Papadopoulos<br />
* Fernando Nogueira<br />
<br />
== Program ==<br />
<br />
Please add your name here (and a tentative title) if you intend to give a presentation at the meeting<br />
<br />
=== Scientific day ===<br />
<br />
* Nicole Helbig - modelmb, how to treat more particles in fewer dimensions<br />
<br />
=== Technical day ===<br />
* Miguel Marques - libxc, a library of exchange-correlation functionals<br />
* Xavier Andrade - GPU support in Octopus<br />
* Xavier Andrade - Compressed sensing<br />
* Joseba Alberdi - Scalability of the Poisson solvers</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Compiling_octopus_in_OS_X&diff=5722Compiling octopus in OS X2010-02-04T16:48:10Z<p>Fnog: /* Build parallel version of octopus */</p>
<hr />
<div>== Installing the GNU compilers and tools ==<br />
<br />
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either [http://www.macports.org/ macports] or [http://www.finkproject.org/ fink]. These instructions always assume that you are using macports. <br />
<br />
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at [http://developer.apple.com/tools/ Apple's Developer Connection].<br />
<br />
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.<br />
<br />
The packages you should now install are gcc44, automake, autoconf, and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf '''before''' you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it (you'll have to be root or use sudo to do this). To install the packages you just need to do ''port selfupdate'' to get the most recent package database and then ''port install gcc44 automake autoconf gsl''. Again, you'll have to login as root or use sudo to install packages. Leave your computer running and go for a looong coffee.<br />
<br />
== Installing the required libraries ==<br />
<br />
Now you have to install the other libraries octopus requires: blas, lapack, sparskit, fftw, netcdf, etsf_io, and mpich2. '''Don't''' do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran (with the possible exception of blas/lapack - see below). And you will not be able to link octopus with them...<br />
<br />
To be sure you are really compiling with gfortran in 64 bits, it is recommended to set these environment variables before building the libraries:<br />
<br />
export FC="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F77="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F90="gfortran-mp-4.4 -m64"<br />
<br /><br />
export CC="gcc-mp-4.4 -m64"<br />
<br /><br />
export CXX="g++-mp-4.4 -m64"<br />
<br /><br />
export CPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCCPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export FFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export F90FLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br />
All these variables might be overkill, as most of the libraries read only one or two of them, but it's better to be safe than sorry ;-) Now, in order to build the libraries you just need to follow the standard ''configure'', ''make'', ''make install'' sequence:<br />
<br />
=== Build mpich2 (optional) ===<br />
<br />
Get [http://www.mcs.anl.gov/research/projects/mpich2/ mpich2], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-smpcoll --enable-f77 --enable-f90 --enable-cxx --enable-mpe --enable-sharedlibs=osx-gcc --enable-fast<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build fftw ===<br />
<br />
Get [http://www.fftw.org/ fftw], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-shared --enable-sse2 --enable-static --enable-threads --with-combined-threads<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
If you want to build fftw with MPI, add ''--enable-mpi'' to the configure line after changing these environment variables:<br />
<br />
export FC="$HOME/bin/mpif90"<br />
<br /><br />
export CC="$HOME/bin/mpicc"<br />
<br />
Don't forget to change these variables back to their original values after compiling fftw.<br />
<br />
=== Build netcdf ===<br />
<br />
Get [http://www.unidata.ucar.edu/software/netcdf/ netcdf], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure CPPFLAGS='-DpgiFortran' --disable-cxx --prefix=$HOME<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
You can ''make check'' just to confirm that everything went OK.<br />
<br />
=== Build etsf_io ===<br />
<br />
Get [http://www.etsf.eu/resources/software/libraries_and_tools etsf_io], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --with-netcdf-module-path=$HOME/include --with-netcdf-ldflags="-L$HOME/lib -lnetcdf" --with-moduledir=$HOME/include<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build blas and lapack ===<br />
<br />
Now you need to install BLAS and LAPACK. The easiest solution is to get the ''original'' sources and just compile them. You will not have the fastest BLAS implementation, but it will work! Another option is to install ATLAS using macports. Note that macports currently compiles ATLAS with gcc/gfortran 4.3, and we have been assuming that everything is compiled with gcc/gfortran 4.4. There should be no problems with this, but to be on the safe side, just do ''port edit atlas'' and replace all references to the 4.3 version in the Portfile by references to the 4.4 version. Then compile as usual: ''port install atlas''.<br />
<br />
=== Build SPARSKIT ===<br />
<br />
Get [http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html SPARSKIT2], untar it and ''cd'' to the directory where you untared it. Then edit ''makefile'' and set ''F77=gfortran-mp-4.4 -m64''. Save the makefile and type ''make''. When compilation finishes just copy ''libskit.a'' to $HOME/lib.<br />
<br />
== Build serial version of octopus ==<br />
<br />
Now you need to tell octopus' configure script about all the libraries you have just compiled:<br />
<br />
export LIBS_BLAS="-L/opt/local/lib -llapack -latlas -lptcblas -lptf77blas"<br />
<br /><br />
export LIBS_FFT="-L$HOME/lib -lfftw3"<br />
<br /><br />
export LIBS_NETCDF="-L$HOME/lib -lnetcdf"<br />
<br /><br />
export LIBS_ETSF_IO="$HOME/lib/libetsf_io.a $HOME/lib/libetsf_io_utils.a $HOME/lib/libetsf_io_low_level.a"<br />
<br />
Then it is just a matter of typing:<br />
<br />
./configure -prefix=$HOME --enable-gdlib --disable-libnbc --disable-mpi --with-netcdf="$LIBS_NETCDF" --with-sparskit=$HOME/lib/libskit.a --with-etsf-io="$LIBS_ETSF_IO"<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
== Build parallel version of octopus ==<br />
<br />
If you want to use all of your cores/cpus when running octopus, then you need to compile a parallel version of it. It is relatively straightforward. Start by exporting the same environment variables as in the serial case. Then remember that you need to use the 'MPI' compilers:<br />
<br />
export CC="$HOME/bin/mpicc"<br />
<br /><br />
export FC="$HOME/bin/mpif90" <br />
<br />
You need to specify the full path to these scripts, otherwise octopus will use the system ''mpicc'' and ''mpif90'', which will not work. Then type:<br />
<br />
./configure -prefix=$HOME --enable-gdlib --disable-libnbc --enable-mpi --with-netcdf="$LIBS_NETCDF" --with-sparskit=$HOME/lib/libskit.a --with-etsf-io="$LIBS_ETSF_IO"<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
Et voilà!</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Compiling_octopus_in_OS_X&diff=5721Compiling octopus in OS X2010-02-04T16:47:38Z<p>Fnog: /* Build parallel version of octopus */</p>
<hr />
<div>== Installing the GNU compilers and tools ==<br />
<br />
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either [http://www.macports.org/ macports] or [http://www.finkproject.org/ fink]. These instructions always assume that you are using macports. <br />
<br />
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at [http://developer.apple.com/tools/ Apple's Developer Connection].<br />
<br />
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.<br />
<br />
The packages you should now install are gcc44, automake, autoconf, and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf '''before''' you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it (you'll have to be root or use sudo to do this). To install the packages you just need to do ''port selfupdate'' to get the most recent package database and then ''port install gcc44 automake autoconf gsl''. Again, you'll have to login as root or use sudo to install packages. Leave your computer running and go for a looong coffee.<br />
<br />
== Installing the required libraries ==<br />
<br />
Now you have to install the other libraries octopus requires: blas, lapack, sparskit, fftw, netcdf, etsf_io, and mpich2. '''Don't''' do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran (with the possible exception of blas/lapack - see below). And you will not be able to link octopus with them...<br />
<br />
To be sure you are really compiling with gfortran in 64 bits, it is recommended to set these environment variables before building the libraries:<br />
<br />
export FC="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F77="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F90="gfortran-mp-4.4 -m64"<br />
<br /><br />
export CC="gcc-mp-4.4 -m64"<br />
<br /><br />
export CXX="g++-mp-4.4 -m64"<br />
<br /><br />
export CPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCCPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export FFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export F90FLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br />
All these variables might be overkill, as most of the libraries read only one or two of them, but it's better to be safe than sorry ;-) Now, in order to build the libraries you just need to follow the standard ''configure'', ''make'', ''make install'' sequence:<br />
<br />
=== Build mpich2 (optional) ===<br />
<br />
Get [http://www.mcs.anl.gov/research/projects/mpich2/ mpich2], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-smpcoll --enable-f77 --enable-f90 --enable-cxx --enable-mpe --enable-sharedlibs=osx-gcc --enable-fast<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build fftw ===<br />
<br />
Get [http://www.fftw.org/ fftw], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-shared --enable-sse2 --enable-static --enable-threads --with-combined-threads<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
If you want to build fftw with MPI, add ''--enable-mpi'' to the configure line after changing these environment variables:<br />
<br />
export FC="$HOME/bin/mpif90"<br />
<br /><br />
export CC="$HOME/bin/mpicc"<br />
<br />
Don't forget to change these variables back to their original values after compiling fftw.<br />
<br />
=== Build netcdf ===<br />
<br />
Get [http://www.unidata.ucar.edu/software/netcdf/ netcdf], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure CPPFLAGS='-DpgiFortran' --disable-cxx --prefix=$HOME<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
You can ''make check'' just to confirm that everything went OK.<br />
<br />
=== Build etsf_io ===<br />
<br />
Get [http://www.etsf.eu/resources/software/libraries_and_tools etsf_io], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --with-netcdf-module-path=$HOME/include --with-netcdf-ldflags="-L$HOME/lib -lnetcdf" --with-moduledir=$HOME/include<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build blas and lapack ===<br />
<br />
Now you need to install BLAS and LAPACK. The easiest solution is to get the ''original'' sources and just compile them. You will not have the fastest BLAS implementation, but it will work! Another option is to install ATLAS using macports. Note that macports currently compiles ATLAS with gcc/gfortran 4.3, and we have been assuming that everything is compiled with gcc/gfortran 4.4. There should be no problems with this, but to be on the safe side, just do ''port edit atlas'' and replace all references to the 4.3 version in the Portfile by references to the 4.4 version. Then compile as usual: ''port install atlas''.<br />
<br />
=== Build SPARSKIT ===<br />
<br />
Get [http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html SPARSKIT2], untar it and ''cd'' to the directory where you untared it. Then edit ''makefile'' and set ''F77=gfortran-mp-4.4 -m64''. Save the makefile and type ''make''. When compilation finishes just copy ''libskit.a'' to $HOME/lib.<br />
<br />
== Build serial version of octopus ==<br />
<br />
Now you need to tell octopus' configure script about all the libraries you have just compiled:<br />
<br />
export LIBS_BLAS="-L/opt/local/lib -llapack -latlas -lptcblas -lptf77blas"<br />
<br /><br />
export LIBS_FFT="-L$HOME/lib -lfftw3"<br />
<br /><br />
export LIBS_NETCDF="-L$HOME/lib -lnetcdf"<br />
<br /><br />
export LIBS_ETSF_IO="$HOME/lib/libetsf_io.a $HOME/lib/libetsf_io_utils.a $HOME/lib/libetsf_io_low_level.a"<br />
<br />
Then it is just a matter of typing:<br />
<br />
./configure -prefix=$HOME --enable-gdlib --disable-libnbc --disable-mpi --with-netcdf="$LIBS_NETCDF" --with-sparskit=$HOME/lib/libskit.a --with-etsf-io="$LIBS_ETSF_IO"<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
== Build parallel version of octopus ==<br />
<br />
If you want to use all of your cores/cpus when running octopus, then you need to compile a parallel version of it. It is relatively straightforward. Start by exporting the same environment variables as in the serial case. Then remember that you need to use the 'MPI' compilers:<br />
<br />
export CC="$HOME/bin/mpicc"<br />
<br /><br />
export FC="$HOME/bin/mpif90" <br />
<br />
You need to specify the full path to these scripts, otherwise octopus will use the system ''mpicc'' and ''mpif90'', which will not work. Then type:<br />
<br />
./configure -prefix=$HOME --enable-gdlib --disable-libnbc --enable-mpi --with-netcdf="$LIBS_NETCDF" --with-sparskit=$HOME/lib/libskit.a --with-etsf-io="$LIBS_ETSF_IO"<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
Et voilá!</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Compiling_octopus_in_OS_X&diff=5720Compiling octopus in OS X2010-02-04T16:42:23Z<p>Fnog: /* Build serial version of octopus */</p>
<hr />
<div>== Installing the GNU compilers and tools ==<br />
<br />
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either [http://www.macports.org/ macports] or [http://www.finkproject.org/ fink]. These instructions always assume that you are using macports. <br />
<br />
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at [http://developer.apple.com/tools/ Apple's Developer Connection].<br />
<br />
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.<br />
<br />
The packages you should now install are gcc44, automake, autoconf, and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf '''before''' you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it (you'll have to be root or use sudo to do this). To install the packages you just need to do ''port selfupdate'' to get the most recent package database and then ''port install gcc44 automake autoconf gsl''. Again, you'll have to login as root or use sudo to install packages. Leave your computer running and go for a looong coffee.<br />
<br />
== Installing the required libraries ==<br />
<br />
Now you have to install the other libraries octopus requires: blas, lapack, sparskit, fftw, netcdf, etsf_io, and mpich2. '''Don't''' do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran (with the possible exception of blas/lapack - see below). And you will not be able to link octopus with them...<br />
<br />
To be sure you are really compiling with gfortran in 64 bits, it is recommended to set these environment variables before building the libraries:<br />
<br />
export FC="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F77="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F90="gfortran-mp-4.4 -m64"<br />
<br /><br />
export CC="gcc-mp-4.4 -m64"<br />
<br /><br />
export CXX="g++-mp-4.4 -m64"<br />
<br /><br />
export CPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCCPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export FFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export F90FLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br />
All these variables might be overkill, as most of the libraries read only one or two of them, but it's better to be safe than sorry ;-) Now, in order to build the libraries you just need to follow the standard ''configure'', ''make'', ''make install'' sequence:<br />
<br />
=== Build mpich2 (optional) ===<br />
<br />
Get [http://www.mcs.anl.gov/research/projects/mpich2/ mpich2], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-smpcoll --enable-f77 --enable-f90 --enable-cxx --enable-mpe --enable-sharedlibs=osx-gcc --enable-fast<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build fftw ===<br />
<br />
Get [http://www.fftw.org/ fftw], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-shared --enable-sse2 --enable-static --enable-threads --with-combined-threads<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
If you want to build fftw with MPI, add ''--enable-mpi'' to the configure line after changing these environment variables:<br />
<br />
export FC="$HOME/bin/mpif90"<br />
<br /><br />
export CC="$HOME/bin/mpicc"<br />
<br />
Don't forget to change these variables back to their original values after compiling fftw.<br />
<br />
=== Build netcdf ===<br />
<br />
Get [http://www.unidata.ucar.edu/software/netcdf/ netcdf], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure CPPFLAGS='-DpgiFortran' --disable-cxx --prefix=$HOME<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
You can ''make check'' just to confirm that everything went OK.<br />
<br />
=== Build etsf_io ===<br />
<br />
Get [http://www.etsf.eu/resources/software/libraries_and_tools etsf_io], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --with-netcdf-module-path=$HOME/include --with-netcdf-ldflags="-L$HOME/lib -lnetcdf" --with-moduledir=$HOME/include<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build blas and lapack ===<br />
<br />
Now you need to install BLAS and LAPACK. The easiest solution is to get the ''original'' sources and just compile them. You will not have the fastest BLAS implementation, but it will work! Another option is to install ATLAS using macports. Note that macports currently compiles ATLAS with gcc/gfortran 4.3, and we have been assuming that everything is compiled with gcc/gfortran 4.4. There should be no problems with this, but to be on the safe side, just do ''port edit atlas'' and replace all references to the 4.3 version in the Portfile by references to the 4.4 version. Then compile as usual: ''port install atlas''.<br />
<br />
=== Build SPARSKIT ===<br />
<br />
Get [http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html SPARSKIT2], untar it and ''cd'' to the directory where you untared it. Then edit ''makefile'' and set ''F77=gfortran-mp-4.4 -m64''. Save the makefile and type ''make''. When compilation finishes just copy ''libskit.a'' to $HOME/lib.<br />
<br />
== Build serial version of octopus ==<br />
<br />
Now you need to tell octopus' configure script about all the libraries you have just compiled:<br />
<br />
export LIBS_BLAS="-L/opt/local/lib -llapack -latlas -lptcblas -lptf77blas"<br />
<br /><br />
export LIBS_FFT="-L$HOME/lib -lfftw3"<br />
<br /><br />
export LIBS_NETCDF="-L$HOME/lib -lnetcdf"<br />
<br /><br />
export LIBS_ETSF_IO="$HOME/lib/libetsf_io.a $HOME/lib/libetsf_io_utils.a $HOME/lib/libetsf_io_low_level.a"<br />
<br />
Then it is just a matter of typing:<br />
<br />
./configure -prefix=$HOME --enable-gdlib --disable-libnbc --disable-mpi --with-netcdf="$LIBS_NETCDF" --with-sparskit=$HOME/lib/libskit.a --with-etsf-io="$LIBS_ETSF_IO"<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
== Build parallel version of octopus ==</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Compiling_octopus_in_OS_X&diff=5719Compiling octopus in OS X2010-02-04T16:40:10Z<p>Fnog: /* Build serial version of octopus */</p>
<hr />
<div>== Installing the GNU compilers and tools ==<br />
<br />
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either [http://www.macports.org/ macports] or [http://www.finkproject.org/ fink]. These instructions always assume that you are using macports. <br />
<br />
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at [http://developer.apple.com/tools/ Apple's Developer Connection].<br />
<br />
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.<br />
<br />
The packages you should now install are gcc44, automake, autoconf, and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf '''before''' you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it (you'll have to be root or use sudo to do this). To install the packages you just need to do ''port selfupdate'' to get the most recent package database and then ''port install gcc44 automake autoconf gsl''. Again, you'll have to login as root or use sudo to install packages. Leave your computer running and go for a looong coffee.<br />
<br />
== Installing the required libraries ==<br />
<br />
Now you have to install the other libraries octopus requires: blas, lapack, sparskit, fftw, netcdf, etsf_io, and mpich2. '''Don't''' do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran (with the possible exception of blas/lapack - see below). And you will not be able to link octopus with them...<br />
<br />
To be sure you are really compiling with gfortran in 64 bits, it is recommended to set these environment variables before building the libraries:<br />
<br />
export FC="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F77="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F90="gfortran-mp-4.4 -m64"<br />
<br /><br />
export CC="gcc-mp-4.4 -m64"<br />
<br /><br />
export CXX="g++-mp-4.4 -m64"<br />
<br /><br />
export CPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCCPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export FFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export F90FLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br />
All these variables might be overkill, as most of the libraries read only one or two of them, but it's better to be safe than sorry ;-) Now, in order to build the libraries you just need to follow the standard ''configure'', ''make'', ''make install'' sequence:<br />
<br />
=== Build mpich2 (optional) ===<br />
<br />
Get [http://www.mcs.anl.gov/research/projects/mpich2/ mpich2], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-smpcoll --enable-f77 --enable-f90 --enable-cxx --enable-mpe --enable-sharedlibs=osx-gcc --enable-fast<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build fftw ===<br />
<br />
Get [http://www.fftw.org/ fftw], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-shared --enable-sse2 --enable-static --enable-threads --with-combined-threads<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
If you want to build fftw with MPI, add ''--enable-mpi'' to the configure line after changing these environment variables:<br />
<br />
export FC="$HOME/bin/mpif90"<br />
<br /><br />
export CC="$HOME/bin/mpicc"<br />
<br />
Don't forget to change these variables back to their original values after compiling fftw.<br />
<br />
=== Build netcdf ===<br />
<br />
Get [http://www.unidata.ucar.edu/software/netcdf/ netcdf], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure CPPFLAGS='-DpgiFortran' --disable-cxx --prefix=$HOME<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
You can ''make check'' just to confirm that everything went OK.<br />
<br />
=== Build etsf_io ===<br />
<br />
Get [http://www.etsf.eu/resources/software/libraries_and_tools etsf_io], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --with-netcdf-module-path=$HOME/include --with-netcdf-ldflags="-L$HOME/lib -lnetcdf" --with-moduledir=$HOME/include<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build blas and lapack ===<br />
<br />
Now you need to install BLAS and LAPACK. The easiest solution is to get the ''original'' sources and just compile them. You will not have the fastest BLAS implementation, but it will work! Another option is to install ATLAS using macports. Note that macports currently compiles ATLAS with gcc/gfortran 4.3, and we have been assuming that everything is compiled with gcc/gfortran 4.4. There should be no problems with this, but to be on the safe side, just do ''port edit atlas'' and replace all references to the 4.3 version in the Portfile by references to the 4.4 version. Then compile as usual: ''port install atlas''.<br />
<br />
=== Build SPARSKIT ===<br />
<br />
Get [http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html SPARSKIT2], untar it and ''cd'' to the directory where you untared it. Then edit ''makefile'' and set ''F77=gfortran-mp-4.4 -m64''. Save the makefile and type ''make''. When compilation finishes just copy ''libskit.a'' to $HOME/lib.<br />
<br />
== Build serial version of octopus ==<br />
<br />
Now you need to tell octopus' configure script about all the libraries you have just compiled:<br />
<br />
export LIBS_BLAS="-L/opt/local/lib -llapack -latlas -lptcblas -lptf77blas"<br />
<br /><br />
export LIBS_FFT="-L$HOME/lib -lfftw3"<br />
<br /><br />
export LIBS_NETCDF="-L$HOME/lib -lnetcdf"<br />
<br /><br />
export LIBS_ETSF_IO="$HOME/lib/libetsf_io.a $HOME/lib/libetsf_io_utils.a $HOME/lib/libetsf_io_low_level.a"<br />
<br />
Then it is just a matter of typing:<br />
<br />
./configure -prefix=$HOME --enable-gdlib --disable-libnbc --disable-mpi --with-netcdf="$LIBS_NETCDF" --with-sparskit=$HOME/lib/libskit.a --with-etsf-io="$LIBS_ETSF_IO"<br />
<br /><br />
make<br />
<br /><br />
make install</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Compiling_octopus_in_OS_X&diff=5718Compiling octopus in OS X2010-02-04T16:36:36Z<p>Fnog: /* Installing the required libraries */</p>
<hr />
<div>== Installing the GNU compilers and tools ==<br />
<br />
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either [http://www.macports.org/ macports] or [http://www.finkproject.org/ fink]. These instructions always assume that you are using macports. <br />
<br />
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at [http://developer.apple.com/tools/ Apple's Developer Connection].<br />
<br />
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.<br />
<br />
The packages you should now install are gcc44, automake, autoconf, and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf '''before''' you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it (you'll have to be root or use sudo to do this). To install the packages you just need to do ''port selfupdate'' to get the most recent package database and then ''port install gcc44 automake autoconf gsl''. Again, you'll have to login as root or use sudo to install packages. Leave your computer running and go for a looong coffee.<br />
<br />
== Installing the required libraries ==<br />
<br />
Now you have to install the other libraries octopus requires: blas, lapack, sparskit, fftw, netcdf, etsf_io, and mpich2. '''Don't''' do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran (with the possible exception of blas/lapack - see below). And you will not be able to link octopus with them...<br />
<br />
To be sure you are really compiling with gfortran in 64 bits, it is recommended to set these environment variables before building the libraries:<br />
<br />
export FC="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F77="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F90="gfortran-mp-4.4 -m64"<br />
<br /><br />
export CC="gcc-mp-4.4 -m64"<br />
<br /><br />
export CXX="g++-mp-4.4 -m64"<br />
<br /><br />
export CPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCCPP="cpp-mp-4.4 -m64 -ansi"<br />
<br /><br />
export FCFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export FFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export F90FLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br />
All these variables might be overkill, as most of the libraries read only one or two of them, but it's better to be safe than sorry ;-) Now, in order to build the libraries you just need to follow the standard ''configure'', ''make'', ''make install'' sequence:<br />
<br />
=== Build mpich2 (optional) ===<br />
<br />
Get [http://www.mcs.anl.gov/research/projects/mpich2/ mpich2], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-smpcoll --enable-f77 --enable-f90 --enable-cxx --enable-mpe --enable-sharedlibs=osx-gcc --enable-fast<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build fftw ===<br />
<br />
Get [http://www.fftw.org/ fftw], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-shared --enable-sse2 --enable-static --enable-threads --with-combined-threads<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
If you want to build fftw with MPI, add ''--enable-mpi'' to the configure line after changing these environment variables:<br />
<br />
export FC="$HOME/bin/mpif90"<br />
<br /><br />
export CC="$HOME/bin/mpicc"<br />
<br />
Don't forget to change these variables back to their original values after compiling fftw.<br />
<br />
=== Build netcdf ===<br />
<br />
Get [http://www.unidata.ucar.edu/software/netcdf/ netcdf], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure CPPFLAGS='-DpgiFortran' --disable-cxx --prefix=$HOME<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
You can ''make check'' just to confirm that everything went OK.<br />
<br />
=== Build etsf_io ===<br />
<br />
Get [http://www.etsf.eu/resources/software/libraries_and_tools etsf_io], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --with-netcdf-module-path=$HOME/include --with-netcdf-ldflags="-L$HOME/lib -lnetcdf" --with-moduledir=$HOME/include<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build blas and lapack ===<br />
<br />
Now you need to install BLAS and LAPACK. The easiest solution is to get the ''original'' sources and just compile them. You will not have the fastest BLAS implementation, but it will work! Another option is to install ATLAS using macports. Note that macports currently compiles ATLAS with gcc/gfortran 4.3, and we have been assuming that everything is compiled with gcc/gfortran 4.4. There should be no problems with this, but to be on the safe side, just do ''port edit atlas'' and replace all references to the 4.3 version in the Portfile by references to the 4.4 version. Then compile as usual: ''port install atlas''.<br />
<br />
=== Build SPARSKIT ===<br />
<br />
Get [http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html SPARSKIT2], untar it and ''cd'' to the directory where you untared it. Then edit ''makefile'' and set ''F77=gfortran-mp-4.4 -m64''. Save the makefile and type ''make''. When compilation finishes just copy ''libskit.a'' to $HOME/lib.<br />
<br />
== Build serial version of octopus ==</div>Fnoghttps://octopus-code.org/mediawiki/index.php?title=Compiling_octopus_in_OS_X&diff=5716Compiling octopus in OS X2010-02-03T10:03:43Z<p>Fnog: /* Installing the required libraries */</p>
<hr />
<div>== Installing the GNU compilers and tools ==<br />
<br />
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either [http://www.macports.org/ macports] or [http://www.finkproject.org/ fink]. These instructions always assume that you are using macports. <br />
<br />
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at [http://developer.apple.com/tools/ Apple's Developer Connection].<br />
<br />
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.<br />
<br />
The packages you should now install are gcc44, automake, autoconf, and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf '''before''' you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it (you'll have to be root or use sudo to do this). To install the packages you just need to do ''port selfupdate'' to get the most recent package database and then ''port install gcc44 automake autoconf gsl''. Again, you'll have to login as root or use sudo to install packages. Leave your computer running and go for a looong coffee.<br />
<br />
== Installing the required libraries ==<br />
<br />
Now you have to install the other libraries octopus requires: blas, lapack, sparskit, fftw, netcdf, etsf_io, and mpich2. '''Don't''' do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran (with the possible exception of blas/lapack - see below). And you will not be able to link octopus with them...<br />
<br />
To be sure you are really compiling with gfortran in 64 bits, it is recommended to set these environment variables before building the libraries:<br />
<br />
export FC="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F77="gfortran-mp-4.4 -m64"<br />
<br /><br />
export F90="gfortran-mp-4.4 -m64"<br />
<br /><br />
export CC="gcc-mp-4.4 -m64"<br />
<br /><br />
export CXX="g++-mp-4.4 -m64"<br />
<br /><br />
export CPP="cpp-mp-4.4 -m64 -C -ansi"<br />
<br /><br />
export FCCPP="cpp-mp-4.4 -m64 -C -ansi"<br />
<br /><br />
export FCFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export FFLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br /><br />
export F90FLAGS="-O3 -I$HOME/include -L$HOME/lib"<br />
<br />
All these variables might be overkill, as most of the libraries read only one or two of them, but it's better to be safe than sorry ;-) Now, in order to build the libraries you just need to follow the standard ''configure'', ''make'', ''make install'' sequence:<br />
<br />
=== Build mpich2 (optional) ===<br />
<br />
Get [http://www.mcs.anl.gov/research/projects/mpich2/ mpich2], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-smpcoll --enable-f77 --enable-f90 --enable-cxx --enable-mpe --enable-sharedlibs=osx-gcc --enable-fast<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build fftw ===<br />
<br />
Get [http://www.fftw.org/ fftw], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --enable-shared --enable-sse2 --enable-static --enable-threads --with-combined-threads<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
If you want to build fftw with MPI, add ''--enable-mpi'' to the configure line after changing these environment variables:<br />
<br />
export FC="$HOME/bin/mpif90"<br />
<br /><br />
export CC="$HOME/bin/mpicc"<br />
<br />
Don't forget to change these variables back to their original values after compiling fftw.<br />
<br />
=== Build netcdf ===<br />
<br />
Get [http://www.unidata.ucar.edu/software/netcdf/ netcdf], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure CPPFLAGS='-DpgiFortran' --disable-cxx --prefix=$HOME<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
You can ''make check'' just to confirm that everything went OK.<br />
<br />
=== Build etsf_io ===<br />
<br />
Get [http://www.etsf.eu/resources/software/libraries_and_tools etsf_io], untar it and ''cd'' to the directory where you untared it. Then type:<br />
<br />
./configure --prefix=$HOME --with-netcdf-module-path=$HOME/include --with-netcdf-ldflags="-L$HOME/lib -lnetcdf" --with-moduledir=$HOME/include<br />
<br /><br />
make<br />
<br /><br />
make install<br />
<br />
=== Build blas and lapack ===<br />
<br />
Now you need to install BLAS and LAPACK. The easiest solution is to get the ''original'' sources and just compile them. You will not have the fastest BLAS implementation, but it will work! Another option is to install ATLAS using macports. Note that macports currently compiles ATLAS with gcc/gfortran 4.3, and we have been assuming that everything is compiled with gcc/gfortran 4.4. There should be no problems with this, but to be on the safe side, just do ''port edit atlas'' and replace all references to the 4.3 version in the Portfile by references to the 4.4 version. Then compile as usual: ''port install atlas''.<br />
<br />
=== Build SPARSKIT ===<br />
<br />
Get [http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html SPARSKIT2], untar it and ''cd'' to the directory where you untared it. Then edit ''makefile'' and set ''F77=gfortran-mp-4.4 -m64''. Save the makefile and type ''make''. When compilation finishes just copy ''libskit.a'' to $HOME/lib.<br />
<br />
== Build serial version of octopus ==</div>Fnog