Introduction to Octopus:
a real-space (TD)DFT code
David A. Strubbe
and the Octopus development teamMIT IAP, Jan 2016

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

1 / 24

Introduction

Time-dependent Kohn-Sham equationi∂ϕn (r, t) = −∇2 ϕn + Veff [ρ] (r, t)ϕn (r, t)∂tX
ρ(r, t) =ϕ∗n (r, t)ϕn (r, t)nSolve the equations numerically.
Represent functions and other objects.
Calculate derivatives and integrals.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

2 / 24

Introduction

Time-dependent Kohn-Sham equationi∂ϕn (r, t) = −∇2 ϕn + Veff [ρ] (r, t)ϕn (r, t)∂tX
ρ(r, t) =ϕ∗n (r, t)ϕn (r, t)nSolve the equations numerically.
Represent functions and other objects.
Calculate derivatives and integrals.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

2 / 24

Introduction

Time-dependent Kohn-Sham equationi∂ϕn (r, t) = −∇2 ϕn + Veff [ρ] (r, t)ϕn (r, t)∂tX
ρ(r, t) =ϕ∗n (r, t)ϕn (r, t)nSolve the equations numerically.
Represent functions and other objects.
Calculate derivatives and integrals.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

2 / 24

Pseudo-potentials

The atomic potential is very strongand “hard” (small spacing or highplane-wave cutoff required).
Core electrons are almost independentof the environment.
Replace the potential and core electrons
by a pseudo-potential.

Norm-conserving pseudo-potentials in Kleinman-Bylander form
V = Vloc +X|lmi (Vl − Vloc ) hlm|lm

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

3 / 24

Pseudo-potentials

The atomic potential is very strongand “hard” (small spacing or highplane-wave cutoff required).
Core electrons are almost independentof the environment.
Replace the potential and core electrons
by a pseudo-potential.

Norm-conserving pseudo-potentials in Kleinman-Bylander form
V = Vloc +X|lmi (Vl − Vloc ) hlm|lm

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

3 / 24

Pseudo-potentials

The atomic potential is very strongand “hard” (small spacing or highplane-wave cutoff required).
Core electrons are almost independentof the environment.
Replace the potential and core electrons
by a pseudo-potential.

Norm-conserving pseudo-potentials in Kleinman-Bylander form
V = Vloc +X|lmi (Vl − Vloc ) hlm|lm

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

3 / 24

Pseudo-potentials

The atomic potential is very strongand “hard” (small spacing or highplane-wave cutoff required).
Core electrons are almost independentof the environment.
Replace the potential and core electrons
by a pseudo-potential.

Norm-conserving pseudo-potentials in Kleinman-Bylander form
V = Vloc +X|lmi (Vl − Vloc ) hlm|lm

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

3 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Real-space gridPartial differential equation with infinite degrees of freedom.
Reduce to a finite number.
Functions are represented by values on a set of points.
Point distribution:
Uniformly spaced grid.
Distance between points is constant: Spacing.
Non-uniform grids also possible.

Finite region of the space: Box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

4 / 24

Boundary conditions

For finite systems, functions go to zero.
Force functions to go to zero on the border of the box.
The box has to be large enough to contain the functions.
Other BCs are possible: periodic, zero derivative, open.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

5 / 24

Boundary conditions

For finite systems, functions go to zero.
Force functions to go to zero on the border of the box.
The box has to be large enough to contain the functions.
Other BCs are possible: periodic, zero derivative, open.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

5 / 24

Boundary conditions

For finite systems, functions go to zero.
Force functions to go to zero on the border of the box.
The box has to be large enough to contain the functions.
Other BCs are possible: periodic, zero derivative, open.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

5 / 24

Boundary conditions

For finite systems, functions go to zero.
Force functions to go to zero on the border of the box.
The box has to be large enough to contain the functions.
Other BCs are possible: periodic, zero derivative, open.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

5 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Boundary conditions

Optimize the shape of the box to minimize the number of points
needed.
Available box shapes:
Minimum box: union of spheres around each atom.
Sphere.
Cylinder.
Parallelepiped.
Arbitrary (e.g. 2D image!)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

6 / 24

Example: benzene molecule in minimal box

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

7 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Real-space grid characteristics
Natural boundary conditions for different problems:zero, one, two, or three periodic dimensions for molecules, wires,
sheets, and solids.
Representation used for calculating Vxc [ρ] even with other bases.
Can systematically improve discretization quality:
Decrease the spacing (like increasing plane-wave cutoff).
Increase the box size (in finite directions).

Orthogonal “basis set”.
Unbiased, independent of atomic positions (no Pulay forces).
Problems:
Breaking of translational invariance: egg-box effect.
Breaking of rotational invariance.
(Decreasing spacing helps both.)D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

8 / 24

Derivatives
Derivative at a point: sum over neighboring points.
The coefficients cij depend on the mesh and number of points
used: the stencil.
General form for Laplacian:
n X
n
X
cij
∇2 f (nx h, ny h) =f (nx h + ih, ny h + jh)hijCompare definition of derivative:f (x0 + h) − f (x0 )h→0∆xMore points → more precision.
Semi-local operation.
f 0 (x0 ) = lim

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

9 / 24

Derivatives
Derivative at a point: sum over neighboring points.
The coefficients cij depend on the mesh and number of points
used: the stencil.
General form for Laplacian:
n X
n
X
cij
∇2 f (nx h, ny h) =f (nx h + ih, ny h + jh)hijCompare definition of derivative:f (x0 + h) − f (x0 )h→0∆xMore points → more precision.
Semi-local operation.
f 0 (x0 ) = lim

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

9 / 24

Derivatives
Derivative at a point: sum over neighboring points.
The coefficients cij depend on the mesh and number of points
used: the stencil.
General form for Laplacian:
n X
n
X
cij
∇2 f (nx h, ny h) =f (nx h + ih, ny h + jh)hijCompare definition of derivative:f (x0 + h) − f (x0 )h→0∆xMore points → more precision.
Semi-local operation.
f 0 (x0 ) = lim

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

9 / 24

Derivatives
Derivative at a point: sum over neighboring points.
The coefficients cij depend on the mesh and number of points
used: the stencil.
General form for Laplacian:
n X
n
X
cij
∇2 f (nx h, ny h) =f (nx h + ih, ny h + jh)hijCompare definition of derivative:f (x0 + h) − f (x0 )h→0∆xMore points → more precision.
Semi-local operation.
f 0 (x0 ) = lim

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

9 / 24

Derivatives
Derivative at a point: sum over neighboring points.
The coefficients cij depend on the mesh and number of points
used: the stencil.
General form for Laplacian:
n X
n
X
cij
∇2 f (nx h, ny h) =f (nx h + ih, ny h + jh)hijCompare definition of derivative:f (x0 + h) − f (x0 )h→0∆xMore points → more precision.
Semi-local operation.
f 0 (x0 ) = lim

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

9 / 24

Derivatives
Derivative at a point: sum over neighboring points.
The coefficients cij depend on the mesh and number of points
used: the stencil.
General form for Laplacian:
n X
n
X
cij
∇2 f (nx h, ny h) =f (nx h + ih, ny h + jh)hijCompare definition of derivative:f (x0 + h) − f (x0 )h→0∆xMore points → more precision.
Semi-local operation.
f 0 (x0 ) = lim

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

9 / 24

Example of stencil for Laplacian
Symmetric third-order in 2D.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201610 / 24

Integration

Trapezoidal ruleZf (x, y) dx dy = h2

Xf (ih, jh)ijSum over grid points.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201611 / 24

Integration

Trapezoidal ruleZf (x, y) dx dy = h2

Xf (ih, jh)ijSum over grid points.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201611 / 24

Ground-state calculations

What we want to solve:

Kohn-Sham equations−∇2 ϕn + Veff [ρ] (r)ϕn = n ϕn
We use a self-consistency scheme to treat non-linearity.
Solve for eigenstates at fixed Veff , then update ρ and Veff .

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201612 / 24

Ground-state calculations

What we want to solve:

Kohn-Sham equations−∇2 ϕn + Veff [ρ] (r)ϕn = n ϕn
We use a self-consistency scheme to treat non-linearity.
Solve for eigenstates at fixed Veff , then update ρ and Veff .

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201612 / 24

Ground-state calculations

What we want to solve:

Kohn-Sham equations−∇2 ϕn + Veff [ρ] (r)ϕn = n ϕn
We use a self-consistency scheme to treat non-linearity.
Solve for eigenstates at fixed Veff , then update ρ and Veff .

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201612 / 24

Ground-state calculations

What we want to solve:

Kohn-Sham equations−∇2 ϕn + Veff [ρ] (r)ϕn = n ϕn
We use a self-consistency scheme to treat non-linearity.
Solve for eigenstates at fixed Veff , then update ρ and Veff .

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201612 / 24

Discretization of the Hamiltonian

For the Laplacian (kinetic energy) we use finite differences.
The local part of the potential can be applied directly.
The non-local potential is applied in a small spherical grid aroundthe atoms.
The Hamiltonian becomes a finite-size matrix.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201613 / 24

Discretization of the Hamiltonian

For the Laplacian (kinetic energy) we use finite differences.
The local part of the potential can be applied directly.
The non-local potential is applied in a small spherical grid aroundthe atoms.
The Hamiltonian becomes a finite-size matrix.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201613 / 24

Discretization of the Hamiltonian

For the Laplacian (kinetic energy) we use finite differences.
The local part of the potential can be applied directly.
The non-local potential is applied in a small spherical grid aroundthe atoms.
The Hamiltonian becomes a finite-size matrix.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201613 / 24

Discretization of the Hamiltonian

For the Laplacian (kinetic energy) we use finite differences.
The local part of the potential can be applied directly.
The non-local potential is applied in a small spherical grid aroundthe atoms.
The Hamiltonian becomes a finite-size matrix.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201613 / 24

The eigenproblem

Find the eigenvectors and eigenvalues of a matrix.
Very large matrix with lots of zero components (Sparse).
Use iterative solvers where only the action of the matrix is
required (various options available in the code).

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201614 / 24

The eigenproblem

Find the eigenvectors and eigenvalues of a matrix.
Very large matrix with lots of zero components (Sparse).
Use iterative solvers where only the action of the matrix is
required (various options available in the code).

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201614 / 24

The eigenproblem

Find the eigenvectors and eigenvalues of a matrix.
Very large matrix with lots of zero components (Sparse).
Use iterative solvers where only the action of the matrix is
required (various options available in the code).

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201614 / 24

The eigensolver

We minimize (using conjugate gradient or other method):

Rayleigh-Ritz quotient(ψ) =

hψ|H|ψihψ|ψiWorks for the first state.
For higher-energy states, it is necessary to orthogonalize against
the lower ones.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201615 / 24

The eigensolver

We minimize (using conjugate gradient or other method):

Rayleigh-Ritz quotient(ψ) =

hψ|H|ψihψ|ψiWorks for the first state.
For higher-energy states, it is necessary to orthogonalize against
the lower ones.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201615 / 24

The eigensolver

We minimize (using conjugate gradient or other method):

Rayleigh-Ritz quotient(ψ) =

hψ|H|ψihψ|ψiWorks for the first state.
For higher-energy states, it is necessary to orthogonalize against
the lower ones.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201615 / 24

The eigensolver

We minimize (using conjugate gradient or other method):

Rayleigh-Ritz quotient(ψ) =

hψ|H|ψihψ|ψiWorks for the first state.
For higher-energy states, it is necessary to orthogonalize against
the lower ones.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201615 / 24

Time-propagation

Given an initial condition, solve the:Time-dependent Kohn-Sham equationi∂ϕk= −∇2 ϕk + Veff [ρ] (r, t)ϕk∂t

Various numerical schemes of doing the time-propagation.
Many properties can be obtained.
Response to time-dependent fields: lasers.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201616 / 24

Time-propagation

Given an initial condition, solve the:Time-dependent Kohn-Sham equationi∂ϕk= −∇2 ϕk + Veff [ρ] (r, t)ϕk∂t

Various numerical schemes of doing the time-propagation.
Many properties can be obtained.
Response to time-dependent fields: lasers.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201616 / 24

Time-propagation

Given an initial condition, solve the:Time-dependent Kohn-Sham equationi∂ϕk= −∇2 ϕk + Veff [ρ] (r, t)ϕk∂t

Various numerical schemes of doing the time-propagation.
Many properties can be obtained.
Response to time-dependent fields: lasers.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201616 / 24

Time-propagation

Given an initial condition, solve the:Time-dependent Kohn-Sham equationi∂ϕk= −∇2 ϕk + Veff [ρ] (r, t)ϕk∂t

Various numerical schemes of doing the time-propagation.
Many properties can be obtained.
Response to time-dependent fields: lasers.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201616 / 24

Time-propagation

Given an initial condition, solve the:Time-dependent Kohn-Sham equationi∂ϕk= −∇2 ϕk + Veff [ρ] (r, t)ϕk∂t

Various numerical schemes of doing the time-propagation.
Many properties can be obtained.
Response to time-dependent fields: lasers.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201616 / 24

Absorption spectra from time-propagation
Start from the ground state, with a ‘kick.’Time-dependent potential⇒

V (r, t) = κδ(t)ψ → ψeik·r

Time-propagate and get the dipole d(t) as a function of time.

Polarizability tensor
αij (ω) = −

1
κi

Z

dt eiωt dj (t)Absorption cross section
σ(ω) =

D. A. Strubbe

4πω= [α(ω)]c

Introduction to Octopus

MIT IAP, Jan 201617 / 24

Absorption spectra from time-propagation
Start from the ground state, with a ‘kick.’Time-dependent potential⇒

V (r, t) = κδ(t)ψ → ψeik·r

Time-propagate and get the dipole d(t) as a function of time.

Polarizability tensor
αij (ω) = −

1
κi

Z

dt eiωt dj (t)Absorption cross section
σ(ω) =

D. A. Strubbe

4πω= [α(ω)]c

Introduction to Octopus

MIT IAP, Jan 201617 / 24

Absorption spectra from time-propagation
Start from the ground state, with a ‘kick.’Time-dependent potential⇒

V (r, t) = κδ(t)ψ → ψeik·r

Time-propagate and get the dipole d(t) as a function of time.

Polarizability tensor
αij (ω) = −

1
κi

Z

dt eiωt dj (t)Absorption cross section
σ(ω) =

D. A. Strubbe

4πω= [α(ω)]c

Introduction to Octopus

MIT IAP, Jan 201617 / 24

Absorption spectra from time-propagation
Start from the ground state, with a ‘kick.’Time-dependent potential⇒

V (r, t) = κδ(t)ψ → ψeik·r

Time-propagate and get the dipole d(t) as a function of time.

Polarizability tensor
αij (ω) = −

1
κi

Z

dt eiωt dj (t)Absorption cross section
σ(ω) =

D. A. Strubbe

4πω= [α(ω)]c

Introduction to Octopus

MIT IAP, Jan 201617 / 24

Absorption spectra from time-propagation
Start from the ground state, with a ‘kick.’Time-dependent potential⇒

V (r, t) = κδ(t)ψ → ψeik·r

Time-propagate and get the dipole d(t) as a function of time.

Polarizability tensor
αij (ω) = −

1
κi

Z

dt eiωt dj (t)Absorption cross section
σ(ω) =

D. A. Strubbe

4πω= [α(ω)]c

Introduction to Octopus

MIT IAP, Jan 201617 / 24Octopus1

Fortran 95 and C (+ some Perl utilities).
Focused on finite systems (periodic systems possible too).
Norm-conserving pseudopotentials.
Real-space grid representation.
Current version is 5.0.1
DFT with many functionals (from libxc),
Hartree-Fock, Hartree1

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201618 / 24Octopus1

Fortran 95 and C (+ some Perl utilities).
Focused on finite systems (periodic systems possible too).
Norm-conserving pseudopotentials.
Real-space grid representation.
Current version is 5.0.1
DFT with many functionals (from libxc),
Hartree-Fock, Hartree1

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201618 / 24Octopus1

Fortran 95 and C (+ some Perl utilities).
Focused on finite systems (periodic systems possible too).
Norm-conserving pseudopotentials.
Real-space grid representation.
Current version is 5.0.1
DFT with many functionals (from libxc),
Hartree-Fock, Hartree1

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201618 / 24Octopus1

Fortran 95 and C (+ some Perl utilities).
Focused on finite systems (periodic systems possible too).
Norm-conserving pseudopotentials.
Real-space grid representation.
Current version is 5.0.1
DFT with many functionals (from libxc),
Hartree-Fock, Hartree1

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201618 / 24Octopus1

Fortran 95 and C (+ some Perl utilities).
Focused on finite systems (periodic systems possible too).
Norm-conserving pseudopotentials.
Real-space grid representation.
Current version is 5.0.1
DFT with many functionals (from libxc),
Hartree-Fock, Hartree1

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201618 / 24Octopus1

Fortran 95 and C (+ some Perl utilities).
Focused on finite systems (periodic systems possible too).
Norm-conserving pseudopotentials.
Real-space grid representation.
Current version is 5.0.1
DFT with many functionals (from libxc),
Hartree-Fock, Hartree1

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201618 / 24

References
Xavier Andrade, David A. Strubbe, Umberto De Giovannini, Ask
Hjorth Larsen, Micael J. T. Oliveira, Joseba Alberdi-Rodrı́guez,
Alejandro Varas, Iris Theophilou, Nicole Helbig, Matthieu
Verstraete, Lorenzo Stella, Fernando Nogueira, Alán
Aspuru-Guzik, Alberto Castro, Miguel A. L. Marques, and Ángel
Rubio, “Real-space grids and the Octopus code as tools for thedevelopment of new simulation approaches for electronicsystems,” Phys. Chem. Chem. Phys. 17, 31371-31396 (2015).
A. Castro, H. Appel, Micael Oliveira, C.A. Rozzi, X. Andrade, F.
Lorenzen, M.A.L. Marques, E.K.U. Gross, and A. Rubio, “octopus:
a tool for the application of time-dependent density functional
theory,” Phys. Stat. Sol. B 243, 2465-2488 (2006).
M.A.L. Marques, Alberto Castro, George F. Bertsch, and Angel
Rubio, “octopus: a first-principles tool for excited electron-ion
dynamics,” Comput. Phys. Commun. 151, 60-78 (2003).
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201619 / 24

Pulpo a feira (pulpo a la gallega)
The origin of the name Octopus. (Recipe available in code.)

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

20 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24Octopus2

Ground-state DFT.
Time-propagation.
Molecular dynamics (Ehrenfest, Born-Oppenheimer).
Casida linear response.
Sternheimer linear response for electromagnetic response,
phonons, Van der Waals coefficients.
Optimal control theory.
Photoemission spectroscopy.
(Other experimental features.)2

http://www.tddft.org/programs/octopus
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 2016

21 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

Parallelization
Parallelization in domains:
Each processor handles points in a region of space.
Points in the boundaries of each region must be copied to othernodes.
Integrals are performed locally and summed over all domains.
Efficient and scalable scheme.

Parallelization in states:
Each processor handles a group of states.
Efficient scheme for time-propagation.
Also applicable for the ground state.

Parallelization in k-points/spin.
Parallelization in electron-hole pairs (for Casida linear response).
Combined parallelization.
Scales to thousands of processors.
D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201622 / 24

License

Octopus is free open-source software (GNU Public License v2).
Free to use it.
Study the code and modify it.
Contribute back your changes.

New developers are welcome.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201623 / 24

License

Octopus is free open-source software (GNU Public License v2).
Free to use it.
Study the code and modify it.
Contribute back your changes.

New developers are welcome.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201623 / 24

License

Octopus is free open-source software (GNU Public License v2).
Free to use it.
Study the code and modify it.
Contribute back your changes.

New developers are welcome.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201623 / 24

License

Octopus is free open-source software (GNU Public License v2).
Free to use it.
Study the code and modify it.
Contribute back your changes.

New developers are welcome.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201623 / 24

License

Octopus is free open-source software (GNU Public License v2).
Free to use it.
Study the code and modify it.
Contribute back your changes.

New developers are welcome.

D. A. Strubbe

Introduction to Octopus

MIT IAP, Jan 201623 / 24