Manual:Examples:Hello world

From OctopusWiki

Jump to: navigation, search

As a first example, we will take a sodium atom. With your favourite text editor, create the file inp.

      CalculationMode = gs
      %Coordinates
        'Na' | 0.0 | 0.0 | 0.0 
      %

This input file should be essentially self-explanatory.

Note that when a specie is not especified in the Species block, octopus reads the information of pseudopotentials from the defaults file (located under PREFIX/share/octopus/PP/. This file also contains default values for Mesh and Spacing.

Then run octopus – for example, do

 $ octopus > out

so that the output is stored in out file. If everything goes OK, out should look like:

    <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
                                ___
                             .-'   `'.
                            /         \
                            |         ;
                            |         |           ___.--,
                   _.._     |0) ~ (0) |    _.---'`__.-( (_.
            __.--'`_.. '.__.\    '--. \_.-' ,.--'`     `""`
           ( ,.--'`   ',__ /./;   ;, '.__.'`    __
           _`) )  .---.__.' / |   |\   \__..--""  """--.,_
          `---' .'.''-._.-'`_./  /\ '.  \ _.-~~~````~~~-._`-.__.'
                | |  .' _.-' |  |  \  \  '.               `~---`
                 \ \/ .'     \  \   '. '-._)
                  \/ /        \  \    `=.__`~-.
             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 2.1pre1
              build time - Wed Jun 28 18:15:19 CEST 2006
             svn revision: 2252 [td_write.F90 2006-06-28]

                           Compiler: ifort
Compiler flags: -u -zero -fpp1 -nbs -pc80 -pad -align -unroll -O3 -ip -tpp7 -xN

              The octopus is swimming in ddraig (Linux)


            Calculation started on 2006/06/29 at 14:21:08


************************** Calculation Mode **************************
Input: [CalculationMode = gs]
**********************************************************************


****************************** Species *******************************
Reading pseudopotential from file:
      '/home/xavier/share/octopus/PP/TM2/Na.ascii'
      Calculating atomic pseudo-eigenfunctions for specie Na....
      Done.
Info: l =  0 component used as local potential
**********************************************************************

Info: Using default spacing(1) [b] =  0.567
Info: Using default spacing(2) [b] =  0.567
Info: Using default spacing(3) [b] =  0.567
Input: [SpinComponents = unpolarized]
Input: [CurvMethod = curv_uniform]
Input: [DerivativesSpace = real_space]
Input: [DerivativesStencil = stencil_star]

************************** Parallelization ***************************
Octopus will run in *serial*
**********************************************************************


******************************** Grid ********************************
Simulation Box:
  Type = around nuclei
  Radius  [b] =  -1.000
The octopus will run in 3 dimension(s).
The octopus will treat the system as periodic in 0 dimension(s).
Main mesh:
  Spacing [b] = ( 0.567, 0.567, 0.567)    volume/point [b^3] =  0.18221
  # inner mesh =    52971
  # total mesh =   103523
  Grid Cutoff [H] =    15.354
**********************************************************************


****************************** Hartree *******************************
Input: [PoissonSolver = fft]
Info: FFT allocated with size (    105,    105,    105) in slot  1
Info: Poisson Cutoff Radius [b] =    29.763198
**********************************************************************


************************ Exchange-Correlation ************************
Exchange and correlation:
  Exchange
    Slater exchange (LDA)
  Correlation
    Perdew & Zunger (LDA)
    [1] Perdew and Zunger, Phys. Rev. B 23, 5048 (1981)

Input: [SICCorrection = sic_none]
**********************************************************************

Input: [RelativisticCorrection = non_relativistic]
Input: [TDGauge = length]
Input: [AbsorbingBoundaries = no_absorbing]
Input: [RestartFileFormat = restart_plain]

******************** Loading restart information *********************

** Warning:
**   Could not load wave-functions from 'tmp/restart_gs'
**   Starting from scratch!

Info: Unnormalized total charge =      0.999665
Info: Renormalized total charge =      1.000000
Info: Setting up Hamiltonian.
Input: [LCAOStart = lcao_full]
Info: Performing initial LCAO calculation with    2 orbitals.
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation
   1   --    -0.103077       1.000000
Info: SCF using real wavefunctions.
Input: [What2Mix = density] (what to mix during SCF cycles)
Input: [TypeOfMixing = broyden]
Input: [EigenSolver = cg]

*********************** SCF CYCLE ITER #    1 ************************
 etot = -1.84248567E-01 abs_ev   =  3.88E-04 rel_ev   =  3.75E-03
                        abs_dens =  1.17E-04 rel_dens =  1.17E-04
Matrix vector products:     27
Converged eigenvectors:      0
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.103465       1.000000      (8.2E-04)
**********************************************************************


*********************** SCF CYCLE ITER #    2 ************************
 etot = -1.84249567E-01 abs_ev   =  7.64E-05 rel_ev   =  7.39E-04
                        abs_dens =  1.40E-04 rel_dens =  1.40E-04
Matrix vector products:     27
Converged eigenvectors:      0
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.103389       1.000000      (5.8E-05)
**********************************************************************


*********************** SCF CYCLE ITER #    3 ************************
 etot = -1.84248966E-01 abs_ev   =  1.15E-04 rel_ev   =  1.12E-03
                        abs_dens =  2.06E-04 rel_dens =  2.06E-04
Matrix vector products:     23
Converged eigenvectors:      1
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.103504       1.000000      (9.9E-07)
**********************************************************************


*********************** SCF CYCLE ITER #    4 ************************
 etot = -1.84250323E-01 abs_ev   =  3.85E-04 rel_ev   =  3.73E-03
                        abs_dens =  1.53E-05 rel_dens =  1.53E-05
Matrix vector products:     27
Converged eigenvectors:      0
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.103119       1.000000      (5.8E-06)
**********************************************************************


*********************** SCF CYCLE ITER #    5 ************************
 etot = -1.84250321E-01 abs_ev   =  4.65E-06 rel_ev   =  4.51E-05
                        abs_dens =  1.93E-05 rel_dens =  1.93E-05
Matrix vector products:     16
Converged eigenvectors:      1
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.103124       1.000000      (9.9E-07)
**********************************************************************


*********************** SCF CYCLE ITER #    6 ************************
 etot = -1.84250325E-01 abs_ev   =  9.85E-06 rel_ev   =  9.55E-05
                        abs_dens =  5.28E-07 rel_dens =  5.28E-07
Matrix vector products:     25
Converged eigenvectors:      1
Eigenvalues [H]
 #st  Spin   Eigenvalue     Occupation       Error
   1   --    -0.103134       1.000000      (7.5E-07)
**********************************************************************

Info: SCF converged in    6 iterations
Info: FFT deallocated from slot    1

             Calculation ended on 2006/06/29 at 14:21:22


Take now a look at the working directory. It should include the following files:

-rw-r--r-- 1 xavier xavier   84 2006-06-29 14:21 inp 
drwxr-xr-x 2 xavier xavier 4096 2006-06-29 14:21 static
drwxr-xr-x 2 xavier xavier 4096 2006-06-29 14:21 status
drwxr-xr-x 3 xavier xavier 4096 2006-06-29 14:21 tmp


Besides the initial file (inp) and the out file, three new directories appear. In static/, you will find the file info, with information about the static calculation (it should be hopefully self-explanatory, otherwise please complain to the authors). In tmp/, you will find the restart_gs directory that contains restart information about the ground-state, which is used if, for example, you want to start a time-dependent calculation afterwards. Finally, the status/ directory has information about the run of octopus, inside the out.oct contains all the input variables parsed by octopus.

Exercises

  • Study how the total energy and eigenvalue of the sodium atom improve with the mesh spacing.
  • Calculate the static polarizability of the sodium atom (CalculationMode = pol). A linear/polarizability will be created, this files contains the static polarizability tensor.
  • Calculate a few unoccupied states (CalculationMode = unocc). The eigenspectrum will be in the file static/eigenvalues. Why don't we find a Rydberg series in the eigenspectrum?
  • Repeat the previous calculation with different exchange and correlation functionals like PBE, LB94, and exact exchange.
  • Perform a time-dependent evolution (CalculationMode = td), to calculate the optical spectrum of the Na atom. Use a TDDeltaStrength = 0.05, polarised in the x direction. The multipole moments of the density are output to the file td.general/multipoles. You can process this file with the utility oct-cross-section to obtain the optical spectrum. If you have computer time to waste, re-run the time-dependent simulation for some other xc choices.

Previous Manual:External utilities:oct-make-st - Next Manual:Examples:Benzene

Back to Manual

Personal tools