# Particle in an octopus

Octopus can actually run 2D systems where the shape of the simulation box is defined by what is white in an image file. Here is an example of a “particle in an octopus”, in which we have a constant potential and an octopus-shaped quantum dot. To run it, you will need to have built the code with the optional library GDLIB.

## Input

For this example we will need two files:

#### inp


CalculationMode = gs
FromScratch = yes
Dimensions = 2

%Species
"null" | species_user_defined | potential_formula | "0" | valence | 1
%

%Coordinates
"null" | 0 | 0
%

BoxShape = box_image
BoxShapeImage = "gdlib.png"

ff = 20
%Lsize
135 / ff | 95 / ff
%

TheoryLevel = independent_particles
ConvEigenError = yes

%Output
wfs | plane_z
%


#### Gdlib.png

Make this file available in the run directory. You can download it by clicking on the image bellow. It is also available in the PREFIX/share/octopus directory from your Octopus installation.

## Plotting

The wavefunction are obtained by using:


%Output
wfs
%
OutputFormat = plane_z


View it in gnuplot with

 plot 'static/wf-st0001.z=0' u 1:2:3 linetype palette


or

 splot 'static/wf-st0001.z=0' u 1:2:(0):(\$3*500) with pm3d


Where does the wavefunction localize, and why?

## Exercises

• See how the total energy scales with the size of the system (controlled by the ff parameter in the input file). How does it compare to the formula for a particle in a box?
• Look at the wavefunctions of the unoccupied states.
• Think of a serious application that would use the ability to define the simulation box by an image!