Tutorial:Hydrogen atom

From OctopusWiki

Jump to: navigation, search

The objective of this tutorial is to give a basic idea of how octopus works.

Contents

Generating the input file

With a text editor create a text file called inp containing the following text:

CalculationMode = gs

%Coordinates
 'H' | 0 | 0 | 0
%

This the simplest example of an Octopus input file:

  • The first line gives the value gs to the variable CalculationMode, this tells Octopus that we want to perform a ground state calculation.
  • The next lines define the Coordinates block, in this case we put a single Hydrogen atom in the center of our simulation box.

The reason for this input file to be so simple is that Octopus comes with default values for the simulation parameters and a set of default pseudopotential for several elements.

Running Octopus

Once you have written your input file, run the octopus command. If everything goes correctly you should several lines of output in the terminal, as this is probably the first time you run Octopus we will examin the most important parts of the output:

  • First there is an octopus drawn in ascii art, the copyright notice and some information about the octopus version you are using and the system where you are running:
   <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>              
                               ___                                             
                            .-'   `'.                                          
                           /         \                                         
                           |         ;                                         
                           |         |           ___.--,                       
                  _.._     |0) ~ (0) |    _.---'`__.-( (_.                     
           __.--'`_.. '.__.\    '--. \_.-' ,.--'`     `""`                     
          ( ,.--'`   ',__ /./;   ;, '.__.'`    __                              
          _`) )  .---.__.' / |   |\   \__..--""  """--.,_                      
         `---' .'.-._.-'`_./  /\ '.  \ _.-Xavier````Xavier-._`-.__.'               
               | |  .' _.-' |  |  \  \  '.               `~---`                
                \ \/ .'     \  \   '. '-._)                                    
                 \/ /        \  \    `=.__`~-.                                 
            jgs  / /\         `) )    / / `"".`\                               
           , _.-'.'\ \        / /    ( (     / /                               
            `--~`   ) )    .-'.'      '.'.  | (                                
                   (/`    ( (`          ) )  '-;                               
                    `      '-;         (-'                                     
                                                                               
   This program is free software; you can redistribute it and/or modify        
   it under the terms of the GNU General Public License as published by        
   the Free Software Foundation; either version 2, or (at your option)         
   any later version.                                                          
                                                                               
   This program is distributed in the hope that it will be useful,             
   but WITHOUT ANY WARRANTY; without even the implied warranty of              
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               
   GNU General Public License for more details.                                
                                                                               
   You should have received a copy of the GNU General Public License           
   along with this program; if not, write to the Free Software                 
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA                   
                                                                               
   <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>              

                   Running octopus, version 3.0.1
             build time - Sun Aug 24 22:26:37 CEST 2008
                           svn revision:

                         Compiler: openf95
                          Compiler flags:

           The octopus is swimming in licancabur (Linux)


           Calculation started on 2008/08/24 at 22:29:02

  • The type of calculation it was asked to perform:
************************** Calculation Mode **************************
Input: [CalculationMode = gs]
**********************************************************************
  • The species that it will use and what pseudopotential it is using:
****************************** Species *******************************
Reading pseudopotential from file:
      '/home/xavier/share/octopus/PP/PSF/H.psf'
      Calculating atomic pseudo-eigenfunctions for specie H ....
      Done.
Info: l =  0 component used as local potential
**********************************************************************
  • Information about the grid, as we didn't say anything in the input file Octopus used the parameters recommended for this pseupopotential:
******************************** Grid ********************************
Simulation Box:
  Type = around nuclei
  Radius  [b] =  -1.000
  Octopus will run in 3 dimension(s).
  Octopus will treat the system as periodic in 0 dimension(s).
Main mesh:
  Spacing [b] = ( 0.435, 0.435, 0.435)    volume/point [b^3] =  0.08211
  # inner mesh =    22119
  # total mesh =    52127
  Grid Cutoff [H] =    26.123
**********************************************************************
  • The level of theory that is used, and in the case of (TD)DFT the approximation to the exchange and correlation term.
**************************** Theory Level ****************************
Input: [TheoryLevel = dft]

Exchange and correlation:
  Exchange
    Slater exchange (LDA)
    [1] PAM Dirac, Proceedings of the Cambridge Philosophical Society 26, 376 (1930)
    [2] F Bloch, Zeitschrift fuer Physik 57, 545 (1929)
  Correlation
    Perdew & Zunger (Modified) (LDA)
    [1] Perdew and Zunger, Phys. Rev. B 23, 5048 (1981)
    [2] Modified to improve the matching between the low and high rs parts

Input: [SICCorrection = sic_none]
**********************************************************************
  • Now Octopus comences the calculation, to get a reasonable starting point for the DFT calculation, the initial wavefunctions are calculated as a Linear Combination of Atomic Orbitals (LCAO).
Info: Performing initial LCAO calculation with    1 orbitals.
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation
   1   --    -0.231981       1.000000
  • After the LCAO, the real DFT calculation starts, for each self-consistency step some information is printed. When this converges the calculation is done.
*********************** SCF CYCLE ITER #    1 ************************
 etot = -4.44578403E-01 abs_ev   =  6.30E-04 rel_ev   =  2.71E-03
                       abs_dens =  7.46E-04 rel_dens =  7.46E-04
Matrix vector products:     27
Converged eigenvectors:      0
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.232610       1.000000      (9.1E-05)

Elapsed time for SCF step:          0.10
**********************************************************************

...

********************** SCF CYCLE ITER #    4 ************************
 etot = -4.44579903E-01 abs_ev   =  1.00E-05 rel_ev   =  4.32E-05
                       abs_dens =  5.82E-06 rel_dens =  5.82E-06
Matrix vector products:     15
Converged eigenvectors:      1
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.231962       1.000000      (9.9E-07)

Elapsed time for SCF step:          0.15
**********************************************************************

Info: SCF converged in    4 iterations

Analyzing the results

The detailed results of the ground state calculation can be found in the static/info file, for example the energies and eigenvalues:

Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation
   1   --    -0.231962       1.000000

Energy:
      Total       =     -0.44457606
      Ion-ion     =      0.00000000
      Eigenvalues =     -0.23196234
      Hartree     =      0.28315896
      Int[n*v_xc] =     -0.30327009
      Exchange    =     -0.19303436
      Correlation =     -0.03969050
      Kinetic     =      0.41347550
      External    =     -0.90848938


Since by default Octopus does a spin unpolarized density functional theory calculation with the local density approximation, our results differs from the exact total energy of 0.5 [Ha].

Extra

If you want to improve the LDA, you can try to repeat the calculation with spin polarization:

SpinComponents = spin_polarized

And if you want to obtain the exact result you have to remove the self interaction error (a problem of the LDA). Since we only have one electron the simplest way to do it for this case is to use independent electrons:

TheoryLevel = independent_particles

. A more general way would be to include self interaction correction.

Personal tools