Searching for the TiO2(001)-(1x4) reconstruction

For this tutorial we will use the dftb-calculator with the tiorg parameters.

This tutorial is very similar to the previous one for TiO clusters, searching for TiO clusters. It is recomended that you do that one before the present one, as it is more detailed.

The major difference in the present tutorial is that the template will now not be empty, but contain a number of atoms fixed at bulk positions.

The template is defined in the file TiO2_slab.traj. The following code TiO2.py is used to carry out the search:

import numpy as np  from ase.calculators.dftb import Dftb from ase.io import read  ``````
180      181                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ``````from gofee.candidates import CandidateGenerator, StartGenerator from gofee.candidates import RattleMutation, PermutationMutation ``````
182      183      184      185      186      187      188      189      190      191      192      193      194      195      196      197      198      199      200      201      202      203      204      205      206      207      208      209      210      211      212      213      214      215      216      217      218      219      220      221      222      223      224      225      226      227      228      229                                                                                                                                                                                                                                                                                                                                                                 ``````from gofee import GOFEE  ### Define calculator ### calc = Dftb(label='TiO2_surface',             Hamiltonian_SCC='No',             Hamiltonian_MaxAngularMomentum_='',             Hamiltonian_MaxAngularMomentum_Ti='"d"',             Hamiltonian_MaxAngularMomentum_O='"p"',             Hamiltonian_Charge='0.000000',             Hamiltonian_Filling ='Fermi {',             Hamiltonian_Filling_empty= 'Temperature [Kelvin] = 0.000000',             kpts=(2,1,1))  ### Set up StartGenerator and mutations ### # read slab slab = read('TiO2_slab.traj', index='0')  # Stoichiometry of atoms to be placed stoichiometry = 5*[22]+10*[8]  # Box in which to place atoms v = slab.get_cell() v[2,2] = 2.5 p0 = np.array((0.0,0.,8.)) box = [p0, v]  # initialize startgenerator sg = StartGenerator(slab, stoichiometry, box)  # initialize rattle and permutation mutations n_to_optimize = len(stoichiometry) permutation = PermutationMutation(n_to_optimize, Npermute=2) rattle = RattleMutation(n_to_optimize, Nrattle=3, rattle_range=4)  candidate_generator = CandidateGenerator([0.2, 0.2, 0.6],                                          [sg, permutation, rattle])  ### Initialize and run search ### search = GOFEE(calc=calc,                startgenerator=sg,                candidate_generator=candidate_generator,                max_steps=100,                population_size=5) search.run()

If ASE, GPAW and dftb are set up and sourced propperly, you can run the code as:

`````` 230 ``````
mpiexec --mca mpi_warn_on_fork 0 gpaw-python TiO2.py ``````
231      232      233      234      235      236      237      238      239      240      241      242      243      244      245      246      247      248      249      250      251      252      253      254      255      256      257      258      259      260      261      262      263      264      265      266      267      268      269      270      271      272      273      274      275      276      277      278      279      280      281      282      283      284      285      286      287      288      289      290      291      292      293      294      295      296      297      298      299      300      301      302      303      304      305      306      307      308      309      310      311      312      313      314      315      316      317  ``````

Setting up the system - atoms in template

In this case the template contains a number of fixed atoms representing the slap, on top of which we want to optimize a number of atoms given by stoichiometry. The final thing we need to initialize the StartGenerator , used for generation initial structures, is the box within which the StartGenerator places atoms randomly. In this case we choose a box=[p0, v] of height 2.5 starting at p0=(0,0,8), which is slightly above the slab atoms. To initialize the startgenerator, we first read in the template: