# CP2K Open Source Molecular Dynamics

### Sidebar

#### For Developers

exercises:2017_ethz_mmm:wannier

# Maximally Localized Wannier Functions

In this exercise we will explore alternative ways to divide the electronic densities into orbitals. By requiring that orbitals should be as localized as possible one obtains a representation, which closely resembles the typical text-book pictures of molecular orbitals.

You should run these calculations on 4 nodes with bsub -n 4.

Calculate the electronic ground state of the Caffeine molecule by running the provided input file. The simulation will output:

• the molecular orbitals (MOs) as separate cube-files
• the Wannier functions as separate cube-files
• the centers of all Wannier functions combined in a single xyz-file

Repeat the previous calculation on a box of 64 water molecules. You can use the following SUBSYS-section. Since the water simulation uses periodic boundary condition, don't forget to turn off the Poisson solver.

&SUBSYS
&CELL
ABC 12.4544808085 12.4544808085 12.4544808085
&END CELL
&COORD
@INCLUDE '64water.coord'
&END COORD
...
&END SUBSYS

## Questions

1. Visualize some of the MO and Wannier functions with vmd. What is the key difference between these two kinds of orbitals?
2. Visualize the Wannier centers in vmd. How can you distinguish between lone pairs, single-, and double-bonds?
Howto visualize cube files with VMD was covered in a previous exercise.

Initially VMD does not know about the dimensions of the simulations cell. To setup, e.g. a 15Å qubic box, just type the following into vmd's Tk-console:

vmd> pbc set {15.0 15.0 15.0}
vmd> pbc wrap

## Required Files

caffeine.inp
&GLOBAL
PROJECT caffeine
RUN_TYPE ENERGY
&END GLOBAL

&FORCE_EVAL
&DFT
! Output all occupied molecular orbitals as cube-files
&PRINT
&MO_CUBES
NHOMO -1
&END MO_CUBES
&END PRINT

! Calculate the maximally localized Wannier functions
&LOCALIZE
METHOD CRAZY
EPS_LOCALIZATION 1.0E-8
&PRINT
! Output the Wannier functions as cube-files
&WANNIER_CUBES
&END
! Output the centers of all Wannier functions as xyz-file
&WANNIER_CENTERS
IONS+CENTERS .TRUE.
&END
&END
&END

! exchange correlation functional
&XC
&XC_FUNCTIONAL PBE
&END XC_FUNCTIONAL
&END XC

! Poisson solver required for non-periodic calculation
&POISSON
PERIODIC NONE
PSOLVER  WAVELET
&END POISSON

! ============ SCF fine tuning ============
&MGRID
CUTOFF     400
&END MGRID
&QS
EPS_DEFAULT 1.0E-10
&END QS
&SCF
SCF_GUESS ATOMIC
EPS_SCF 1.0E-7
MAX_SCF 30
&OT
MINIMIZER CG
PRECONDITIONER FULL_SINGLE_INVERSE
&END
&OUTER_SCF
EPS_SCF  1.0E-7
MAX_SCF  4
&END
&END SCF
! ============ End of SCF fine tuning ============

&END DFT

&SUBSYS
&CELL
ABC 15.0  15.0  15.0
PERIODIC NONE
&END CELL
&TOPOLOGY
&CENTER_COORDINATES
&END
&END TOPOLOGY

&COORD
H     4.4169009427        5.7654974925        7.9758408247
N     8.6708423642        5.8343946244        6.6347213084
C     7.7544572660        7.7275482372        7.8213939469
N     6.3919654318        5.8642629272        7.3568679126
C     6.4494839543        7.1525402940        7.9597387862
C     7.4402138371        5.1755331540        6.7117923744
C     8.8064058483        7.0850033638        7.1845597858
N     8.2778986769        8.9446280562        8.2382523594
O     7.2643506988        4.0529962930        6.2454118622
C     5.1156137682        5.1424213782        7.4120564649
O     5.4684099858        7.6593220497        8.5167253955
H    10.2341485900        9.7932463989        8.0304114260
C     9.7967248636        5.1907999513        5.9591641231
H     5.2562171072        4.1726515030        7.9014364748
H     4.7402775185        4.9652043967        6.3976240445
H    10.6401430351        5.0886560185        6.6519804958
H    10.1151718438        5.7973815083        5.1027558576
H     9.4549428018        4.2086990850        5.6240133244
C     7.5708564616        9.9966158796        8.9691451507
C     9.5777006425        8.9511038401        7.8331053451
N     9.9406928680        7.8388520756        7.1872221397
H     7.5517578349       10.9193467788        8.3771079019
H     8.0665429481       10.1847691445        9.9288020634
H     6.5474923450        9.6514720878        9.1444003294
&END COORD

&KIND H
BASIS_SET         TZV2P-GTH
POTENTIAL         GTH-PBE-q1
&END KIND
&KIND C
BASIS_SET          TZV2P-GTH
POTENTIAL          GTH-PBE-q4
&END KIND
&KIND N
BASIS_SET          TZV2P-GTH
POTENTIAL          GTH-PBE-q5
&END KIND
&KIND O
BASIS_SET          TZV2P-GTH
POTENTIAL          GTH-PBE-q6
&END KIND
&END SUBSYS
&END FORCE_EVAL
BASIS_SET
H TZV2P-GTH
2
1  0  0  5  3
10.8827241585  -0.0167058885   0.0000000000   0.0000000000
3.0968750876  -0.0627538300   0.0000000000   0.0000000000
0.9874518162  -0.1917521975   0.0000000000   0.0000000000
0.3450687533  -0.4173635232   1.0000000000   0.0000000000
0.1492693554  -0.4270508887   0.0000000000   1.0000000000
2  1  1  2  2
1.4070000000   1.0000000000   0.0000000000
0.3880000000   0.0000000000   1.0000000000
#
C TZV2P-GTH
2
2  0  1  5  3  3
5.3685662937   0.0974901974   0.0000000000   0.0000000000  -0.0510969367   0.0000000000   0.0000000000
1.9830691554   0.1041996677   0.0000000000   0.0000000000  -0.1693035193   0.0000000000   0.0000000000
0.6978346167  -0.3645093878   0.0000000000   0.0000000000  -0.3579933930   0.0000000000   0.0000000000
0.2430968816  -0.6336931464   1.0000000000   0.0000000000  -0.4327616531   1.0000000000   0.0000000000
0.0812865018  -0.1676727564   0.0000000000   1.0000000000  -0.2457672757   0.0000000000   1.0000000000
3  2  2  2  2
1.0970000000   1.0000000000   0.0000000000
0.3180000000   0.0000000000   1.0000000000
#
N TZV2P-GTH
2
2  0  1  5  3  3
7.6227447102   0.0983924689   0.0000000000   0.0000000000  -0.0561654555   0.0000000000   0.0000000000
2.7970605447   0.1045217098   0.0000000000   0.0000000000  -0.1798165209   0.0000000000   0.0000000000
0.9909765447  -0.3742661352   0.0000000000   0.0000000000  -0.3653986185   0.0000000000   0.0000000000
0.3417314862  -0.6278094034   1.0000000000   0.0000000000  -0.4259126207   1.0000000000   0.0000000000
0.1116822743  -0.1675236192   0.0000000000   1.0000000000  -0.2366040346   0.0000000000   1.0000000000
3  2  2  2  2
1.6540000000   1.0000000000   0.0000000000
0.4690000000   0.0000000000   1.0000000000
#
O TZV2P-GTH
2
2  0  1  5  3  3
10.2674419938   0.0989598460   0.0000000000   0.0000000000  -0.0595856940   0.0000000000   0.0000000000
3.7480495696   0.1041178339   0.0000000000   0.0000000000  -0.1875649045   0.0000000000   0.0000000000
1.3308337704  -0.3808255700   0.0000000000   0.0000000000  -0.3700707718   0.0000000000   0.0000000000
0.4556802254  -0.6232449802   1.0000000000   0.0000000000  -0.4204922615   1.0000000000   0.0000000000
0.1462920596  -0.1677863491   0.0000000000   1.0000000000  -0.2313901687   0.0000000000   1.0000000000
3  2  2  2  2
2.3140000000   1.0000000000   0.0000000000
0.6450000000   0.0000000000   1.0000000000
POTENTIAL
H GTH-PBE-q1
1
0.20000000    2    -4.17890044     0.72446331
0
#
C GTH-PBE-q4
2    2
0.33847124    2    -8.80367398     1.33921085
2
0.30257575    1     9.62248665
0.29150694    0
#
N GTH-PBE-q5
2    3
0.28379052    2   -12.41522559     1.86809592
2
0.25540500    1    13.63026257
0.24549453    0
#
O GTH-PBE-q6
2    4
0.24455430    2   -16.66721480     2.48731132
2
0.22095592    1    18.33745811
0.21133247    0