# Tutorial:Vibrational modes

This tutorial will show you how to obtain vibrational modes in Octopus by using Sternheimer linear response. We will use the water molecule as example. To start we will need the geometry. Copy the following in a file called h2o.xyz:

```3
Water molecule in Angstroms
O  0.000 0.000 0.0
H  0.757 0.586 0.0
H -0.757 0.586 0.0
```

Since to obtain proper vibrational modes we need to be as close as possible to the minimum of energy, first we will optimize the geometry under the parameters we have defined for the simulation. For that we use the following input file:

````CalculationMode` = go

`UnitsOutput` =  eV_Angstrom
`XYZCoordinates` = "h2o.xyz"

`Spacing` = 0.16*angstrom
`Radius` = 4.5*angstrom
`BoxShape` = minimum

`FilterPotentials` = filter_ts

`GOMethod` = fire

`ExperimentalFeatures` = yes
```

As you see we will use a smaller than usual spacing and a larger spherical box. This is required since forces require more precision than other quantities. Of course for production runs these values should be properly converged. Also to increase the precision of the forces and the total energy we will use the variable `FilterPotentials`, which specifies that a filter should be applied to the ionic potentials that removes the Fourier components that are higher than what we can represent on our grid.

Now run Octopus, once the calculation is finished you should get the optimized geometry in min.xyz. Modify the value of `XYZCoordinates` to point to this file.

To perform a calculation of the vibrational modes we need a ground-state calculation with a very well converged forces. So change the `CalculationMode` to `gs` and run Octopus again, by adding `ConvForce` = 1.e-7 ( the criterion to stop the self-consistency process will be given by the change in the force). Once done, check that the forces in the static/info file are reasonably small (<0.05 eV/A).

Now we are ready for the actual calculation of vibrational modes. To do it, change `CalculationMode` to `vib_modes` and run Octopus. This calculation will take a while, since response calculations are required.

Finally, the results will be written into the `vib_modes` folder.

- Check the normal_frequencies_lr file.

```    1    3714.66865804
2    3612.19180564
3    1541.89763162
4     282.95538165
5     189.98486286
6     155.62791393
7    -197.74013582
8    -246.65205687
9    -258.63857751
```

What kind of information does it give? Did we find the correct equilibrium geometry?

Try now to visualize the vibrational eigenmodes. You can use XCrySDen to open the file normal_modes_lr.axsf. In the "Display" menu set "Forces", and in "Modify" set the factor to 1. Try to classify the modes as translations, rotations, and true internal vibrations. Which ones have the "negative" (actually imaginary) frequencies?

Back to Tutorials