## Mesh

DoubleGrid
Section: Mesh
Type: logical
Default: no

Enables or disables the use of a double-grid technique to increase the precision of the application of the pseudopotentials. This is experimental, especially in parallel.

DoubleGridOrder
Section: Mesh
Type: integer
Default: 9

Order of the interpolation used for the double grid. Must be an odd number. Low-order interpolation schemes are not recommended.

MultiResolutionArea
Section: Mesh
Type: block

(Experimental) Multiresolution regions are set with this parameter. The first three numbers define the central point of the region, and the following ones set the radii where resolution changes (measured from the central point). NOTE: currently, only one area can be set up, and only works in 3D, and in serial.

MultiResolutionInterpolationOrder
Section: Mesh
Type: integer
Default: 5

The interpolation order in the multiresolution approach (with MultiResolutionArea).

MultigridLevels
Section: Mesh
Type: integer
Default: max_levels

Number of levels in the grid hierarchy used for multigrid. Positive numbers indicate an absolute number of levels, negative numbers are subtracted from the maximum number of levels possible.
Options:

• max_levels: Calculate the optimal number of levels for the grid.

Section: Mesh
Type: block

(Experimental) Defines a mask for which periodic boundaries are replaced by zero boundary conditions.

Spacing
Section: Mesh
Type: float

The spacing between the points in the mesh. This controls the quality of the discretization: smaller spacing gives more precise results but increased computational cost.

When using curvilinear coordinates, this is a canonical spacing that will be changed locally by the transformation. In periodic directions, your spacing may be slightly different than what you request here, since the box size must be an integer multiple of the spacing.

The default value is defined by the species if only default pseudopotentials are used or by the image resolution if BoxShape = box_image. Otherwise, there is no default.

It is possible to have a different spacing in each one of the Cartesian directions if we define Spacing as block of the form

%Spacing
spacing_x | spacing_y | spacing_z
%

SpiralBoundaryCondition
Section: Mesh
Type: logical
Default: no

(Experimental) If set to yes, Octopus will apply spin-spiral boundary conditions. The momentum of the spin spiral is defined by the variable TDMomentumTransfer

UseFineMesh
Section: Mesh
Type: logical
Default: no

If enabled, Octopus will use a finer mesh for the calculation of the forces or other sensitive quantities. Experimental, and incompatible with domain-parallelization.

## Mesh::Curvilinear

CurvMethod
Section: Mesh::Curvilinear
Type: integer
Default: curv_uniform

The relevant functions in octopus are represented on a mesh in real space. This mesh may be an evenly spaced regular rectangular grid (standard mode), or else an adaptive or curvilinear grid. We have implemented three kinds of adaptive meshes, although only one is currently working, the one invented by F. Gygi (curv_gygi). The code will stop if any of the other two is invoked. All are experimental with domain parallelization.
Options:

• curv_uniform: Regular, uniform rectangular grid.
• curv_gygi: The deformation of the grid is done according to the scheme described by F. Gygi [F. Gygi and G. Galli, Phys. Rev. B 52, R2229 (1995)].
• curv_briggs: The deformation of the grid is done according to the scheme described by Briggs [E.L. Briggs, D.J. Sullivan, and J. Bernholc, Phys. Rev. B 54 14362 (1996)] (NOT WORKING).
• curv_modine: The deformation of the grid is done according to the scheme described by Modine [N.A. Modine, G. Zumbach and E. Kaxiras, Phys. Rev. B 55, 10289 (1997)] (NOT WORKING).

## Mesh::Curvilinear::Gygi

CurvGygiA
Section: Mesh::Curvilinear::Gygi
Type: float
Default: 0.5

The grid spacing is reduced locally around each atom, and the reduction is given by 1/(1+A), where A is specified by this variable. So, if A=1/2 (the default), the grid spacing is reduced to two thirds = 1/(1+1/2). [This is the $$A_{\alpha}$$ variable in Eq. 2 of F. Gygi and G. Galli, Phys. Rev. B 52, R2229 (1995)]. It must be larger than zero.

CurvGygiAlpha
Section: Mesh::Curvilinear::Gygi
Type: float
Default: 2.0 a.u.

This number determines the region over which the grid is enhanced (range of enhancement of the resolution). That is, the grid is enhanced on a sphere around each atom, whose radius is given by this variable. [This is the $$a_{\alpha}$$ variable in Eq. 2 of F. Gygi and G. Galli, Phys. Rev. B 52, R2229 (1995)]. It must be larger than zero.

CurvGygiBeta
Section: Mesh::Curvilinear::Gygi
Type: float
Default: 4.0 a.u.

This number determines the distance over which Euclidean coordinates are recovered. [This is the $$b_{\alpha}$$ variable in Eq. 2 of F. Gygi and G. Galli, Phys. Rev. B 52, R2229 (1995)]. It must be larger than zero.

## Mesh::Curvilinear::Modine

CurvModineJBar
Section: Mesh::Curvilinear::Modine
Type: float
Default: 1/2

Increase in density of points is inverse of this parameter. See N. A. Modine, G. Zumbach, and E. Kaxiras, Phys. Rev. B 55, 10289-10301 (1997).

CurvModineJlocal
Section: Mesh::Curvilinear::Modine
Type: float
Default: 0.25

Local refinement around the atoms. Must be between 0 and 1. See N. A. Modine, G. Zumbach, and E. Kaxiras, Phys. Rev. B 55, 10289-10301 (1997).

CurvModineJrange
Section: Mesh::Curvilinear::Modine
Type: float
Default: 2 b

Local refinement range (a length). See N. A. Modine, G. Zumbach, and E. Kaxiras, Phys. Rev. B 55, 10289-10301 (1997).

CurvModineXBar
Section: Mesh::Curvilinear::Modine
Type: float
Default: 1/3

Size of central flat region (in units of Lsize). Must be between 0 and 1. See N. A. Modine, G. Zumbach, and E. Kaxiras, Phys. Rev. B 55, 10289-10301 (1997).

## Mesh::Derivatives

DerivativesOrder
Section: Mesh::Derivatives
Type: integer
Default: 4

This variable gives the discretization order for the approximation of the differential operators. This means, basically, that DerivativesOrder points are used in each positive/negative spatial direction, e.g. DerivativesOrder = 1 would give the well-known three-point formula in 1D. The number of points actually used for the Laplacian depends on the stencil used. Let $$O$$ = DerivativesOrder, and $$d$$ = Dimensions.

• stencil_star: $$2 O d + 1$$
• stencil_cube: $$(2 O + 1)^d$$
• stencil_starplus: $$2 O d + 1 + n$$ with n being 8 in 2D and 24 in 3D.

DerivativesStencil
Section: Mesh::Derivatives
Type: integer
Default: stencil_star

Decides what kind of stencil is used, i.e. which points, around each point in the mesh, are the neighboring points used in the expression of the differential operator.

If curvilinear coordinates are to be used, then only the stencil_starplus or the stencil_cube may be used. We only recommend the stencil_starplus, since the cube typically needs far too much memory.
Options:

• stencil_star: A star around each point (i.e., only points on the axis).
• stencil_variational: Same as the star, but with coefficients built in a different way.
• stencil_cube: A cube of points around each point.
• stencil_starplus: The star, plus a number of off-axis points.
• stencil_stargeneral: The general star. Default for non-orthogonal grids.

MultigridDerivativesOrder
Section: Mesh::Derivatives
Type: integer
Default: 1

This variable gives the discretization order for the approximation of the differential operators on the different levels of the multigrid. For more details, see the variable DerivativesOrder.

## Mesh::FFTs

DoubleFFTParameter
Section: Mesh::FFTs
Type: float
Default: 2.0

For solving the Poisson equation in Fourier space, and for applying the local potential in Fourier space, an auxiliary cubic mesh is built. This mesh will be larger than the circumscribed cube of the usual mesh by a factor DoubleFFTParameter. See the section that refers to Poisson equation, and to the local potential for details [the default value of two is typically good].

FFTLibrary
Section: Mesh::FFTs
Type: integer
Default: fftw

(experimental) You can select the FFT library to use.
Options:

• fftw: Uses FFTW3 library.
• pfft: (experimental) Uses PFFT library, which has to be linked.
• accel: (experimental) Uses a GPU accelerated library. This only works if Octopus was compiled with Cuda or OpenCL support.

FFTOptimize
Section: Mesh::FFTs
Type: logical
Default: yes

Should octopus optimize the FFT dimensions? This means that the mesh to which FFTs are applied is not taken to be as small as possible: some points may be added to each direction in order to get a "good number" for the performance of the FFT algorithm. The best FFT grid dimensions are given by $$2^a 3^b 5^c 7^d 11^e 13^f$$ where $$a,b,c,d$$ are arbitrary and $$e,f$$ are 0 or 1. (ref). In some cases, namely when using the split-operator, or Suzuki-Trotter propagators, this option should be turned off. For spatial FFTs in periodic directions, the grid is never optimized, but a warning will be written if the number is not good, with a suggestion of a better one to use, so you can try a different spacing if you want to get a good number.

FFTPreparePlan
Section: Mesh::FFTs
Type: integer
Default: fftw_measure

The FFTs are performed in octopus with the help of FFTW and similar packages. Before doing the actual computations, this package prepares a "plan", which means that the precise numerical strategy to be followed to compute the FFT is machine/compiler-dependent, and therefore the software attempts to figure out which is this precise strategy (see the FFTW documentation for details). This plan preparation, which has to be done for each particular FFT shape, can be done exhaustively and carefully (slow), or merely estimated. Since this is a rather critical numerical step, by default it is done carefully, which implies a longer initial initialization, but faster subsequent computations. You can change this behaviour by changing this FFTPreparePlan variable, and in this way you can force FFTW to do a fast guess or estimation of which is the best way to perform the FFT.
Options:

• fftw_measure: This is the default, and implies a longer initialization, but involves a more careful analysis of the strategy to follow, and therefore more efficient FFTs.
• fftw_patient: It is like fftw_measure, but considers a wider range of algorithms and often produces a "more optimal" plan (especially for large transforms), but at the expense of several times longer planning time (especially for large transforms).
• fftw_estimate: This is the "fast initialization" scheme, in which the plan is merely guessed from "reasonable" assumptions.
• fftw_exhaustive: It is like fftw_patient, but considers an even wider range of algorithms, including many that we think are unlikely to be fast, to produce the most optimal plan but with a substantially increased planning time.

NFFTCutoff
Section: Mesh::FFTs
Type: integer
Default: 6

Cut-off parameter of the window function. See NFFT manual for details.

NFFTGuruInterface
Section: Mesh::FFTs
Type: logical
Default: false

Perform NFFT with guru interface. This permits the fine tuning of several critical parameters.

NFFTOversampling
Section: Mesh::FFTs
Type: float
Default: 2

NFFT oversampling factor (sigma). This will rule the size of the FFT under the hood.

NFFTPrecompute
Section: Mesh::FFTs
Type: integer
Default: NFFT_PRE_PSI

NFFT precomputation strategy.
Options:

• NFFT_PRE_PSI: This method uses a medium amount of memory to store d*(2*m+1)*M real numbers and requires at most 2(2m + 1)d extra multiplications for each node. This is the default option.
• NFFT_PRE_FULL_PSI: Is the fastest method but requires a large amount of memory as it requires to store (2*m+1)^d*M real numbers. No extra operations are needed during matrix vector multiplication.
• NFFT_PRE_LIN_PSI: This method implements a linear interpolation from a lookup table.

PNFFTCutoff
Section: Mesh::FFTs
Type: integer
Default: 6

Cut-off parameter of the window function.

PNFFTOversampling
Section: Mesh::FFTs
Type: float
Default: 2.0

PNFFT oversampling factor (sigma). This will rule the size of the FFT under the hood.

## Mesh::KPoints

KPoints
Section: Mesh::KPoints
Type: block

This block defines an explicit set of k-points and their weights for a periodic-system calculation. The first column is the weight of each k-point and the following are the components of the k-point vector. You only need to specify the components for the periodic directions. Note that the k-points should be given in Cartesian coordinates (not in reduced coordinates), in the units of inverse length. The weights will be renormalized so they sum to 1 (and must be rational numbers).

For example, if you want to include only the Gamma point, you can use:

%KPoints
1.0 | 0 | 0 | 0
%

KPointsGrid
Section: Mesh::KPoints
Type: block
Default: $$\Gamma$$-point only

When this block is given (and the KPoints block is not present), k-points are distributed in a uniform grid, according to a modified version of the Monkhorst-Pack scheme. For the original MP scheme, see James D. Pack and Hendrik J. Monkhorst, Phys. Rev. B 13, 5188 (1976) and Phys. Rev. B 16, 1748 (1977).

The first row of the block is a set of integers defining the number of k-points to be used along each direction in reciprocal space. The numbers refer to the whole Brillouin zone, and the actual number of k-points is usually reduced exploiting the symmetries of the system. By default the grid will always include the $$\Gamma$$-point. Optional rows can be added to specify multiple shifts in the k-points (between 0.0 and 1.0), in units of the Brillouin zone divided by the number in the first row. The number of columns should be equal to Dimensions, but the grid and shift numbers should be 1 and zero in finite directions.

For example, the following input samples the BZ with 100 points in the xy-plane of reciprocal space:

%KPointsGrid
10 | 10 | 1
%

KPointsPath
Section: Mesh::KPoints
Type: block

When this block is given, k-points are generated along a path defined by the points of the list. The points must be given in reduced coordinates.

The first row of the block is a set of integers defining the number of k-points for each segments of the path. The number of columns should be equal to Dimensions, and the k-points coordinate should be zero in finite directions.

For example, the following input samples the BZ with 15 points:

%KPointsPath
10 | 5
0 | 0 | 0
0.5 | 0 | 0
0.5 | 0.5 | 0.5
%

KPointsReduced
Section: Mesh::KPoints
Type: block

Same as the block KPoints but this time the input is given in reduced coordinates, i.e. what Octopus writes in a line in the ground-state standard output as

#k = 1, k = ( 0.154000, 0.154000, 0.154000).

KPointsUseSymmetries
Section: Mesh::KPoints
Type: logical
Default: no

This variable defines whether symmetries are taken into account or not for the choice of k-points. If it is set to no, the k-point sampling will range over the full Brillouin zone.

When a perturbation is applied to the system, the full symmetries of the system cannot be used. In this case you must not use symmetries or use the SymmetryBreakDir to tell Octopus the direction of the perturbation (for the moment this has to be done by hand by the user, in the future it will be automatic).

KPointsUseTimeReversal
Section: Mesh::KPoints
Type: logical

If symmetries are used to reduce the number of k-points, this variable defines whether time-reversal symmetry is taken into account or not. If it is set to no, the k-point sampling will not be reduced according to time-reversal symmetry.

The default is yes, unless symmetries are broken in one direction by the SymmetryBreakDir block.

Warning: For time propagation runs with an external field, time-reversal symmetry should not be used.

QPointsGrid
Section: Mesh::KPoints
Type: block
Default: KPointsGrid

This block allows to define a q-point grid used for the calculation of the Fock operator with k-points. The q-points are distributed in a uniform grid, as done for the KPointsGrid variable. See J. Chem Phys. 124, 154709 (2006) for details

For each dimension, the number of q point must be a divider of the number of k point

%QPointsGrid
2 | 2 | 1
%

## Mesh::Simulation Box

BoxShape
Section: Mesh::Simulation Box
Type: integer

This variable decides the shape of the simulation box. The default is minimum for finite systems and parallelepiped for periodic systems. Note that some incompatibilities apply:

• Spherical or minimum mesh is not allowed for periodic systems.
• Cylindrical mesh is not allowed for systems that are periodic in more than one dimension.
• box_image is only allowed in 2D.

Options:
• sphere: The simulation box will be a sphere of radius Radius. (In 2D, this is a circle.)
• cylinder: The simulation box will be a cylinder with radius Radius and height (in the x-direction) of 2 Xlength.
• minimum: The simulation box will be constructed by adding spheres created around each atom (or user-defined potential), of radius Radius.
• parallelepiped: The simulation box will be a parallelepiped whose dimensions are taken from the variable Lsize.
• box_image: The simulation box will be defined through an image, specified with BoxShapeImage. White (RGB = 255,255,255) means that the point is contained in the simulation box, while any other color means that the point is out. The image will be scaled to fit Lsize, while its resolution will define the default Spacing. The actual box may be slightly larger than Lsize to ensure one grid point = one pixel for default Spacing.
• hypercube: (experimental) The simulation box will be a hypercube or hyperparallelepiped. This is equivalent to the parallelepiped box but it can work with an arbitrary number of dimensions.
• user_defined: The shape of the simulation box will be read from the variable BoxShapeUsDef.

BoxShapeImage
Section: Mesh::Simulation Box
Type: string

Name of the file that contains the image that defines the simulation box when BoxShape = box_image. No default. Will search in current directory and OCTOPUS-HOME/share/.

BoxShapeUsDef
Section: Mesh::Simulation Box
Type: string

Boolean expression that defines the interior of the simulation box. For example, BoxShapeUsDef = "(sqrt(x^2+y^2) <= 4) && z>-2 && z<2" defines a cylinder with axis parallel to the z-axis.

LatticeParameters
Section: Mesh::Simulation Box
Type: block
Default: 1 | 1 | 1

The lattice parameters (a, b, c). This option is incompatible with Lsize and either one of the two must be specified in the input file for periodic systems. A second optional line can be used tu define the angles between the lattice vectors

LatticeVectors
Section: Mesh::Simulation Box
Type: block
Default: simple cubic

Primitive lattice vectors. Vectors are stored in rows. Default:

%LatticeVectors
1.0 | 0.0 | 0.0
0.0 | 1.0 | 0.0
0.0 | 0.0 | 1.0
%

Lsize
Section: Mesh::Simulation Box
Type: block

If BoxShape is parallelepiped, hypercube, box_image, or user_defined, this is a block of the form:

%Lsize
sizex | sizey | sizez | ...
%

where the size* are half the lengths of the box in each direction.

The number of columns must match the dimensionality of the calculation. If you want a cube you can also set Lsize as a single variable.

Section: Mesh::Simulation Box
Type: float

Defines the radius for BoxShape = sphere, cylinder, or minimum. Must be a positive number. If not specified, the code will look for values in the Species block, or, from the default pseudopotential parameters. In these cases, for minimum, a different radius is used for each species, while for other shapes, the maximum radius is used.

SymmetryBreakDir
Section: Mesh::Simulation Box
Type: block

This variable specifies a direction in which the symmetry of the system will be broken. This is useful for generating k-point grids when an external perturbation is applied.

Xlength
Section: Mesh::Simulation Box
Type: float