Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

239

Transcript of Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Page 1: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS
Page 2: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

INTERNATIONAL UNION OF CRYS TAL L OGRAP HY

BO OK S E RIE S

IUCr BOOK SERIES COMMITTEE

E. N. Baker, New ZealandJ. Bernstein, Israel

G. R. Desiraju, IndiaA. M. Glazer, UKJ. R. Helliwell, UKP. Paufler, Germany

H. Schenk (Chairman), The Netherlands

IUCr Monographs on Crystallography1 Accurate molecular structures

A. Domenicano, I. Hargittai, editors2 P. P. Ewald and his dynamical theory of X-ray diffraction

D.W.J. Cruickshank, H.J. Juretschke, N. Kato, editors3 Electron diffraction techniques, Vol. 1

J. M. Cowley, editor4 Electron diffraction techniques, Vol. 2

J. M. Cowley, editor5 The Rietveld method

R.A. Young, editor6 Introduction to crystallographic statistics

U. Shmueli, G.H. Weiss7 Crystallographic instrumentation

L.A. Aslanov, G.V. Fetisov, G.A.K. Howard8 Direct phasing in crystallography

C. Giacovazzo9 The weak hydrogen bond

G.R. Desiraju, T. Steiner10 Defect and microstructure analysis by diffraction

R.L. Snyder, J. Fiala and H.J. Bunge11 Dynamical theory of X-ray diffraction

A. Authier12 The chemical bond in inorganic chemistry

I.D. Brown

Page 3: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

13 Structure determination from powder diffraction dataW.I.F. David, K. Shankland, L.B. McCusker, Ch. Baerlocher, editors

14 Polymorphism in molecular crystalsJ. Bernstein

15 Crystallography of modular materialsG. Ferraris, E. Makovicky, S. Merlino

16 Diffuse x-ray scattering and models of disorderT.R. Welberry

17 Crystallography of the polymethylene chain: an inquiry into the structure of waxesD.L. Dorset

18 Crystalline molecular complexes and compounds: structure and principlesF.H. Herbstein

19 Molecular aggregation: structure analysis and molecular simulation of crystals and liquidsA. Gavezzotti

20 Aperiodic crystals: from modulated phases to quasicrystalsT. Janssen, G. Chapuis, M. de Boissieu

21 Incommensurate crystallographyS. van Smaalen

IUCr Texts on Crystallography1 The solid state

A. Guinier, R. Julien4 X-ray charge densities and chemical bonding

P. Coppens5 The basics of crystallography and diffraction, second edition

C. Hammond6 Crystal structure analysis: principles and practice

W. Clegg, editor7 Fundamentals of crystallography, second edition

C. Giacovazzo, editor8 Crystal structure refinement: a crystallographer’s guide to SHELXL

P. Müller, editor9 Theories and techniques of crystal structure determination

U. Shmueli10 Advanced structural inorganic chemistry

Wai-Kee Li, Gong-Du Zhou, Thomas Mak11 Diffuse scattering and defect structure simulations: a cook book using the program DISCUS

R. B. Neder, T. Proffen

Page 4: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Diffuse Scattering and DefectStructure Simulations

A cook book usingthe program DISCUS

Reinhard B. NederDepartment of Physics, University of Erlangen-Nürnberg

Thomas ProffenLos Alamos National Laboratory

INTERNATIONAL UNION OF CRYSTALLOGRAPHY

1

Page 5: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3Great Clarendon Street, Oxford OX2 6DP

Oxford University Press is a department of the University of Oxford.It furthers the University’s objective of excellence in research, scholarship,

and education by publishing worldwide inOxford New York

Auckland Cape Town Dar es Salaam Hong Kong KarachiKuala Lumpur Madrid Melbourne Mexico City Nairobi

New Delhi Shanghai Taipei TorontoWith offices in

Argentina Austria Brazil Chile Czech Republic France GreeceGuatemala Hungary Italy Japan Poland Portugal SingaporeSouth Korea Switzerland Thailand Turkey Ukraine Vietnam

Oxford is a registered trade mark of Oxford University Pressin the UK and in certain other countries

Published in the United Statesby Oxford University Press Inc., New York

© R.B.Neder and Th.Proffen 2008

The moral rights of the authors have been assertedDatabase right Oxford University Press (maker)

First published 2008

Los Alamos National Laboratory LA-UR-07-7673

All rights reserved. No part of this publication may be reproduced,stored in a retrieval system, or transmitted, in any form or by any means,

without the prior permission in writing of Oxford University Press,or as expressly permitted by law, or under terms agreed with the appropriate

reprographics rights organization. Enquiries concerning reproductionoutside the scope of the above should be sent to the Rights Department,

Oxford University Press, at the address above

You must not circulate this book in any other binding or coverand you must impose the same condition on any acquirer

British Library Cataloguing in Publication DataData available

Library of Congress Cataloging in Publication DataData available

Printed in Great Britainon acid-free paper by Antony Rowe Ltd, Chippenham

ISBN 978–0–19–923369–4 (Hbk)

1 3 5 7 9 10 8 6 4 2

Page 6: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Preface

The idea of DISCUS was born during a late afternoon coffee break Ishared with Uli Wildgruber, fellow PhD student in the diffuse scatter-ing research group of our esteemed teacher Prof. Dr. F. Frey. The talkwe had centered around the difficulty that students had to simultane-ously see direct space and reciprocal space. Following this informaltalk the basic concepts of the program came to life, initially very muchinspired by the beautiful images in the Atlas of Optical Transforms byHarburn, Taylor and Welberry. From here, the program quickly tookoff into three dimensions, with the intention shifting to the simulationof disordered structures and their diffuse scattering. Only later on didthe teaching aspects come back into use. Presently the program is wellsuited for both aspects, simulation of essentially any structure, crys-talline or non-crystalline, as well as teaching students the concepts ofdiffraction physics.

Life in reciprocal space is exciting, especially if there is lots of diffusescattering to spice up the regular, strict world of Bragg reflections. It isalso easy to get lost in this world, and I am grateful to my wife Carolinaand my children Celina and Clarissa, who remind me that maybe thereis a world outside of reciprocal space worth visiting as well. Withouttheir support and patience this book would not have been possible.

Reinhard B. NederErlangen, November 2007

All of my scientific life, I have been fascinated by disordered materialsand ways to extract as much information as possible from diffractionexperiments. This fascination is a result of my work with a series ofoutstanding mentors: Prof. Friedrich Frey at the University of Munich,Prof. Richard Welberry at the Australian National University, and Prof.Simon Billinge at Michigan State University. Every new project resultedin some new addition to DISCUS, and the quest for the ultimate diffusescattering and defect structure simulation program goes on.

Most of all, I would like to thank my parents, my wife Yvonne andmy children Lukas and Klara for their inspiration and never endingsupport. I am dedicating this book to my family and especially to myfather Karl-Heinz, who sadly died last year.

Thomas ProffenLos Alamos, November 2007

v

Page 7: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 8: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Contents

1 Introduction 1

2 How to run DISCUS 3

3 Making computer crystals 73.1 Storing the structure . . . . . . . . . . . . . . . . . . . . . 73.2 Small assemblies of atoms . . . . . . . . . . . . . . . . . . 83.3 Generating the unit cell . . . . . . . . . . . . . . . . . . . . 143.4 Generating extended crystal structures . . . . . . . . . . 193.5 Unit cell transformations . . . . . . . . . . . . . . . . . . 213.6 General symmetry operations . . . . . . . . . . . . . . . . 243.7 Creating molecules . . . . . . . . . . . . . . . . . . . . . . 273.8 Example: Distorted perovskite . . . . . . . . . . . . . . . 283.9 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4 Simulating experimental data 354.1 Single-crystal scattering . . . . . . . . . . . . . . . . . . . 35

4.1.1 Finite size effects . . . . . . . . . . . . . . . . . . . 364.1.2 Coherence . . . . . . . . . . . . . . . . . . . . . . . 38

4.2 Powder diffraction . . . . . . . . . . . . . . . . . . . . . . 394.2.1 Complete integration . . . . . . . . . . . . . . . . 404.2.2 Debye formula . . . . . . . . . . . . . . . . . . . . 41

4.3 Atomic pair distribution function . . . . . . . . . . . . . 434.3.1 Calculating the PDF from a model . . . . . . . . . 434.3.2 Modeling of thermal motion . . . . . . . . . . . . 45

4.4 Properties of the Fourier transform . . . . . . . . . . . . . 484.5 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5 Correlations and creating short-range order 535.1 What are correlations? . . . . . . . . . . . . . . . . . . . . 535.2 Monte Carlo simulations . . . . . . . . . . . . . . . . . . 545.3 Creating chemical short-range order . . . . . . . . . . . . 555.4 Creating displacement disorder . . . . . . . . . . . . . . 56

5.4.1 Simple spring . . . . . . . . . . . . . . . . . . . . . 565.4.2 Lennard-Jones potential . . . . . . . . . . . . . . . 565.4.3 Bond angles . . . . . . . . . . . . . . . . . . . . . . 57

5.5 Example: Chemical short-range order . . . . . . . . . . . 57vii

Page 9: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

viii CONTENTS

5.6 Example: Distortions . . . . . . . . . . . . . . . . . . . . . 625.7 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 65

6 Creating modulations 696.1 Density waves . . . . . . . . . . . . . . . . . . . . . . . . . 706.2 Displacement waves . . . . . . . . . . . . . . . . . . . . . 756.3 Finite waves . . . . . . . . . . . . . . . . . . . . . . . . . . 796.4 Pitfalls when simulating modulations . . . . . . . . . . . 846.5 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 85

7 Creating structures with stacking faults 877.1 Types of stacking faults . . . . . . . . . . . . . . . . . . . . 87

7.1.1 Growth faults . . . . . . . . . . . . . . . . . . . . . 887.1.2 Deformation faults . . . . . . . . . . . . . . . . . . 897.1.3 Stacking fault parameters . . . . . . . . . . . . . . 89

7.2 Notations for stacking sequences . . . . . . . . . . . . . . 907.3 Reciprocal space of layered structures . . . . . . . . . . . 917.4 Algorithms to simulate stacking faults . . . . . . . . . . . 93

7.4.1 Growth faults . . . . . . . . . . . . . . . . . . . . . 947.4.2 Deformation faults . . . . . . . . . . . . . . . . . . 957.4.3 Ordering of faults . . . . . . . . . . . . . . . . . . . 96

7.5 Example: Growth faults . . . . . . . . . . . . . . . . . . . 977.6 Example: Deformation faults . . . . . . . . . . . . . . . . 1017.7 Example: Wurtzite and zincblende structures . . . . . . . 1037.8 Example: Short-range ordered faults . . . . . . . . . . . . 1047.9 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 108

8 Creating domain structures 1138.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 1138.2 Domain types . . . . . . . . . . . . . . . . . . . . . . . . . 1148.3 Definitions for a domain . . . . . . . . . . . . . . . . . . . 1158.4 Ordering and distribution of domains . . . . . . . . . . . 1218.5 Domain formation in Perovskites . . . . . . . . . . . . . . 1248.6 Example: Urea inclusion compounds . . . . . . . . . . . . 1288.7 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 135

9 Creating nanoparticles 1399.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1399.2 Creating simple particles . . . . . . . . . . . . . . . . . . . 1409.3 PDF of nanoparticles . . . . . . . . . . . . . . . . . . . . . 1459.4 Creating core–shell particles . . . . . . . . . . . . . . . . . 1509.5 Carbon nanotubes . . . . . . . . . . . . . . . . . . . . . . . 1569.6 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 159

10 Analyzing disordered structures 16110.1 Visualizing structures . . . . . . . . . . . . . . . . . . . . 16110.2 Occupancies . . . . . . . . . . . . . . . . . . . . . . . . . . 16510.3 Finding neighbors . . . . . . . . . . . . . . . . . . . . . . 16610.4 Distortions . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

Page 10: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

CONTENTS ix

10.5 Calculating correlations . . . . . . . . . . . . . . . . . . . 16810.5.1 Occupational correlations . . . . . . . . . . . . . . 16810.5.2 Displacement correlations . . . . . . . . . . . . . 17010.5.3 Correlation fields . . . . . . . . . . . . . . . . . . . 171

10.6 Bond valence sums . . . . . . . . . . . . . . . . . . . . . . 17110.7 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 172

11 Refining disordered structures 17511.1 Reverse Monte Carlo method . . . . . . . . . . . . . . . . 17511.2 Length-scale dependent PDF refinements . . . . . . . . . 17811.3 Refining parameters of a disorder model . . . . . . . . . 180

11.3.1 The program DIFFEV . . . . . . . . . . . . . . . . . 18311.3.2 Required size of the simulated structure . . . . . . 18611.3.3 Example: Simple disordered structure . . . . . . . 18811.3.4 Example: ZnSe Nanoparticles . . . . . . . . . . . . 195

11.4 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 201

A Appendix 205A.1 Contents of the CD-ROM . . . . . . . . . . . . . . . . . . 205A.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 205A.3 Functional list of commands . . . . . . . . . . . . . . . . 207A.4 Answers to exercises . . . . . . . . . . . . . . . . . . . . . 210A.5 DISCUS bibliography . . . . . . . . . . . . . . . . . . . . . 222

Index 227

Page 11: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 12: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Introduction 1In the past 50–100 years our knowledge of materials has been revo-lutionized by the ability to determine the atomic structure of increas-ingly more complex materials. However, with increasing complexityof materials, it becomes apparent that the traditional crystallographicstructure solution approach is no longer sufficient to understand prop-erties of materials on an atomic scale. The limitation of a traditionalstructure refinement is of course the fact that it only yields the long-range average structure of the material since it is based on the analysisof Bragg reflections exclusively. Deviations from the average structuremanifest themselves as weak diffuse scattering. The increase in com-puting power has made much more complex systems open to properinterpretations. In the early days of diffuse scattering the interpretationwas limited to simple disorder types like short-range order in binaryalloys or stacking faults. Their effect on the diffraction pattern can bedescribed analytically. More complex systems like domains or corre-lated displacements do not allow a straightforward analytical solution.Computer simulations of a defect structure allow a completely generalapproach to the interpretation of diffuse scattering. The increasing in-terest in analyzing diffuse scattering is apparent in the increasing num-ber of related publications and also in the appearance of textbooks inthe past few years, covering the subject of diffuse scattering. There areplenty of books on computational crystallography teaching about thetools to solve and refine crystal structures. However, what is still amystery for many students and researchers is how to analyze observeddiffuse scattering and relate it to defects in the general sense. This bookaims to be a cookbook, giving practical examples including generatingdefect structures from simple defects to domain structures or arbitrarycore–shell nanoparticles. We discuss how to calculate diffuse scatter-ing or the atomic pair distribution function and finally give exampleshow to refine these structural models based on experimental data. Eachchapter provides examples as well as references to relevant articles andbooks. We also excluded liquids and glasses as well as magnetism from Often non-crystalline are called disor-

dered materials, not to be confused withcrystals showing disorder.

this book. This is mainly due to the fact the primary function of DISCUSis to simulate disordered crystalline materials.

For the authors, the fascination with diffuse scattering began withthe study of cubic stabilized zirconia, a very hot topic 15–20 years ago.As ZrO2 is doped with, for example, CaO, oxygen vacancies are pro-duced. A layer in reciprocal space showing beautiful diffuse neutronscattering is shown in Fig. 1.1. These data were collected over months

1

Page 13: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

2 Introduction

4

3

2

1

00 1 2 3 4

[0 0

1]

[h h 0]

Fig. 1.1 Diffuse scattering from ZrO2-CaO (15 mol%) collected on the MAN-II single-crystal diffractometer at the Forschungsreaktor in Munich.

on the single-crystal diffractometer MAN-II at the old research reactorin Garching. Understanding this diffuse scattering became the thesissubject of both authors of this book and the development of the pro-gram DISCUS began around that time. The basic idea was to have atool that allows one to generate a disordered structure and calculateits diffuse scattering pattern. Over the years features such as the cal-culation of powder patterns or the atomic pair distribution functionwere added. Even later the capability of fitting diffuse scattering us-ing Reverse Monte Carlo or an external minimization program wereadded. As the authors were extending into new fields, DISCUS grewand needed capabilities were added. However, DISCUS is not only avaluable research tool, but also very useful in teaching diffraction. Theauthors created a collection of web pages as an aid to teach diffractionhttp://www.totalscattering.org/

teaching/ and the newest version features interactive examples that are executedusing DISCUS. These pages even include a module creating short-rangeorder using Monte Carlo simulations.

All examples discussed in this book include a detailed recipe allow-ing readers to run the simulations themselves. The program DISCUSas well as all input files required for the examples and exercises areincluded on the CD-ROM accompanying this book. We cannot givecomplete solutions to all disorder models that can be imagined. Wehope, however, that the algorithms and techniques laid out in this bookwill provide sufficient insight into many different recipes. They shouldenable the reader to model his own defect structures.

Page 14: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

How to run DISCUS 2Now you are ready to start reading this book, let us start with somebasics on how to run DISCUS. First you will need to install the programeither from the included CD-ROM or after downloading it from theInternet (see Appendix A.2). Double click on the DISCUS icon or typediscus on the command line and the program will start greeting youwith the window shown in Fig. 2. The question is what now?

Fig. 2.1 DISCUS at startup.In contrast to programs relying on a graphical interface, all programs

of the DISCUS package are controlled by a command language thatis based on the FORTRAN programming language. This might seemsomewhat old fashioned, but as we discuss the examples in this book,it will become apparent that this is actually a powerful feature of theprogram. Before discussing elements of the command language, let usconsider macro files. Basically one could just type the commands atthe discus prompt of the program. This might be helpful when ex-perimenting, but it is impractical for larger projects. In those cases, thecommands can be stored in a text file, that we simply call a macro. Inaddition, one can pass parameters to a macro as well as nest macrofiles, in other words call a macro from within macro. Let us considerthe simple example shown in the margin. All examples in this book File: discus/add.mac

1 # Simple macro at add two numbers2 #3 variable real,result4 #5 result=$1+$26 echo "The sum is %f",result

will be given in a similar way. Note, that the line numbers given are foreasy reference, but not actually part of the macro file. Also all macrofiles used in this book are included on the CD-ROM, so there is no typ-ing required. The filename of each macro is given just above it. Backto the example. This macro is stored in a file called add.mac and wecan execute it using the command @add or @add.mac. Just typing thiscommand will cause an error message, since the macro expects the twoparameters $1 and $2 (line 5) to be specified. Note that the parametersare separated by a comma as are all parameter lists in DISCUS. Themacro then adds the two numbers (as the name suggests) and printsthe result to the screen (line 6). For example entering @add 1.5,2.1will display the result 3.6. All macros shown in this book are executedin a similar fashion.

A very important feature of DISCUS is its online help. Simply enterthe command help for a list of available commands. More specific in-formation about a particular command can be displayed by enteringhelp command. As we have seen in the earlier example, DISCUS al-lows one to use variables. In addition to generic variables, there are pre-defined variables related to structure properties (Table 2.1). This allowsone to very simply modify a structure in DISCUS, e.g. the command

3

Page 15: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4 How to run DISCUS

Table 2.1 List of DISCUS variables.

Variable Description

n[1] Number of atoms within the crystaln[2] Number of different scattering types, i.e. atomsn[3] Number of atoms within the unit celln[4] Number of molecules within the crystaln[5] Number of different molecule typesn[6] Number of molecules within the unit cell

cdim[i,1] Lowest coordinate of any atom (i = 1, 2, 3 for x, y, z)cdim[i,2] Highest coordinate of any atom (i = 1, 2, 3 for x, y, z)

env[i] Index of neighbouring atoms after ’find’ commandmenv[i] Index of neighbouring molecules after ’find’ command

lat[i] Lattice parameters (i = 1 . . . 6 for a, b, c, α, β, γ)vol[1] Unit cell volumervol[1] Reciprocal unit cell volume

m[i] Number of scattering type (i.e. atom type) for atom ib[j] Isotropic thermal factor B for atom type jx[i] Fractional x position of atom iy[i] Fractional y position of atom iz[i] Fractional z position of atom i

mol_cont[i,j] Index of atom j in molecule imol_len[i] Number of atoms in molecule i

x[2]=0.254will set the fractional coordinate x of atom 2 to a value of0.254. We will use this in some of the examples discussed in Chapter3. As we have mentioned earlier, the syntax of the command languageis derived from FORTRAN and for those knowing that programminglanguage, the syntax of conditional statements and loops will be famil-iar. Let us consider the following simple example. The goal is to cutFile: discus/sphere.mac

1 variable integer,atom2 variable real,distance3 #4 do atom=1,n[1]5 distance=sqrt(x[atom]**2+y[atom]**2)6 if (distance.gt.$1) then7 remove atom8 endif9 enddo

a sphere of a given radius out of a two-dimensional square structure.The macro for this task is listed here. First we declare two variablesatom and distance. Next a loop over all atoms is carried out (lines4–9). Note that the number of atoms is stored in the variable n[1](Table 2.1). Next we calculate the distance from the origin (line 5) forthis simple case of a two-dimensional square lattice. Note that DISCUSstructures have the origin (0, 0, 0) in the middle of the structure. Nextwe compare the distance to the user-specified value $1 and if it is larger,the atom is removed (line 7). That’s it !

In line 5 of the above example, we have used the intrinsic functionsqrt(x) to calculate

√x. DISCUS has the most common functions im-

Page 16: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5

Table 2.2 Crystallographic functions.

Type Name Description

real bang(u1,u2,u3,v1,v2,v3[,w1,w2,w3])

Returns the bond angle in degrees betweenu and v at site w. If w is omitted, the an-gle between direct space vectors u and v isreturned.

real blen(u1,u2,u3[,v1,v2,v3])

Returns the length of the real space vectorv−u. The vector v defaults to zero.

real dstar(h1,h2,h3[,k1,k2,k3])

Returns the length of reciprocal vector k−hin Å−1. Vector k defaults to zero.

real rang(h1,h2,h3,k1,k2,k3[,l1,l2,l3])

Returns the angle between reciprocal vec-tors k−h and k−l at site k. If l is omitted,the angle between reciprocal vectors h andk is returned.

plemented such as sin(x) and so on. Refer to the online help of DIS-CUS for a complete list of functions. In addition, DISCUS provides afew crystallographic functions summarized in Table 2.2. In our earlierexample we could also have used the function blen to calculate thedistance even in case of a non-square or three-dimensional lattice.

The basics of the command language are common to all the pro-grams that are part of the DISCUS package. In this chapter we have justscratched the surface to allow readers to follow the examples. Manymore details about the command language are given in the DISCUSUsers Guide. A list of commands and modules can be found in Ap-pendix A.3.

Page 17: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 18: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Making computer crystals

33.1 Storing the structure

The computer simulation of a crystal structure can be carried out withtwo different purposes in mind. The first purpose would be the sim-ulation of the structure itself, in order to analyze the structure or tocreate a graphical representation of the structure. The second purposewould be the calculation of the Fourier transform of the scattering den-sity. A number of programs exist for structure simulation, which canbe loosely sorted into plotting, teaching, structure refinement, quantummechanical, and defect structure simulation programs.

A crucial point for all purposes is presented by the question of how tosimulate the crystal structure. The structure can either be representedby a three-dimensional map of the electron density or by a list of atompositions. The computer memory requirements are very different forthese two different representations. As an example let us take an or-thorhombic crystal structure with a unit cell of 10 x 10 x 10 Å3, 60 atomsin the unit cell and a crystal size of 32 x 32 x 32 unit cells. A grid thatis narrow enough to represent the structure requires steps of 0.2 Å, i.e.50 x 50 x 50 grid points per unit cell. At 2 bytes per grid point this crys-tal representation requires 7800 Mbyte. In comparison the storage ofthe atom positions requires three numbers per atom for the coordinatesand one for an identification of the atom type. In this representation thecrystal requires 7.5 Mbyte or less than one-thousandth of the electrondensity map. If one needs to calculate the intensity while includinganomalous scattering, the electron density must be stored as complexvalues, doubling the memory requirements. The type of informationknown about the crystal structure is encoded in very different forms.If the electron density is stored, the primary information content is thedensity of electrons per cubic angstrom or, in case of neutron scatter-ing, of the scattering density. This distinction shows already that thedensity is a specialized function. The exact positions and types of theatoms are not directly accessible. To obtain the position of an atom onehas to perform a search for a maximum density. To recognize whichatom is present at a specific location, one has to integrate the electrondensity and deduce the atom type from the total number of electronsand possibly the shape of the distribution. If similar atoms are present,this could be a very difficult and time consuming task, especially, if

7

Page 19: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8 Making computer crystals

the crystal is of large size. If your intention is a simulation of a crystalstructure, which you want to modify in order to introduce defects, thestorage of the electron density is not the ideal solution. If, on the otherhand, one stores the structure as atom coordinates and a reference tothe atom type it is easy to quickly locate atoms of a certain type andmodify these accordingly. Secondary data like bond lengths, bond an-gles or coordination spheres are readily calculated. Now, however, thecalculation of the electron density distribution is a more complex task.One would have to calculate the convolution of the atom distributionwith the individual electron density distributions of each atom or cal-culate the Fourier transform, using the tabulated atom form factors forX-ray scattering or scattering lengths for neutron scattering and thencalculate the inverse Fourier transform. It is well known that you haveto use intensities far into reciprocal space to get electron densities with-out too serious errors due to the finite Fourier series when doing theinverse Fourier transform. In Chapter 4 we will present examples thatillustrate this relationship. The graphical output used to realize the first

Fig. 3.1 Typical structure plot showing in-dividual atoms and polyhedra.

purpose can take a wide range of forms (Fig. 3.1). This is discussed inmore detail in Section 10.1. Let us analyze the information about thecrystal that is necessary to create a graphical representation. In orderto draw the crystal structure the program must know where the atomsare located or must be able to calculate the positions from the contentof the asymmetric unit and information about the crystal symmetry. Itis sufficient to store the coordinates of all atoms and their individualtype and optionally the atomic displacement parameter .The plot can

Currently DISCUS only supportsisotropic displacement parameters. Alsonote that there are no occupancies.DISCUS is designed to simulate realstructures. In large model crystals,occupancies are created by removing theappropriate number of atoms from thesystem to match the overall occupancyas we will see in later examples.

be calculated from the information present in this list. Many structuralparameters can be deduced from this list as well like the shape of co-ordination polyhedra, the bond lengths and bond angles, etc. For thistype of analysis it is not necessary to create the actual electron densitydistribution. If, on the other hand, the purpose of the crystal structuresimulation is the analysis of bond characteristics, then a map of theelectron density obtained from experimental data is required.

In this chapter we will journey from the simulation of a single atomto that of a crystal. Unit cell transformations and general affine opera-tions will conclude this tour. We will develop the steps and algorithmsneeded to simulate a crystal, which most programs apply without theexpressed need of the user to know the details. An important goal ofthis book is the simulation of extended crystal defects, and to enable thereader to perform these simulations we cover the basics of a simulationin extensive detail.

3.2 Small assemblies of atoms

Previously it was outlined that the storage of the atom positions is avery compact and efficient way to store a simulated crystal structure.A direct consequence of this is that it is equally possible to simulatea small finite assembly of atoms instead of a periodic crystal. These

Page 20: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.2 Small assemblies of atoms 9

small assemblies may assume any shape and no limitations exist onthe presence of symmetry elements. This section will describe ways tosimulate small finite assemblies of atoms. Every structure simulation,whether this be a single atom, a non-periodic cluster of atoms or a largecrystal, consists of the following basic steps:

• Define the unit cell parameters, or more generally speaking thebase vectors, to which the atom coordinates will be referred.

• Calculate the metric tensor and the reciprocal metric tensor.• To facilitate vector algebra the epsilon tensor is useful [1].• In the case of a crystal, the space group has to be defined and the

corresponding symmetry operations have to be generated.• Store the x, y and z coordinates and an atom type identifier in

arrays.

Beyond these basics, further information is useful or required depend-ing on the application of the simulation.

• One must provide various atom properties like radius, plottingcolor, plotting size scattering curve, anomalous dispersion ab-sorption coefficient, . . .

• For a plotting program connectivity information on the bonds be-tween the atoms must be provided to speed up the representa-tions of bonds. As for a crystal structure one must provide infor-mation about the basis for the atom position, i.e. the lengths andangles between the base vectors. One has the freedom to adoptany base system that is best suited to the distribution of the atoms,whether this be a triclinic base or a cartesian base.

0.250–0.25

–0.25

0.25

0

y (Å

)

x (Å)

Fig. 3.2 Generated structure with singlezirconium atom.

File: sim/simul.1.mac1 read2 free 1.0,1.0,1.0,90.0,90.0,90.03 #4 insert zr,0,0,0,0.15 save atom.stru6

We will discuss these steps as we expand our simulation from a sin-gle atom to a complete crystal. To describe the coordinate system andthe position of atoms, one must set up a system of base vectors andprovide the atom positions. For our first example we want to create acartesian space and position a single zirconium atom at the origin. Thenecessary DISCUS commands are shown here. The first command en-ters the structure reading submenu of DISCUS, where the space can bedefined. In this example, DISCUS does not read a structure but gener-ates an empty space, defined by the three lattice parameters of 1.0 Å andthe three angles of 90.0◦. The last command inserts a zirconium atomat the position 0.0 · a, 0.0 · b, 0.0 · c. The last parameter of the insertcommand defines an isotropic displacement parameter B. All coordi-nates are understood as fractional coordinates. The resulting one-atomstructure is shown in Fig. 3.2. Further atoms could now be added tocreate a larger group of atoms and even a full crystal. It is obvious thatthis would become a formidable task for all but very small groups ofatoms. A variety of tools are needed to expand the group of atoms. Themost efficient tool to create a large crystal is obviously a list of atomsin the asymmetric unit in combination with the corresponding spacegroup symmetry operations and information about the number of unitcells in the crystal. This procedure will be described in more detail in

Page 21: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

10 Making computer crystals

the next section. For the time being, we will limit ourselves to smallgroups of atoms to show the scope of tools that can be used to createcrystal structures. Small groups of atoms are easier to display than alarge crystal and it is easier and very instructive for students to see thegrowth of a small group of atoms into a crystal, especially in connec-tion with the respective diffraction pattern. The same tools will oftenbe used when modifying a large crystal.

0

0

1

2

3

4

5

6

x (Å)

y (Å

)

Fig. 3.3 Generated structure with row offive zirconium atoms.

File: sim/simul.2.mac1 read2 free 1.0, 1.0, 1.0, 90.0, 90.0, 90.03 #4 variable integer,loop5 variable real,ypos6 #7 do loop=0,$18 ypos=1.414*loop9 insert zr,0.0,ypos,0.0,0.1

10 enddo11 #12 save row.stru

As our next example we will create a straight row of n equally spacedatoms (Fig. 3.3). We will use a cartesian base system, as in the previousexample. To compute the positions of the atoms and to insert theseinto the computer memory one has to write a simple one-dimensionalloop. The loop counter is used to calculate the position of each atomand each new atom is appended to the existing list, while incrementingthe number of atoms stored so far. As in the previous example, the firsttwo commands set up a cartesian base system. The subsequent loop inlines 7 through 10 uses an integer variable loop which was defined inline 4. The loop is then executed up to a value $1 which was given onthe command line when calling the macro file. The loop index is usedto calculate a real variable ypos in line 8 and then zirconium atoms areinserted into the space at equally spaced positions (0.0, ypos, 0.0) alongthe y-axis. You can easily change the direction of the row by modifyingthe vector (0.0, ypos, 0.0) to a general vector, whose elements are afunction of the loop counter. By enveloping this loop with one or twoouter loops, one can create a two- or three-dimensional crystal. Thisexample is limited to a crystal with a primitive lattice and only a singleatom in the unit cell. In order to create a more complex symmetry,one could include more than one insert command into the loop. Itis obvious that this will become very tedious for high symmetries andproper use of the space group symmetry should be done automaticallyas we will discuss later in this chapter.

The following two examples will demonstrate the use of differentcoordinate systems, a cartesian and a hexagonal base system. We willsimulate the identical structure, a hexagon of carbon atoms, to illustratethe appropriateness of an adapted base system. In both coordinate sys-tems this type of structure is easiest to created by applying the sym-metry element that is present in the structure, here a six-fold axis. Thecorresponding matrix representations of the six-fold axes normal to theab-plane are:

⎛⎝ cos 60◦ − sin 60◦ 0.0

sin 60◦ cos 60◦ 0.00.0 0.0 1.0

⎞⎠

⎛⎝ 1.0 −1.0 0.0

1.0 0.0 0.00.0 0.0 1.0

⎞⎠

cartesian base hexagonal base

(3.1)

To create a simulated crystal one has to set up an appropriate base andthen apply the symmetry operation to generate the new atom positions.The simulation will require a loop over the six atoms we want to cre-ate. You can use two different algorithms to create the atom number

Page 22: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.2 Small assemblies of atoms 11

1

0

–1

–1 0

x (Å)

1

1

0

–1

–1 0 1

x (l.u.)

y (l.

u.)

Y (

Å)

Fig. 3.4 Hexagon in cartesian and hexagonal space.

i from the location of the first. The first algorithm repeatedly appliesthe symmetry operation to the atom position generated by the previ-ous symmetry operation. The second changes the angle stored in thesymmetry matrix from 60 to 120 to 180◦ , etc. and operates each timewith the original position The DISCUS macro for the cartesian space isshown here. File: sim/simul.3.mac

1 read2 free 1.0, 1.0, 1.0, 90.0, 90.0, 90.03 r[1]=1.4004 r[2]=0.0005 r[3]=0.0006 do i[1]=0,57 r[4]=cosd(60.)*r[1]-sind(60.)*r[2]+0.*r[3]8 r[5]=sind(60.)*r[1]+cosd(60.)*r[2]+0.*r[3]9 r[6]=0.*r[1]+0.*r[2]+1.*r[3]

10 insert C,r[4],r[5],r[6],0.111 r[1]=r[4]12 r[2]=r[5]13 r[3]=r[6]14 enddo

File: sim/simul.4.mac1 read2 free 1.40,1.40,1.00, 90.0,90.0,120.03 r[1]=1.0004 r[2]=0.0005 r[3]=0.0006 do i[1]=0,57 r[4]=1.0*r[1] - 1.0*r[2] + 0.0*r[3]8 r[5]=1.0*r[1] + 0.0*r[2] + 0.0*r[3]9 r[6]=0.0*r[1] + 0.0*r[2] + 1.0*r[3]

10 insert C,r[4],r[5],r[6],0.111 r[1]=r[4]12 r[2]=r[5]13 r[3]=r[6]14 enddo

The first two lines set up the cartesian base as before. In lines 3through 5 the initial vector to the atom positions is defined. Lines 6through 14 encompass the loop which is executed six times, using thevariable i[1] as loop index. Note that in this example we are usingthe generic integer variables i[n] and real variables r[n] rather thandeclaring named variables as in the previous example. In line 7 through9 the matrix operation is performed. A carbon atom is inserted at theresulting position (r[4], r[5], r[6]) in line 10. Finally the result-ing vector is copied back onto the input value in lines 11 through 13.Equally well one could keep the initial coordinates and modify the an-gle in the symmetry matrix. The method applied in the current macrocorresponds to a multiple application of the symmetry operation, whilethis latter method corresponds to applying the different symmetry op-erations to the original position.

Table 3.1 Atom positions in cartesian and hexagonal space.

Atom Cartesian space Hexagonal space

C 0.70000 1.21243 0.00000 1.00000 1.00000 0.00000C −0.70000 1.21243 0.00000 0.00000 1.00000 0.00000C −1.40000 0.00000 0.00000 −1.00000 0.00000 0.00000C −0.70000 −1.21243 0.00000 −1.00000 −1.00000 0.00000C 0.70000 −1.21243 0.00000 0.00000 −1.00000 0.00000C 1.40000 0.00000 0.00000 1.00000 0.00000 0.00000

Page 23: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

12 Making computer crystals

Now let us look at the equivalent macro needed to create the hexagonon a hexagonal basis. This time a hexagonal base with lattice constantsof a = 1.4 Å , b = 1.4 Å , c = 1.0 Å, α = 90.0◦, β = 90.0◦, γ = 120.0◦ isset up in line 2. Now the initial vector is (1, 0, 0), which is at the samedistance from the origin as before. Again the symmetry operation isapplied six times by the loop in lines 6 through 14. The only differenceis the modified symmetry matrix in lines 7 through 9. The two result-ing structures are plotted in Fig. 3.4 and the atom positions are listedin Table 3.1. It is obvious from Fig. 3.4 that the two hexagons are iden-tical. Since the hexagonal base is better adapted to the symmetry ofthe hexagon, the numbers that represent the atom positions are simpleinteger multiples of the base vectors. At first this might seem to be ofadvantage in order to avoid rounding errors. Keep in mind, though,that the computer stores the values as the logarithm to the base 2 andthus, a number like 3.0000 is internally not a simple 3 and prone to thesame rounding errors as the number 1.21243. Which coordinate systemone uses is entirely up to personal taste. An adapted system will yieldsimpler numbers and thus will be easier to understand when checkingthe result.

As a final example for this section we will create a pentagon of atomsand expand this pentagon into a larger structure. We will use a carte-sian base system, since there is no base system adapted to the symmetryof a pentagon with only two vectors in the plane of the pentagon. Todescribe a pentagon you need a base system with four vectors in theplane. The macro is practically identical to the macro used to createthe hexagon in cartesian space. All that needs to be changed is the an-gle from 60.0◦ to 72.0◦. In addition we will place a ring of five furtherpentagons around the inner pentagon. As in the earlier macros, theFile: sim/simul.5.mac

1 read2 free 1.0, 1.0, 1.0, 90.0, 90.0, 90.03 #4 do i[1]=0,45 r[1]=cosd(i[1]*72.0)6 r[2]=sind(i[1]*72.0)7 insert si,r[1],r[2],0.0,0.018 enddo9 #

10 do i[2]=0,411 r[3]=cosd(i[2]*72.0)*2.61812 r[4]=sind(i[2]*72.0)*2.61813 do i[1]=0,414 r[1]=cosd(i[1]*72.0)15 r[2]=sind(i[1]*72.0)16 insert si,r[1]+r[3],r[2]+r[4],0.0,0.0117 enddo18 enddo

first two lines set up a cartesian space with 1.0 Å lattice constant. Thefirst loop in lines 4 through 8 is similar to the loop used to create thehexagon. This time, however, the angle is modified each time that theloop counter is incremented. The silicon atoms are inserted at the po-sitions (r[1], r[2], 0.0). The outer loop in the second half of themacros calculates five vectors with coordinates (r[3], r[4], 0.0)whose length is 2.618 times the unit length. The length of this vectoris equal to τ2, with τ = 1.61833 . . . = (

√5 + 1)/2, the golden mean.

The inner loop in lines 13 through 17 calculates the positions of the fiveatoms. The atoms are inserted at the sum of the vectors to the individ-ual atoms (r[1], r[2], 0) and to the center of the outer pentagons(r[3], r[4], 0). The resulting structure is plotted o the top left ofFig. 3.5. The structure in the top right half of Fig. 3.5 is calculated anal-ogously. In order to turn each individual pentagon by 36◦ around itscenter the lines 5 and 6 and 14, 15, respectively, have to be changed to:

5 r[1]=cosd(i[1]*72.0 + 36.0)6 r[2]=sind(i[1]*72.0 + 36.0)

The two structures look a bit different, yet they show tantalizing sim-ilarities, and produce striking diffraction patterns as we can see in thebottom part of Fig. 3.5. Note that for both structures the bond length of

Page 24: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.2 Small assemblies of atoms 13

2

0

–2

2

0

–2

–2

x (l.u.) x (l.u.)

y (l

.u.)

k (r.

l.u.)

Log

. Int

ensi

ty

y (l

.u.)

–2 2

6

4

2

0

0

1

0 1 2 3

h (r.l.u)

02

Fig. 3.5 In the top left structure the vector from the center of each pentagon to the firstatom is at 0◦ to the x-axis while it is at 36◦ in the top right structure. As a visual aid, thebonds between the atoms of a pentagon are plotted as well. The bottom panel shows thediffraction pattern corresponding to the left structure. Note, the intensities are shown ona logarithmic scale.

1.1756 Å between the atoms within each pentagon also occurs as a con-necting bond between the outer pentagons. If you add the two vectorsfrom the origin of the structure to the center of two adjacent outer pen-tagons, you form a thick rhombus, which is one of the building blocksof a Penrose tiling. If you add a third loop to the macro where the cor-responding lines 11 and 12 are modified to

11 r[3]=cosd(i[2]*72.0)*2.618+cosd((i[2]+1)*72.0)*2.61812 r[4]=sind(i[2]*72.0)*2.618+sind((i[2]+1)*72.0)*2.618

you are on your way to create a pentagonal quasi-crystal. A similarapproach was used by Hradil et al. [2] to create a large decagonal quasi-crystal and ultimately to create defects within this crystal. Since thepurpose of that work was the introduction of small periodic domainsinto the quasi-crystalline host structure such a build up of the basicquasi-crystal was the best solution. If you want to create an extended

Page 25: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

14 Making computer crystals

perfect Penrose tiling an alternative approach is better suited. First,create a perfect lattice in a higher dimensional space and then projectthis lattice into a two-dimensional space [3].

3.3 Generating the unit cell

In this section we will show how symmetry elements work in crystalstructures to generate the atoms from the content of the asymmetricunit. The main focus will be on the aspects concerning the simulationof crystal structures, while more general parts on symmetry operationswill be omitted. The reader is referred to several excellent textbookson this topic like the book by D.E. Sands [1] or the International Tablesfor Crystallography [4] Vol. A. The generation of the unit cell contentby interpretation of the space group symbol or a list of symmetry ele-ments is at the core of each crystal simulation program, whether this bea plot program, a structure refinement program or a program to createextended defect structures. Most programs hide the calculation and theinvolved algorithm from the user and perform this task automatically.In this section we will go through the required steps, which will oftenbe the initial steps for large defect structures.

The coordinates of any atom are expressed in terms of componentsalong the three base vectors a, b, and c, traditionally named x, y, and z.Throughout this book, vectors are shown

in bold letters, e.g. a. For computational purposes it is more convenient to use a single arraytype variable and to refer to the base vectors as a1, a2, a3 and to thecoordinates of vector v as v1, v2, v3. The distinction between subscriptsand superscripts is important for the description of unit cell transfor-mations, since these different vectors follow different transformationrules. Computer languages, however, do not know this distinction andyou have to keep the distinction in mind. Quantities with subscriptsare called covariant, while quantities with superscripts are called con-travariant. If you increase the length of the base vectors used to describethe coordinates of vectors, the absolute values of covariant quantitiesincrease while those of contravariant quantities decrease. Covariantvectors should be written as row vectors, and contravariant vectors ascolumn vectors. In this notation we can write the vector v as:

v = xa + yb + zc

= a1v1 + a2v

2 + a3v3

= Σaivi

= (a1, a2, a3)

⎛⎝ v1

v2

v3

⎞⎠ (3.2)

The three elements of the row vector ( a1, a2, a3 ) are in turn vectors andthe result of the scalar product is a single quantity, which contains thevector v. A symmetry operation copies an atom to a different site withinthe crystal. For computational purposes, this symmetry operation is

Page 26: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.3 Generating the unit cell 15

best represented in matrix form and the atom position as a vector. Inthis matrix representation, the symmetry operation takes the form of:⎛

⎝ w11 w12 w13

w21 w22 w23

w31 w32 w33

⎞⎠ ∗

⎛⎝ x

yz

⎞⎠ +

⎛⎝ t1

t2t3

⎞⎠ +

⎛⎝ o1

o2

o3

⎞⎠ (3.3)

Here the translational part of the symmetry element has been separatedinto the components oi, which arise from the location of the symmetryelement and the components ti, which arise from a true translationalpart of the symmetry element such as a screw axis or glide plane. Forcomputational purposes it is more convenient and compact to write thesymmetry operation as a 4 x 4 matrix in the form:⎛

⎜⎜⎝w11 w12 w13 w14

w21 w22 w23 w24

w31 w32 w33 w34

0 0 0 1

⎞⎟⎟⎠ ∗

⎛⎜⎜⎝

xyz1

⎞⎟⎟⎠ (3.4)

with wi4 = ti + oi. There is general agreement in literature to write theposition of an atom as a single column vector. Unfortunately this doesnot hold for the base vectors and vectors in reciprocal space. These arewritten either as a single column or as the transpose, i.e. a single rowvector. Great care has to be applied when interpreting the definitionof a reciprocal space symmetry matrix. Equation 3.5 shows the corre-sponding setup for hkl as a row vector. The matrix qij is the transposeof the inverse matrix of wij from equation 3.3.

(h k l 0

) ∗⎛⎜⎜⎝

q11 q12 q13 q14

q21 q22 q23 q24

q31 q32 q33 q34

0 0 0 1

⎞⎟⎟⎠ (3.5)

Note that the value of zero in the reciprocal space vector (hkl0) ig-nores the translational part of the reciprocal space symmetry. Recipro-cal space does not have translational symmetry and a regular rotationand a screw axis both copy a reciprocal vector onto the same result-ing vector. A symmetry operation with non-zero translation does how-ever affect the phase angle of the Bragg reflection. As illustrated by thehexagon in Section 3.2, the values of the symmetry matrix depend onthe chosen base system.

In a space group, all atoms can be created by applying all symme-try operations of the space group to an individual atom. If the spacegroup has N symmetry operations including the identity operation,N − 1 copies of an atom on a general position x, y, z are created. Ifthe atom lies on one or several symmetry operations, these operationscopy the atom onto itself. These are the so called special positions ofthe space group. Keep in mind that if the symmetry element containsa translational component, the atom will never be copied onto itself,although it may be located in the plane of, e.g. a glide plane. The accu-rate definition of a special position is that the atom is copied onto itself.

Page 27: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

16 Making computer crystals

Table 3.2 List of generator matrices in space group C2/m

⎛⎜⎝

1 0 0 0.50 1 0 0.50 0 1 0.00 0 0 1

⎞⎟⎠

⎛⎜⎝

−1 0 0 00 1 0 00 0 −1 00 0 0 1

⎞⎟⎠

⎛⎜⎝

−1 0 0 00 −1 0 00 0 −1 00 0 0 1

⎞⎟⎠

t ( 1

2, 1

2, 0) 2 0, y, 0 1 0, 0, 0

A program that creates all atoms of the unit cell has to apply succes-sively all the symmetry operations to the first atom. Each copy must bechecked with respect to the atoms generated previously to see whetherthis atom is copied onto itself. The identity of the position has to bechecked with allowance for small numerical rounding errors.

An inherent property of all groups in the mathematical sense is thatall elements can be created by applying a subset of the symmetry oper-ations, the so-called generators. The symmetry operations representedby these generators are applied to the original atom and in turn to allcopies of this atom. As a result all symmetrically equivalent atomsresult and the final crystal will display all symmetry elements of thespace group. This procedure is illustrated by an example in space groupC2/m. The generators listed in the International Tables are:

1; t(1, 0, 0); t(0, 1, 0); t(0, 0, 1); t(12 , 1

2 , 0); 2 0, y, 0; 1 0, 0, 0

The first generator is the trivial identity operation, and the next threegenerators create the translations along the a, b and c axes, respectively.The fifth generator corresponds to the C-centering of the unit cell, thesixth to the two fold axis parallel b and the last to the center of inversionat the origin. The matrix representations of these generators are listedin Table 3.2.

The selection of these generators is not unique, nor is their sequence.Instead of the center of inversion, the mirror operation could equallywell have been chosen as generator. In our example we will stick tothe sequence and choice of the International Tables. This will create theatoms in the same sequence as in the International Tables, and for thisreason this standard has been adopted by DISCUS. The generators sug-gested by the space group symbol C2/m would be the C-centering, thetwo-fold axis and the mirror plane rather than the center of inversion.

One exception should be made though. In a computer simulationof a structure one will often create crystals of different size for a givenstructure. A small crystal will usually serve as test while developinga complicated defect structure. Once this step is done, the crystal isexpanded to a large crystal. In order to keep the modification of neigh-boring atoms easier, it is best to keep all atoms within a unit cell in acontiguous segment of the computer memory. Thus their relative po-sitions do not change as the crystal size changes. For this reason, thegenerators of the primitive translations should be applied last.

Page 28: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.3 Generating the unit cell 17

In our example let us assume an atom at x, y, z. The first genera-tor creates a copy at x + 0.5, y + 0.5, z. The next generator, the twofold axis has to be applied to both of these atoms. The corresponding

Generated

Unit cell

–0.5 0 0.5x (l.u)

y (l

.u)

y (l

.u)

0.5

0.5

–0.5

–0.5

0

0

Fig. 3.6 Atoms generated by symme-try elements in C2/m: The top pictureshows the atoms as generated; the bot-tom picture shows the atom locations af-ter shifting into the unit cell.

copies will be at −x, y,−z and −x − 0.5, y + 0.5,−z. Finally the cen-ter of inversion will be applied to all four atoms to create −x,−y,−z,−x − 0.5,−y − 0.5,−z, x,−y, z and x + 0.5,−y − 0.5, z. Figure 3.6shows the atoms that have been created from an atom at coordinates0.1, 0.2, 0.3. Notice that only the first two atoms are inside the originalunit cell, while the other atoms are scattered around the origin and thatthe centering component takes values that differ by integer multiplesof the primitive translations. The reason for the latter is the fact that thedifferent symmetry operations are applied to the first centering vec-tor, turning it into different, symmetrically equivalent directions. Thesequence of these atoms is identical to that of the International Tables.Note that in the International Tables the centering positions are not ex-plicitly printed. To be able to modify a crystal structure it is useful tohave all atoms grouped in unit cells and to store the unit cells one afteranother. Thus the originally created atoms should be moved by inte-ger multiples of the base vectors into the first unit cell. The locationsof the atoms after this operation are shown in the bottom half of Fig.3.6. The atom positions are listed in Table 3.3. Keep in mind that for anactual numerical example the signs of the individual centering vectorswill depend on the numerical values of x, y and z. If the first atom ise.g. at the coordinates 0.7, 0.4, 0.3 the second atom will be at 0.7, 0.9, 0.3i.e. x − 0.5, y + 0.5, z. This task is performed automatically by DISCUSand other structure simulating programs when reading an asymmetricunit. To provide the structure simulation program with the necessarysymmetry information one can either provide a full list of symmetryoperations as is needed for SHELXL [5] or give the space group symbol,usually the Hermann Mauguin symbol. In the latter case the programmust either refer to a lookup table to get the required generators or tryto interpret the Hermann-Mauguin symbol. The lookup table offers theadvantage that the same sequence of atoms is generated as in the Inter-national Tables, yet is limited to the tabulated space groups. Alternativesettings or different origins must explicitly be added to the internal list.The interpretation of the Hermann Mauguin symbol is independent ofthe chosen setting, yet does not provide information about the originof choice. In many cases the generators derived from the short Her-

Table 3.3 Atom positions in C2/mafter the atoms have been movedinto the first unit cell.

x y zx + 1

2y + 1

2z

1 − x y 1 − z1 − x − 1

2y + 1

21 − z

1 − x 1 − y 1 − z1 − x − 1

21 − y − 1

21 − z

x 1 − y zx + 1

21 − y − 1

2z

mann Mauguin symbol differ from those chosen in the International Ta-bles. The short Hermann Mauguin symbols were chosen to express asclearly as possible the systematic extinction rules. For a full discussionof the interpretation of the Hermann-Mauguin symbol see [6, 7, 8, 9].

The generators in the last example were applied only once to eachof the atoms they copied. A second application of the two-fold axis orthe center of inversion would, trivially, create the original atom again.Multiple applications of the centering vector will create primitive trans-lations, which a program will create separately. Most of the generatorsused to create the space group lists in the International Tables are ap-

Page 29: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

18 Making computer crystals

plied only once. The generators for the three, four and six-fold axesrequire special attention. The generators for the three-fold axis are ap-plied twice to each of the atoms they copy. As an example refer to spacegroup P3 (No. 143). The only generator used is the rotation by 120◦,the symmetry operation (2) 3+ 0, 0, z. This generator is applied twice tothe atom at x, y, z to generate the atoms at y, x − y, z and x + y, x, z. Adifferent strategy is applied to generate a four-fold axis. Instead of ap-plying a 90◦ rotation three times, the atoms are generated by combina-tion of a two-fold rotation and a single 90◦ rotation. Finally, the six-foldaxis is generated by combining a doubly applied three-fold axis with atwo-fold axis. The special properties of the three-fold axis require themultiple application of the generator instead of using the 240◦ rotationas second generator. Applying the three-fold rotation only once andthen the 240◦ rotation as second generator would copy the atoms x, y, zand y, x− y, z to x+ y, x, z and x, y, z. Thus the first atom would be cre-ated a second time. The four-fold and six-fold axes could equally well

0

0

0.5

1

0

0.5

1

0.5 1x (l.u)

y (l

.u)

y (l

.u)

Fig. 3.7 Small NaCl crystal. The sodiumis represented by the full circles, the chlo-rine by the open squares. The top pictureshows the ab-plane of a crystal with cor-rect stoichiometry; the bottom picture acrystal with correct symmetry.

be generated by using only one generator which is applied four andsix times, respectively. All atoms would be created, yet in a sequencedifferent from the International Tables. Whether the choice of generatorsand their sequence is important for a simulated structure depends onthe application. If the structure is simulated for graphical representa-tion, the sequence of atoms is of less importance. The interaction of theuser with the program is supported by clicking with the mouse ontoa selected atom and to modify its representation properties like color,coordination polyhedron, etc. The program can then use its internallist of generators to apply the modifications to all symmetrically equiv-alent atoms. If, however, the purpose is the creation of a large defectstructure, many atoms must be modified. Often symmetrically equiv-alent atoms will be modified differently. This task is no longer feasibleby manually modifying atoms displayed on the screen but rather needsto be performed automatically by a specific user-defined routine. Theuser must know the location of each atom within the array that storesthe atoms and thus must know the choice and sequence of generators.The last macro would create the wrong structure if the initial atom werelocated at 0, 0, 0 or another of the special positions. The macro appliesthe symmetry operations without checking whether the atom is copiedby one of the generators onto a previous position. Usually, the programmust compare the resulting atom with previously generated atoms. Ifany of the positions are identical, the generator is omitted. This com-parison must allow for small numerical rounding errors. It is sufficientto check the result of each generator for the first atom. If the gener-ator copies this atom onto a previously generated position, the samewill hold for all other atoms as well. If on the other hand the generatorcreates a new copy of the first atom, all other previously created atomswill also be copied onto new positions. The result will be a crystal withthe correct number of atoms on general and special positions.

The unit cell shown at the top of Fig. 3.6 shows all symmetry ele-ments of the space group and contains all eight symmetrically equiv-

Page 30: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.4 Generating extended crystal structures 19

alent atoms. If some or all of the atoms are on positions where oneor more coordinates are equal to zero, it becomes impossible to ful-fill both the exact symmetry of the overall crystal and the true chem-ical composition. As an example see the two simulations of the NaClstructure in Fig. 3.7. The figure shows the xy0-plane of two crystals ofslightly different size. In the crystal on the top the atoms are limited to0 ≤ x, y < 1, while they are limited to 0 ≤ x, y ≤ 1 in the crystal on thebottom. The top crystal shows the correct chemistry of NaCl, yet manyof the symmetry elements are missing. The bottom crystal, on the otherhand, has a composition of Na5Cl4, i.e. one chlorine atom is missing.This time, however, all symmetry elements are present. As you canquickly verify, the corresponding three-dimensional crystals will havea composition of Na4Cl4 and Na14Cl13, respectively. Again, the sym-metry differences are the same as in the two-dimensional case. Thelarger the crystal you simulate, the less important these differences willbe. These small deviations from chemistry or symmetry might seemnegligible, and in most cases they will indeed be. As an exercise cal-culate the corresponding differences for the CaF2 structure. Keep inmind, though, that if you ask students to simulate a small crystal andto look at its Fourier transform, they might observed confusing devi-ations from symmetry and/or relative intensities of Bragg reflections.The crystal shown in the top panel of Fig. 3.7 will produce the correctintensities and the m3m symmetry relationship for the Bragg reflec-tions, yet 43m symmetry for non-integer positions in reciprocal space!As pointed out in Section 4.1.1, the calculation of Bragg reflections, i.e.integer positions of reciprocal space, implies a convolution of the finitecrystal with an infinite lattice. Thus the intensity and symmetry of theBragg reflections corresponds to a perfect infinitely sized crystal with-out boundary problems. Correspondingly, the calculation of Bragg re-flections for the crystal in the bottom panel of Fig. 3.7 implies a crystalthat has multiple atoms on the surfaces of each unit cell and the intensi-ties are wrong. When calculating the intensity at non-integer positionsin reciprocal space this convolution does not apply and you get the truesymmetry of this cluster of atoms.

3.4 Generating extended crystal structures

In the last section we created an individual unit cell from the content ofan asymmetric unit and the space group symmetry. In this section wewill create a crystal based on this unit cell. The most straightforwardmethod is to copy the first unit cell to adjacent unit cells. This operationcorresponds to a multiple application of the translations along the basevectors a, b and c. The resulting crystal will consist of a block of N1

x N2 x N3 unit cells. It will depend on your application whether thiscrystal shape is suited for your needs. This shape is very well suitedas a base for creating a defect structure and to calculate the Fouriertransform of a crystal. A very simple relationship exists between the

Page 31: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

20 Making computer crystals

position of an atom in the crystal and its position in computer memory.With this relationship it is easy to quickly locate an atom and to modifyit accordingly. The Fourier transform of a block of unit cells will yieldvery simple finite size effects and thus lets you concentrate on the defectstructure and its scattering.File: sim/simul.1.cll

1 title Dummy structure in C2/m2 spcgr C2/m3 cell 5.00 8.00 13.00 90.0 100.0 90.04 atoms5 ZR 0.1000 0.2000 0.3000 0.1

File: sim/simul.6.mac1 read2 cell c2m.cell,3,2,1

1050–5–10

–5

0

5

–5

0

5

y (l

.u)

y (l

.u)

x (l.u)

Fig. 3.8 The top structure shows the orig-inal orthorhombic crystal and the bottomstructure the (110) twin. The open cir-cles represent the twin of a 18 x 10 x 1unit cell crystal which is large enough tocover the original crystal, outlined by theheavy lines.

For a graphical representation of the crystal structure, one will oftenwant to view the structure along a direction other than along one ofthe base vectors. Accordingly, a different boundary shape might bedesirable. In particular, it might be advantageous to cut off the crystalon a plane somewhere through the interior of the unit cell instead ofbeing fixed to whole unit cells. The available crystal plotting programsusually offer a wide range of flexibility with respect to the boundaryshape and size. While building up the crystal, each atom has to bechecked with respect to the condition that the atom is inside the crystal.This check is readily calculated. Let us assume a face normal to thevector h at a distance d from the origin. The Miller indices of this planeare calculated as 1

d · h

|h| = h′. A point u in real space is on the sameside of the plane as the origin if: |(1 − u · h′)| /h < 0. The value of thisexpression is readily calculated and serves to decide whether a givenatom will be included in the plot or not. Let us now expand a single unitcell into a crystal of 3 x 2 x 1 unit cells. Although we could construct amacro file in the same fashion as before, this would be cumbersome andprone to error. For most programs, including DISCUS , it is sufficient tospecify the asymmetric unit of a unit cell as shown here.

This file contains all the information a program needs to create thecontent of the unit cell from the asymmetric unit and the space groupinformation. Using this information, DISCUS can create the same crys-tal as above by the short macro shown here. The exact commands forother programs will vary, yet the intent will be the same: to create asimulated crystal from the asymmetric unit. If you intend to simulatea crystal in order to calculate the corresponding diffraction pattern, acrystal terminated with faces (100), (010) and (001) is usually a perfectsolution. This shape minimizes the effects of finite size on the diffrac-tion pattern. There are several situations in which you would want toshape the crystal with other boundary forms. When creating stackingfaults in low-symmetry structures, the different layer types might bemirror images of each other or a structure rotated by some angle.

The simulated crystal containing all these different layer types shouldmaintain a reasonably smooth boundary surface. Otherwise, it will bedifficult to interpret the calculated diffraction pattern correctly. Let usillustrate this with an example of an orthorhombic crystal with latticeconstants of 5, 8 and 10 Å. We simulate, e.g. a crystal of 10 x 10 x 1 unitcell and then create its mirror image by performing a mirror operationwith the (110) plane as mirror plane. The original crystal will have di-mensions of 50 x 80 Å in the ab-plane. The twin will have approximatedimensions of 80 x 50 Å and its boundary is at an angle to the boundaryof the original crystal, see Fig. 3.8. In order to create a crystal that con-sists of both layers yet has a rectangular shape of 50 x 80 Å, you must

Page 32: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.5 Unit cell transformations 21

simulate the twin large enough to cover this area and then cut off thoseatoms that are outside the intended boundary shape. The open circlesin Fig. 3.8 represent the twin of a 18 x 10 x 1 unit cell crystal which islarge enough to cover the original crystal. Another application wouldconcern the creation of a host crystal that contains domains of extendeddefects or another phase. Defects of this type are common and the ac-curate match of the domain to the host crystal is essential. The usualsimulation procedure would be to create a large perfectly ordered hostcrystal and then to remove all those atoms that lie within a domain andto fill this empty space with the new structure. During this processone does not want to keep empty volumes in the host crystal, nor is itmeaningful to have atoms sitting too close to each other. The simulatedcrystal is, after all, just a list of atom positions in some essentially ar-bitrary order in computer memory. It can be a time consuming task tocheck for large voids or for atoms that are too close to each other. Thebook-keeping is facilitated, if the domains are created with the fittingboundary shape and size to be inserted into the host crystal.

3.5 Unit cell transformations

bh

bo

ah = ao

Fig. 3.9 The figure shows the relationshipbetween a hexagonal and an orthorhom-bic unit cell. The orthorhombic b axis canbe expressed as ah + 2bh.

Unit cell transformations of simulated crystals will be useful or nec-essary in several circumstances. You may want to compare a crystalstructure that was created for one set of unit cell dimensions to anothercrystal structure reported with different unit cell dimensions. For anefficient comparison of corresponding bond lengths, bond angles andatomic coordinates it will be useful to transform the structure into anew set of coordinate systems. Another application would be the sim-ulation of crystal structures that consist of layers with different indi-vidual structures or the simulation of dissolutions. It will in generalbe easier to simulate crystals of appropriate size and shape for eachof the two or more different structures within their respective unit celldimensions and to transform one of the structures into the unit cell di-mensions of the other structure once the structures are merged. Last butnot least, for teaching purposes, it is often helpful and faster to sketcha model structure onto a sheet of millimeter paper and then to transformthis structure from the cartesian space into the appropriate unit cell di-mensions.

Unit cell dimensions of a simulated crystal do not change the loca-tion of atoms, i.e. the interatomic vectors remain invariant. All that onechanges is the description of atomic positions with respect to a newset of base vectors. A very good description of the mathematical algo-rithms for unit cell transformations is found in D.E. Sands [1] and theInternational Tables for Crystallography [4] Vol. A., and we will focus onthe computational aspects concerning simulated crystals.

Figure 3.9 shows the relationship between a hexagonal cell and one ofthe three choices for a corresponding orthorhombic unit cell. Both canequally well be used to describe the positions of the atoms and many

Page 33: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

22 Making computer crystals

phase transitions from the one to the other occur. The a and c axes ofboth systems are identical. The orthorhombic bo axis can be expressedas ah + 2bh and these relationships serve as the transformation matrixfrom the hexagonal base to the orthorhombic base. Let G be the matrixthat transforms the base vectors into the new vectors and a the columnmatrix whose elements are the base vectors ai:

a′ = Ga (3.6)

The corresponding transformation of the coordinates is then given by:

x′ = Fx + t (3.7)

where F is the transpose inverse matrix of G and t corresponds to theshift of the origin. The corresponding unit cell volumes are related by:

V ′ = |G|V (3.8)

Different conventions are used for these matrices. In the InternationalTables a is denoted as a 1 x 3 row matrix and the transformation of thebase vectors becomes:

a′ = aP (3.9)

where P is the transpose of G. You have to carefully check the programmanual to find out which notation is used! The main aspects concern-ing simulated crystals are the transformation of the symmetry elementsand the content and relative location of the new unit cell. Often it is nec-essary to create the content of a unit cell within the new base system.This unit cell can then be used to create a larger crystal. We will use the

0 0.5 1 1.5 2x (l.u.)

0

0.5

1

1.5

2

y (l.

u.)

Fig. 3.10 The solid line outlines thehexagonal cell, the dotted line the or-thorhombic cell.

example of Fig. 3.10 to illustrate these aspects. The thin lines outlinea hexagonal unit cell, while the thick lines outline a possible choice foran orthorhombic unit cell. The corresponding relationship between thebase vectors is:

a′ = 1 ∗ a + 0 ∗ b + 0 ∗ c

b′ = 1 ∗ a + 2 ∗ b + 0 ∗ c

c′ = 0 ∗ a + 0 ∗ b + 1 ∗ c

(3.10)

As can be readily calculated from the determinant of the transforma-tion matrix, the volume increases by a factor of 2. In order to provideall the atoms of the new unit cell, the original crystal must be createdlarge enough so that it includes the new unit cell. The necessary sizeis quickly calculated from the inverse transformation of equation 3.7.Input to these calculations are the eight corners of the new unit cell interms of the new base vectors, i.e. the vectors 1, 0, 0; 0, 1, 0, etc.

A real space symmetry operation is transformed by:

S′ = FSF−1 = FSG (3.11)

In most cases a change of the base system will create a set of basevectors that does not correspond well to the symmetry of the origi-nal crystal. In the last example, the change from a hexagonal to an

Page 34: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.5 Unit cell transformations 23

orthorhombic cell does not change the symmetry of the crystal, yet theorthorhombic cell does not reflect this symmetry well. Usually, how-ever, a corresponding phase transition of the real crystal is accompa-nied by a change of symmetry.

In addition to the transformation of the symmetry elements, a unitcell volume change will change the number of symmetry operations.The change corresponds to the determinant of the transformation ma-trix. If the volume of the unit cell doubles, twice as many symmetry op-erations are needed, while for a reduction to half a cell size, half of thesymmetry operations become obsolete. In the case of a volume increase,these new symmetry operations can be worked out from the behaviorof the primitive translations of the old base system. Independent ofthe volume ratio of the two unit cells, any of the base translations maybe transformed into a centering translation, while a centering transla-tion may be transformed into a primitive translation. We will use thetransformation from the hexagonal to the orthorhombic unit cell as anexample to illustrate these aspects. In the augmented 4 x 4 matrix form,the primitive translations are symmetry operations in the form:

⎛⎜⎜⎝

1 0 0 10 1 0 00 0 1 00 0 0 1

⎞⎟⎟⎠

⎛⎜⎜⎝

1 0 0 00 1 0 10 0 1 00 0 0 1

⎞⎟⎟⎠

⎛⎜⎜⎝

1 0 0 00 1 0 00 0 1 10 0 0 1

⎞⎟⎟⎠

a b c

(3.12)

The a and c translations will be transformed into primitive translations,while for the b translation the following relation holds:

⎛⎜⎜⎜⎜⎝

1 − 12 0 0

0 12 0 0

0 0 1 0

0 0 0 1

⎞⎟⎟⎟⎟⎠

⎛⎜⎜⎜⎜⎝

1 0 0 0

0 1 0 1

0 0 1 0

0 0 0 1

⎞⎟⎟⎟⎟⎠

⎛⎜⎜⎜⎜⎝

1 1 0 0

0 2 0 0

0 0 1 0

0 0 0 1

⎞⎟⎟⎟⎟⎠

=

⎛⎜⎜⎜⎜⎝

1 0 0 − 12

0 1 0 12

0 0 1 0

0 0 0 1

⎞⎟⎟⎟⎟⎠

(3.13)A translation along a can be added to this symmetry operation and

the C-centering of the orthorhombic cell results. In general, a primitivetranslation may transform into a non-crystallographic centering, like atripling of a unit cell along one axis. To be able to use the new sym-metry operation as generator, one has to determine how often the newsymmetry element has to be applied before a primitive translation ofthe new base system results.

Two tasks are commonly encountered with respect to unit cell trans-

Page 35: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

24 Making computer crystals

formations of simulated crystals: The first would be to transform theold asymmetric unit and space group information into a new cell andcorresponding space group. The second would be the transformationof an extended crystal into the new base system in order to merge twodifferent structures. The first task is solved by reading the asymmetricunit without expanding it into the full unit cell content. Each of thegenerators of the space group, including primitive and non-primitivetranslations, is transformed. The character of all translations must bechecked. Those non-primitive translations that transform into a primi-tive translation have to be omitted from the list of generators. The prim-itive translations that transform into non-primitive translations have tobe added, keeping in mind the multiplicity of this new generator. Thenew unit cell dimensions will provide the new primitive translations.The number of atoms in the asymmetric unit does not change, merelyeach atom position is transformed into the new base system. Since, inmost cases, the unit cell shape and the symmetry do not match, Her-mann Mauguin symbols are not suitable to describe the generators ofthe structure within the new base system. A designation as space groupP1 with an explicit list of generators will be appropriate. If a reduc-tion in symmetry accompanies the unit cell transformation, the pro-gram must apply the generator that is missing in the new base systemto all atoms in the asymmetric unit before omitting this generator. Thesecond task basically follows along the same lines. Since the crystal isto be modified as a whole or is inserted into a structure with possiblydifferent symmetry, its own symmetry is usually not relevant. The pro-gram will transform all atoms present into the new base system andwill not have to transform the symmetry operations, but assign spacegroup P1 as dummy space group.

3.6 General symmetry operations

Let us assume that you want to rotate the oxygen atoms of a SiO4

tetrahedron around one of the Si-O bonds. Or you want to create thetwinned structure of a triclinic crystal. The operations require the ap-plication of a symmetry element whose axis is not parallel to any ofthe base vectors and/or whose rotation angle is different from 60, 90,120, or 180◦. Needless to say, the resulting symmetry matrix will notcontain just one’s and zero’s. Strictly speaking, a symmetry operationrelates between two or more identical objects, while the moving of anobject from one place to another is a general affine transformation. Themathematical formalism for both is identical and we will continue touse the term "symmetry operation" for both types. In general a symme-try operation will be characterized by:

• orientation of the symmetry axis;• rotation angle ;A proper rotation is a pure rotation and

an improper rotation is rotation plus aninversion.

• proper or improper rotation;• translational components;

Page 36: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.6 General symmetry operations 25

• location of the symmetry element;

A general symmetry operation can be described by a 4 x 4 matrix of thefollowing form:

S =

⎛⎜⎜⎝

w11 w12 w13 t1w21 w22 w23 t2w31 w32 w33 t30 0 0 1

⎞⎟⎟⎠ (3.14)

Here the components wij define the rotation and ti the translationalpart of the symmetry operation. The translational part of the symmetryoperation includes the true translational parts like the glide componentof a glide plane or the translation along a screw axis as well as thoseparts that are caused by the location of the symmetry element. Thecomponents wij depend only on the choice of the base vectors, whilethe translational part also depends on the choice of the origin. Thematrix for a c glide plane in a monoclinic space group with unique baxis located at x, 0, z is:

c =

⎛⎜⎜⎝

1 0 0 00 −1 0 00 0 1 0.50 0 0 1

⎞⎟⎟⎠ (3.15)

If the glide plane is located at x, 1/4, z, as in space group P21/c, thecorresponding matrix is:

c =

⎛⎜⎜⎝

1 0 0 00 −1 0 0.50 0 1 0.50 0 0 1

⎞⎟⎟⎠ (3.16)

To develop a general symmetry operation about an arbitrary axis wewill first consider the matrix representation of a counterclockwise rota-tion around the z-axis in cartesian space:

Rz =

⎛⎜⎜⎝

cos θ − sin θ 0 0sin θ cos θ 0 0

0 0 1 00 0 0 1

⎞⎟⎟⎠ (3.17)

To determine the matrix of this rotation about an arbitrary axis u in acrystal we have to transform the cartesian space into the base systemof the crystal. We define the cartesian space such that the unit vectoru corresponds to the z-axis and s and t form orthonormal vectors cor-responding to the x- and y-axis. The choice of the vectors s and t isarbitrary except that they must be orthonormal to u. It follows that:

e1 = s1 ∗ a + s2 ∗ b + s3 ∗ c

e2 = t1 ∗ a + t2 ∗ b + t3 ∗ c

e3 = u1 ∗ a + u2 ∗ b + u3 ∗ c

(3.18)

Page 37: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

26 Making computer crystals

or in short matrix notation:

e = aP; a = eQ (3.19)

Here P is the matrix whose rows consist of the components of the unitvectors s, t and u and Q = P−1. As detailed in the previous section, thesymmetry operation Rz is transformed into the corresponding symme-try operation in crystal space by:

0.50x (l.u)

0

0.5

0

0.5

y (l

.u)

y (l

.u)

Fig. 3.11 Example of a symmetry opera-tion of a H2O molecule. The dark graymolecule in the bottom panel is the trans-formed molecule.

R = PRzQ (3.20)

Instead of defining the auxiliary vectors s and t, equation 3.20 can besolved analytically to yield:

Rij = uihj + (δij − uihj) cos θ + gikεkljul sin θ (3.21)

Here ui are the components of the unit vector u, hi the componentsof u with respect to the reciprocal lattice vectors, δij is the Kroneckersymbol, gik are the components of the reciprocal metric tensor and εklj

are the components of the epsilon tensor. For a full definition of thesetensors and a detailed discussion of the relationships between real andreciprocal vectors see Sands [1]. To obtain the components of an im-proper rotation matrix, i.e. the combination of a rotation with a centerof inversion, the elements of R have to be multiplied by −1. The use ofgeneralized symmetry operations will be illustrated by the followingexample. The top panel of Fig. 3.11 shows a unit cell containing fourH2O molecules. The molecule in the lower left corner (molecule 1) isto be rotated by 30◦ around a symmetry axis parallel to the z-direction(normal to the drawing plane) through the origin of the molecule, herethe oxygen atom. Furthermore the molecule in its new orientation is tobe a new molecule type and replace the original molecule. The resultis seen in Fig. 3.11 on the bottom. Note that the rotated molecule isplotted in dark gray, indicating the new type. The DISCUS macro fileused to perform this symmetry operation is listed here. Again the lineFile: sim/simul.7.mac

1 symm2 #3 uvw 0,0,14 angl 30.05 orig 0,0,0,mol6 trans 0,0,07 type proper8 power 1,single9 mode repl,new

10 #11 msel 112 minc 1,113 #14 run15 exit

numbers are only included for better reference and are not part of theactual macro file. Furthermore, the parts reading and generating thestarting crystal are omitted. After entering the symm level of DISCUS(line 1), the direction of the symmetry axis is set parallel to the z-axis(line 3). Next the rotation angle (line 4), the origin for the symmetry op-eration (lines 5) and the translation part (line 6) are set. The additionalparameter mol in line 5 specifies the origin relative to the origin of themolecule rather than that of the crystal. Since we only want to operatethe 30◦ rotation once, the power is set to one (line 8). Replacing theoriginal molecule and creating a new type is selected in line 9. Finallywe select molecule type 1 (line 11) and include only molecule number1 (line 12) before the symmetry operation is executed (line 14).

The symmetry matrices wij found in crystals describe either pure ro-tations or mirror operations. An even more general operation includesdistortions of space. These strain operations are not useful as symme-try operations, yet can be used to describe deformations of a crystal

Page 38: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.7 Creating molecules 27

structure, as for example during anisotropic thermal expansion, a dis-tortion from a cubic to a tetragonal cell, or a local deformation of a co-ordination polyhedron. In the most general form, the strain may varythroughout the crystal and may include twisting and bending of thecrystal. In most discussions of strain the crystal as a whole undergoesthe deformation. In the limit of small distortions the atom coordinateswith respect to the base vectors do not change and an atom at say [100]in the undeformed base a, b, c remains at [100] in the deformed basea’, b’, c’ [1, 10]. The effect of such a deformation on a simulated crystalis best described by the corresponding change of the lattice constants.The resulting changes of the diffraction pattern and bond lengths, etc.are readily calculated using the new metric.

3.7 Creating molecules

In the previous chapter, we were demonstrating the use of symmetryoperations on water molecules. Now we want to take a closer lookhow DISCUS handles molecules. Although molecules will not be partof later examples, please note that most commands such as selectingatoms have a similar counterpart to select molecules and all the laterexamples can be modified straightforwardly to operate on moleculesrather than atoms. Basically molecules are a collection of atoms andthe keyword molecule is used in the structure file to group the atoms.This keyword is allowed anywhere between the atoms of the unit cellfile. It marks the beginning of a group of atoms that are grouped toform a molecule. The individual atoms are listed in the usual way. Thekeyword molecule end signals the end of a molecule. All atoms stilllisted in the unit cell file are treated as individual atoms. The moleculerelated keywords are listed in Table 3.4. The internal symmetry of themolecule can be specified using the generator and symmetry sub-keywords. The generators are internal symmetry operations of themolecule. DISCUS compares the lists of atoms created by the spacegroup and by the molecule generators. Identical sections are linkedto one molecule. Atoms created by other symmetry operations, e.g. lat-

Table 3.4 List of keywords related to molecules.

Keyword Description

molecule Defines the start of a molecule.molecule atoms Lists atom numbers belonging to molecule.molecule content Defines the start of particular molecule type.molecule generator Defines generators for the internal symmetry.molecule symmetry Defines internal symmetry operations.molecule end Defines the end of a molecule atom list.

Page 39: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

28 Making computer crystals

tice centering, will form a new molecule of the same type. The genera-tors of the molecule symmetry should be the generators that create thesite symmetry. As in the previous section, symmetry operations willonly act on the original atoms of the molecule whereas generators willoperate on previously generated copies of atoms as well. The follow-ing example is the structure file used earlier. It contains a water (H2O)molecule in a structure with the space group Cmm2. The first four linesof this example file are similar to the previous example and define title,space group and lattice constants. In the atoms section, however, oneFile: sim/simul.2.cll

1 title Water in Cmm22 spcgr Cmm23 cell 10.0,10.0,10.0, 90.0,90.0,90.04 atoms5 molecule6 molecule gene, -1,0,0,0, 0,1,0,0, 0,0,1,07 O 0.00 0.20 0.00 0.18 H 0.13 0.17 0.00 0.29 molecule end

oxygen and one hydrogen atom define the water molecule between themolecule and molecule end keywords. The second hydrogen atomfor the H2O molecule is generated by a yz-mirror plane defined by thegene sub-keyword. The mirror plane goes through the origin of themolecule which is defined as the first atom in the molecule list, hereoxygen. The coordinates of the four created H2O molecules per unitcell in the given space group Cmm2 are shown below.

Molecule Number: 1 Type: 1Name Number x y z BO(1) 1 .000000 .200000 .000000 .100000H(2) 5 .130000 .170000 .000000 .200000H(2) 11 -.130000 .170000 .000000 .200000

Molecule Number: 2 Type: 1Name Number x y z BO(1) 2 .500000 .700000 .000000 .100000H(2) 6 .630000 .670000 .000000 .200000H(2) 12 .370000 .670000 .000000 .200000

Molecule Number: 3 Type: 1Name Number x y z BO(1) 3 .000000 .800000 .000000 .100000H(2) 7 -.130000 .830000 .000000 .200000H(2) 9 .130000 .830000 .000000 .200000

Molecule Number: 4 Type: 1Name Number x y z BO(1) 4 .500000 .300000 .000000 .100000H(2) 8 .370000 .330000 .000000 .200000H(2) 10 .630000 .330000 .000000 .200000

There is one important restriction to how molecules are defined in DIS-CUS : The first atom of any molecule defines the origin of the moleculeused by various subsequent commands. In case the origin lies on asymmetry element of the space group it must be located at the pointof highest symmetry of the molecule. If the structure does not havean atom at this site you must include a vacancy or void on this site.This could be the case, e.g. if you have an empty triangle on a three-fold axis. More details about defining molecules can be found in theDISCUS Users Guide.

3.8 Example: Distorted perovskite

In this section the simulation techniques will be applied to an extendedexample. We will simulate the high-temperature cubic perovskite struc-

Page 40: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.8 Example: Distorted perovskite 29

ture (Fig. 3.12) and will then modify this structure into a tetragonalmodification by rotating the TiO6 octahedra around [001]. The cell pa-rameters of the high-temperature modification are listed in Table 3.5and the structure is easily simulated using the short DISCUS macro:

Fig. 3.12 Pseudo 3D-plot of the per-ovskite structure. The central large atomrepresents the strontium atom, the smallatoms at the corners of the octahedronrepresent the oxygen atom. Titanium isat the center of the octahedron.

File: sim/simul.8.mac

1 read2 cell perow.cell,8,8,8

which reads the structure file and expands it to a crystal of 8 x 8 x 8 unitcells, part of which is plotted in the top left panel of Fig. 3.8. The phasetransition from the cubic to the tetragonal modification involves a ro-tation of the TiO6 octahedra around one of the 〈100〉 axes. Nucleationof this transition can start with equal probability for any of the threeaxes and the resulting crystal is usually twinned. In this example wewill rotate the octahedra around [001]. The rotation does not involvea significant change in Ti-O bond length. To maintain the connectiv-ity adjacent octahedra have to be rotated in opposite senses. Along thec-axis we have the freedom to retain the periodicity or to add a modifi-cation. In this example we will rotate all octahedra along the c-axis inthe same direction. We will start by rotating only the TiO6 octahedronlocated at 0, 0, 0. The symmetry operation is characterized by the sym-metry axis parallel to [001] through the Ti atom at 0, 0, 0 and a rotationangle of say 12◦. The symmetry operation has to move the atoms ratherthan create copies of the original atoms. The first task is to locate the sixO atoms bonded to Ti in the structure array. A look at the position of thefirst five atoms or at the listing of the International Tables shows that theatoms are stored within each unit cell in the sequence Sr, Ti, O(1), O(2)and O(3) as shown in Table 3.6. The unit cells are stored sequentially

Table 3.5 Structural parameters of per-ovskite.

Space group Pm3ma0 3.80 ÅSr 0.50 0.50 0.50Ti 0.00 0.00 0.00O 0.50 0.00 0.00

within nested loops over x, y, and z with the loop over x the innermostquickest loop. The crystal is shaped as a block of Nx, Ny , Nz unit cells.The unit cell number of the unit cell located at Δx, Δy , Δz unit cellsrelative to the first unit cell is calculated as: ΔzNxNy + ΔyNx + 1. Theeight unit cells sharing a common corner at 0, 0, 0 are 220, 221, 228, 229,284, 285, 292, and 293. Of these unit cells, the unit cell at 0, 0, 0 con-tributes three oxygens, i.e. all its oxygen atoms, to the octahedron. Theunit cells at 1, 0, 0, 0,1,0, and 0, 0,1, i.e. numbers 229, 285, 292, and 293each contribute one oxygen atom, the third, second and first oxygenatom within each of these three unit cells respectively. Since there are

Table 3.6 List of atoms withineach unit cell.

Name x y z

SR 0.50 0.50 0.50TI 0.00 0.00 0.00O(1) 0.50 0.00 0.00O(2) 0.00 0.50 0.00O(3) 0.00 0.00 0.50

five atoms per unit cell the numbers of the six oxygen atoms bondedto Ti(0, 0, 0) are calculated as: (Number of the unit cell) x (Number ofatoms per unit cell) + (index within the unit cell), which leads to atomnumbers: 1145, 1424, 1458, 1463, 1464, and 1465. The symmetry oper-ation must rotate these atoms. This search for the atom numbers mustbe executed for each of the octahedron we plan to rotate. The surfacesof the crystal require special attention, since they will have truncatedoctahedra. Since this search would be tedious, DISCUS has a built-infunction that will locate the environment around a given position andthe DISCUS macro needed to rotate this octahedron is shown here. The

Page 41: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

30 Making computer crystals

first line finds the environment consisting of O atoms within a radiusof 2.0 Å around (0, 0, 0). Lines 4 through 9 define the symmetry axis as[001], the rotation angle of 10◦, the translational part of 0, 0, 0, the originof the symmetry element at (0, 0, 0) and a single application by settingthe power to 1. The symmetry operation replaces the coordinates ofthe original atoms in effect moving the atoms. Only O atoms are se-File: sim/simul.9.mac

1 find env, O, 0,0,0, 0.0,2.02 #3 symm4 uvw 0,0,15 type proper6 angl 107 trans 0,0,08 origin 0,0,09 power 1.

10 mode repl11 sel o12 incl env13 run14 exit

lected (lines 11, 12) that lie within the environment found in line 1. Thetop right panel of Fig. 3.8 shows that as a result of the rotation the bondlength between the displaced oxygen atoms and the neighboring Ti andO atoms have changed. To compensate for the shift of the O from (0.5,0, 0) to (0.5cosα, 0, 0) the Ti atom at 1, 0, 0 must be shifted to (1 − cosα,0, 0)! In a physical crystal the interatomic forces will cause this shift.Since our simulated crystal is just a lot of atom positions stored in com-puter memory without knowledge of the interatomic forces we mustexplicitly move the atom ourselves. By rotating the octahedron at (0,0, 0) clockwise, we have already displaced the shared oxygen atoms ofthe neighboring octahedra in a counterclockwise fashion with respectto their center. It is sufficient to rotate all those octahedra marked with aclockwise arrow. These octahedra form a C-centered lattice and, due tothe sequential storage of the 8 x 8 x 8 unit cells, we can simply loop overall unit cells with an increment of 2. If, however, our crystal size were 9x 8 x 8 unit cells, both the ninth and tenth unit cell must be omitted andit makes more sense to use nested loops over the each of the x, y andz directions that rotate only the C-centered octahedra. Within each xy-plane you can run two loops as shown here. Variables i[1] and i[2]File: sim/simul.10.mac

1 do i[1]=-4,4,22 do i[2]=-4,4,23 ...4 enddo5 enddo6 do i[1]=-5,3,27 do i[2]=-5,3,28 ...9 enddo

10 enddo

give the x and y coordinates of the unit cell corner, respectively. Alter-natively the two loops could be combined and the macro changes to theone shown next. The loop over x (variable i[1]) runs with increment1, while the y-loop retains the increment 2. The y-coordinate is shiftedby −1 for odd x values. At each unit cell we find the environment ofoxygen atoms and apply the rotation yielding the structure displayedon the bottom right in Fig. 3.8. All octahedra have been rotated andas a consequence all bonds between the octahedra are temporarily bro-ken. The O at 0.5, 0, 0 is shifted to 0.5cosα, 0.5sinα, 0. We will keepFile: sim/simul.11.mac

1 do i[1]=-4,42 do i[3]=-4,4,23 i[2]=i[3]-mod(abs(i[3]),2)4 ...5 enddo6 enddo

the octahedron at 0, 0, 0 fixed and adjust the positions of the other toadapt the bond length. To achieve the original bond length to the Ti at1, 0, 0 this Ti must be shifted by 1− cosα, 0, 0, while the Ti at 2, 0, 0 andthe neighboring O atoms must be shifted by 2 − 2 cosα, 0, 0. The shiftof an octahedron at x, y, z is calculated as: x(1 − cosα), y(1 − cosα), 0.Once this shift is applied to all octahedra and to all other Ti atoms andto the Sr atoms, the original bond lengths between octahedra result asshown in Fig. 3.8. The resulting structure is a C-centered cell with dou-bled a and b lattice constants or respectively a primitive cell rotated 45◦

with a, b lattice constants multiplied by√

1/2. The symmetry is low-ered from Pm3m to P4/m. Instead of considering the rotation of theoctahedra, the O atoms could equally well have been shifted normal tothe Ti-Ti vector by 0.5 tanα.

Page 42: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

3.8 Example: Distorted perovskite 31

Perovskite Single octahedra tilted

All octahedra tilted Tilted octahedra shif ted

Fig. 3.13 Top left: The plot shows the xy0 layer of the perovskite structure. The circles at0, 0, 0 represent titanium, the squares at 0.5, 0, 0 the oxygens. As a visual aid the Ti-O andO-O bonds have been added. Top right: The octahedron at 0,0,0 has been rotated by 10◦.Note that the bond lengths between the moved oxygen atoms and the neighboring Ti andO have changed. Bottom left: all octahedra have been rotated by 10◦. Bottom right: finalstructure of the perovskite structure. All octahedra have been shifted towards 0, 0, 0.

Several alternative ways exist to create the final crystal. The easiestwould be to drop the symmetry to P4/m, which requires the oxygen at(0, 0, 0.5) to be explicitly listed in the asymmetric unit and to shift theO from (0.5, 0, 0), transform the asymmetric unit to the 45◦ unit cell,adjust the lattice constants a and b by (1 − cosα) and then to simulatea crystal. If we want to keep the direction of the original base vectors,we would keep the space group as P4/m, yet introduce an additionalC-centering generator and double the a and b lattice constants. Thesetwo alternatives would create a perfect crystal of the low-temperaturephase. The purpose of many crystal simulations is, however, the cre-ation of a crystal with defects. If you want to introduce small domains

Page 43: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

32 Making computer crystals

of low-temperature perovskite into a high-temperature host crystal youhave to explicitly modify the crystal as outlined in the example.

3.9 Bibliography

[1] D.E. Sands, Vectors and Tensors in Crystallography, Dover Publica-tions, Dover, 1995.

[2] K. Hradil, E. Weidner, R.B. Neder, B. Grushko, F. Frey, Disorder indecagonal Al-Ni-Co investigated by X-ray diffraction and molec-ular simulations, Extended Abstracts of the Workshop on AperiodicStructures, Krakow, Poland , 136 (1996).

[3] T. Janssen, Crystallography of quasi-crystals, Acta. Cryst. A42, 261(1986).

[4] A.J.C. Wilson, U. Shmuelli, T. Hahn, International Tables for Crystal-lography, Dordrecht, Holland, 1983.

[5] G. M. Sheldrick, SHELX-97, Crystal Structure Refinement Program,Universität Göttingen, 1997.

[6] H. Burzlaff, H. Zimmermann, On the choice of origins in the de-scription of space groups, Z. Krist. 153, 151 (1980).

[7] S.R. Hall, Space-group notation with explicit origin, Acta Cryst.A37, 517 (1981).

[8] R.W. Grosse-Kunstleve, Algorithm for deriving crystallographicspace-group information, Acta Cryst. A35, 383 (1999).

[9] S.R. Hall, R.W. Grosse-Kunstleve, International Tables for Crystallog-raphy, volume B, chapter 1, IUCr/Kluwer Academic Publishers,1999.

[10] J.F. Nye, Physical Properties of Crystals, Oxford University Press,Oxford, 1979.

[11] D.R. Peacor, High-temperature single-crystal study of the cristo-balite inversion, Z. Krist. 138, 274 (1973).

Page 44: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Exercises 33

Exercises(3.1) Simulate a linear row of CO2 molecules within

cartesian space. The molecules should be spaced3 Å apart along the x-axis and the vector from thecarbon atom to the oxygen atoms should be ± (0.9,1.1, 0.0).

(3.2) Simulate a set of atoms in cartesian space. Theatoms should be equally spaced along the x-axisand the y-coordinate follow a sine wave.

(3.3) Simulate a crystal in space group P2/c. The asym-metric unit contains atoms at: C 0, 0, 0; O 0.23, 0.56,0.27. The lattice constants are a = 7.0, b = 3.5, c =12.0, β = 105. The crystal should consist of 3 x 2 x 4unit cells.

(3.4) Simulate the CaF2 structure. Create a crystal lim-ited to 0 ≤ x, y, z < 1 and a crystal limited to0 ≤ x, y, z ≤ 1. Determine the respective compo-sition and symmetry.

(3.5) Transform the content and symmetry generatorsof the low-temperature cristobalite structure fromspace group P41212 into a C-centered cell, whichcorresponds to the F-centered cell of the high-temperature form of cristobalite (Fd3m). The unitcell of the C cell is obtained from the P cell by:a′ = a + b; b′ = −a + b; c′ = c and the shiftp = 1/4a + 1/4b.

The lattice constants of the low-temperature cristo-balite at T = 230◦ are given by Peacor [11]: a =4.998 Å, c = 7.024 Å, and the atoms in the low sym-metry structure are located at:

• Si 4a x, x, 0 with x = 0.2943

• O 8b x, y, z with x = 0.2403, y = 0.0933, z =0.1731.

(3.6) Create the olivine structure. Rotate each of the SiO4

tetrahedra clockwise by 3◦ around the Si-O(2) bond.The lattice constants and atom parameters are:Space group Pbnm (62), a = 4.818 Å, b = 10.470 Å,c = 6.086 Å

Fe(1) 4a 0.00 0.00 0.00Fe(2) 4c 0.9851 0.2803 0.25Si 4c 0.4292 0.0973 0.25O(1) 4c 0.768 0.0907 0.25O(2) 4c 0.2921 -0.0449 0.25O(3) 8d 0.289 0.165 0.0403

(3.7) Generate a model crystal for ZrO2-CaO which has adoping concentration of 15 atom% CaO. The struc-tural parameters for this cubic stabilized phase are:Spacegroup Fm3m, a = 5.14 Å and Zr is on 0, 0,0 and O is on 1/4, 1/4, 1/4. Use DISCUS to createa model crystal of 10 x 10 x 10 unit cells with thecorrect overall stoichiometry.

Page 45: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 46: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Simulating experimentaldata 4Once a representation of a structure has been created using DISCUS oranother program, the next step is to calculate the observed experimen-tal quantity. In this chapter we will discuss the calculation of scatter-ing intensities for single crystals, the calculation of a powder diffrac-tion pattern as well as the calculation of the atomic pair distributionfunction (PDF) from a given structure. In Chapter 11 we will go a stepbeyond the simple calculation, and explore ways to refine the atomicstructure based on experimental data.

4.1 Single-crystal scattering

Given a list of atom coordinates and atom types, DISCUS basically cal-culates the structure factor for neutron or X-ray scattering according tothe standard formula for kinematic scattering given in equation 4.1.

F (h) =

N∑i=1

fi(h)e2πihri (4.1)

Note that the sum goes over all N atoms in the model crystal, not onlyover the atoms in a unit cell. This is obviously necessary, if the contentof different unit cells is not the same, e.g. in the case of disorder. Inthe above equation, fi is the atomic form factor in the case of X-rayscattering or the scattering length in the case of neutron scattering. Thefractional coordinate of the atom is given by ri. This sum then needsto be calculated for each point h in reciprocal space within the plane orvolume of interest.

At this point we want to briefly discuss the units used in DISCUS. Aswe have seen in the previous chapters, the real space coordinates usedare fractional coordinates or lattice units (l.u.) and the lattice param-eters define the corresponding metric. In reciprocal space, we use socalled reciprocal lattice units (r.l.u.) which similarly specify points inunits of reciprocal lattice parameters, a∗, b∗ and c∗. We refer to them ash, k and l. The advantage of this coordinate choice is the fact that Braggpeaks appear at integer values, as we will see later on.

Once the structure factor, F (h) is calculated, the scattering intensityis simply computed as I(h) = F (h)F ∗(h). Note that F (h) is a complexquantity and apart from the intensity, DISCUS also allows one to save

35

Page 47: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

36 Simulating experimental data

the amplitude and phase of the structure factor for, e.g. visualization.DISCUS actually calculates the explicit Fourier transform according to

0 1 2 30

1

2

3

5×10

51.

5×10

62×

106

2.5×

106

3×10

6

Inte

nsity

106

[h 0]

[0 k

]

Fig. 4.1 Plain intensities.

File: expt/expt.1.mac1 four2 xray3 wvle moa14 ll 0.0,0.0,0.05 lr 4.0,0.0,0.06 ul 0.0,4.0,0.07 na 1818 no 1819 run

10 exit11 @output plain.scat

equation 4.1. This has several advantages over the use of a Fast-Fourier-Transform (FFT) in terms of required memory for a suitable resolutionin atom positions and representation of the scattering density for X-rays. A more detailed discussion can be found in [1]. The realization ofthe actual code to calculate the Fourier transform is based on the pro-gram DIFFUSE [2]. By limiting the calculation to an equidistant gridand splitting the calculation into sums over equal atom types, the com-puting time required dropped by a factor of 4 to 6 (depending on thecompiler and hardware) compared to calculating the explicit sum givenin equation 4.1. More details about the algorithm used can be found [2].However, basically it is still the simple Fourier transform that is calcu-lated. An example is shown in Fig. 4.1 along with the macro used forthe calculation. In this example we have created a simple disorderedstructure consisting of 50 x 50 unit cells showing short range order (fordetails see Chapter 5). Once the structure has been created or read froma file, we are ready to calculate the scattering intensities. After enteringthe Fourier segment of DISCUS (line 1), MoKα radiation is selected inlines 2 and 3. Next the lower left, lower right and upper left corner ofthe desired plane in reciprocal space are specified (lines 4–6). The val-ues are given in reciprocal lattice units as discussed earlier. Next, thenumber of grid points in both directions is set in lines 7 and 8. Afterthe Fourier transform is calculated (line 9), the scattering intensities arewritten to the file using the macro file output.mac. Details about sav-ing intensities can be found in the DISCUS Users Guide. The resultingscattering pattern is shown in Fig. 4.1. We can easily see the diffusescattering and the Bragg peak at (11). We also see a set of "dotted lines"intersecting the Bragg positions. These are due to the finite size of themodel crystal of 50 x 50 unit cells. How to deal with the finite sizeeffects is discussed in the next section.

4.1.1 Finite size effects

As we have seen in the previous section, the finite size of the modelcrystal leads to unwanted contributions in the calculated diffractionpattern. One can easily verify that these contributions are strongest forsmall crystals. Even with powerful computers, the simulated crystalswill generally be small compared to the crystal size used in a scatteringexperiment. One exception is the case of nanomaterials (see Chapter 9).

The simplest way to avoid finite size effects is to choose the correctgrid in reciprocal space. The scattering density, ρ(r) , of the simulatedWe limit this derivation to the one-

dimensional case for simplicity. It can beextended to three dimensions straightfor-wardly.

crystal and its Fourier transform can be written as

ρ(r) = ρ∞(r) · box(r) (4.2)F (h) = F∞(h) BOX(h) (4.3)

Here ρ∞ is the density of the infinite crystal and box(r) is the shapefunction of the simulated crystal. Its value is one for coordinates in-

Page 48: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.1 Single-crystal scattering 37

side the model crystal and zero for values outside. Following the con-volution theorem (equation 4.17), the structure factor turns out to bethe structure factor of the infinite crystal, F∞(r) convoluted with theFourier transform of the shape function, BOX(h). Let us assume now

–0.2 –0.1 0 0.1 0.2

h (r.l.u)

–10

0

10

20

30

40

50

BO

X(h

)

Grid = 0.025 r.l.u. Grid = 0.020 r.l.u.

Fig. 4.2 Values of BOX(h) for differentgrid sizes.

0 1 2 3[h 0]

0

1

2

3

[0 k

]

5×10

51.

5×10

62×

106

2.5×

106

3×10

6

Inte

nsity

106

Fig. 4.3 Intensities calculated on 1/Ngrid.

File: expt/expt.2.mac1 four2 xray3 wvle moa14 ll 0.0,0.0,0.05 lr 4.0,0.0,0.06 ul 0.0,4.0,0.07 na 2018 no 2019 run

10 exit11 @output period.scat

that crystal is limited by a box of the length a in one dimension. Thusthe Fourier transform BOX (h) of the box function is given by:

BOX(h) =sin(πah)

πh(4.4)

Here the function BOX(h) is zero for all points where a · h is integer.This condition is fulfilled for all points, which are on a grid given by

h =h′

Nwith h′ ∈ integer numbers (4.5)

If the scattering is calculated only at points in reciprocal space, forwhich Δh = 1/N with N the dimension of the model crystal in thecorresponding direction, the contribution of the finite model size van-ishes, and the calculated intensity is free of finite size effect contribu-tions. This is illustrated in Fig. 4.2 showing the function BOX(h) forour example. On the left the dashed lines mark the grid of Δh = 0.025used in the previous section. The finite size contributions are not zero.If, on the other hand, we choose a grid of Δh = 1/50 = 0.02 whichmatches the size of the model crystal of 50 unit cells, we only evaluatepoints where the contribution of BOX(h) vanishes (except for h = 0 orcourse). This concept is sometimes called a supercell, thinking of thecomplete crystal as a super unit cell and calculating the Fourier trans-form only for Bragg positions, which are free of finite size effect contri-butions. The scattering intensity of the previous example calculated onthe matching grid is shown in Fig. 4.3 and no finite size contributionscan be observed. The corresponding DISCUS macro file is shown belowthe figure. The only change is in lines 7 and 8, setting the number ofpoints to 201 which corresponds to a grid of Δh = 4.0/(201−1) = 0.02.This straightforward calculation applies only to crystals limited by ablock of unit cells. If the crystal is limited by, for example, a sphere,periodic boundaries cannot be defined.

In some cases, however, the above method might be too restrictivewith respect to the shape and size of the model crystal and there is analternate method to remove not only finite size effects but also the av-erage structure factor 〈F 〉. In this case it is helpful to split the scatteringdensity into its periodic average part ρ0 and deviations from the aver-age, Δρ:

ρ(r) = ρ∞(r) · box(r)

=

[Δρ(r) + ρ0(r)

∞∑i=−∞

δ(r − Ri)

]· box(r) (4.6)

Here ρ(r) as before is the scattering density of the real crystal, ρ∞(r) isthe scattering density of the infinite crystal and box(r) is the function

Page 49: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

38 Simulating experimental data

limiting the crystal. If an average structure of the crystal can sensiblybe defined, ρ∞(r) can be separated into the average scattering densityρ0(r) convoluted with the real space lattice and the deviation from thataverage scattering density Δρ(r). The Fourier transform of the scatter-

5×10

51.

5×10

62×

106

2.5×

106

3×10

63.

5×10

64×

106

Inte

nsity

106

0 1 2 3[h 0]

[0 k

]

0

1

2

3

Fig. 4.4 Intensities with 〈F 〉 subtracted.

File: expt/expt.3.mac1 four2 xray3 wvle moa14 ll 0.0,0.0,0.05 lr 4.0,0.0,0.06 ul 0.0,4.0,0.07 na 1818 no 1819 set aver,50.0

10 run11 exit12 @output aver.scat

ing density given in equation 4.4 is then:

F (h) = ΔF (h) BOX(h) + (F0(h) · G∗) BOX(h) (4.7)

Here F0 is the Fourier transform of the average unit cell and G∗ is thereciprocal lattice. BOX(h) is the Fourier transform of the crystal limit-ing function box(r). Even for a size of a few unit cells, the convolutionof the defect scattering ΔF (h) with the BOX(h) can be neglected inmost cases. Since the main scope of DISCUS is the calculation of dif-fuse scattering, a reasonable way to separate the subsidiary maximaof the Bragg reflections from the defect scattering is simply to subtractthe scattering of the average structure from the scattering of the wholecrystal. The average structure factor 〈F 〉 = (F0(h) · G∗) BOX(h) canbe calculated from a user defined fraction of the crystal and subtractedfrom the calculated Fourier transform. This is shown in Fig. 4.4. Notethat the grid size is the same as in the very first example. The commandin line 9 causes 〈F 〉 to be calculated from 50% of the crystal volume. Es-pecially for large crystals this value might be reduced in order to savecomputing time. The Fourier transform is recalculated (line 11) and theoutput written to the file aver.scat. As can be seen from inspecting Fig.4.4, no finite size contributions are visible. As we have discussed above,finite size contributions from non Bragg intensities are neglected. Thisis a good approximation for broad diffuse intensity features. However,this procedure will fail for defects that are well ordered and thus pro-duce sharp satellites and the convolution of the defect scattering withBOX(h) can no longer be neglected. The resulting satellites will showsubsidiary maxima. The Fourier transform for a perfect crystal is zeroat the positions of the satellites, and therefore no intensity will be sub-tracted at the position of the subsidiary maxima near satellites.

4.1.2 Coherence

In a diffraction experiment only atoms within the lateral and transversecoherence of the incident radiation will scatter coherently. Averagingover space and time gives incoherent scattering by adding the inten-sities. However, when calculating the Fourier transform according toequation 4.1, all atoms are treated as if they scatter coherently. Eventhough there might be no structural coherence between different partsof the crystal, the calculation nevertheless adds the amplitudes of allwaves. For large crystals this may lead to unexpected high-frequencyoscillations severely modulating the diffuse scattering. Small crystalsizes, however, might give only a statistically poor description of theparticular disorder model.

A tentative explanation for these oscillations is given here. The con-tribution to the scattering amplitude Fij(h) for two atoms at ri and

Page 50: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.2 Powder diffraction 39

ri + R can be written as:

Fij(h) = fi(h)e2πihri + fj(h)e2πihri+R

= fi(h)e2πihri

(1 +

fi(h)

fj(h)· e2πihR

)(4.8)

3×10

52×

105

4×10

55×

105

6×10

57×

105

Inte

nsity

105

0 1 2 3[h 0]

[0 k

]

0

1

2

3

Fig. 4.5 Intensities calculated using aver-aging.

File: expt/expt.4.mac1 four2 xray3 wvle moa14 ll 0.0,0.0,0.05 lr 4.0,0.0,0.06 ul 0.0,4.0,0.07 na 1818 no 1819 set aver,50.0

10 lots eli,10,10,1,100,y11 run12 exit13 @output lots.scat

The term e2πihR = cos(2πhR) + i sin(2πhR) represents the discussedoscillation as a function of the vector R. For R � crystal dimension,a large number of different atoms will be separated by R or vectors ofvery similar length. Their contribution will give a good approximationof the expected value of an infinite crystal. If the length of R becomescomparable to the dimension of the crystal dimension, only few atomswill be separated by R and their contribution to the scattering might befar from the expected average of an infinite crystal. Obviously these ar-guments are independent from the actual size of the model crystal, butfor large crystals the above contribution represents a high-frequencywave more severely modulating the observed scattering.

In order to be able to calculate smooth diffraction patterns, DISCUSoffers an option (lots) to calculate the scattering intensities as the av-erage of intensities calculated from small randomly chosen volumes(lots) within the crystal. It should be noted, that using lots will giveonly intensities and it is not possible to save structure amplitudes orphases as would otherwise be possible, if the lots option is switchedoff. It is important to make sure that the selected number of lots is suf-ficiently large to cover the complete model crystal. Furthermore thesize of the lots must be large enough to include all significant neighborinteractions for the given defect structure.

Finally the diffuse intensity is calculated using the lot option, i.e. theintensity from small crystal volumes chosen at random is averaged.Here those volumes are set to be ellipsoids with a size of 10 x 10 x 1unit cells. A total of 100 lots is averaged (line 10). The Fourier trans-form is recalculated (line 11) and the output written to the file lots.scat.Inspection of the resulting diffraction pattern (Fig. 4.5) reveals a muchsmoother picture of the significant diffuse scattering features.

4.2 Powder diffraction

In many cases a single-crystal experiment might not be possible, andpowder diffraction data are used to characterize disordered materials.In the literature the term total scattering is often used, referring to theanalysis of all diffraction data, Bragg and diffuse scattering. Two dif-ferent approaches are used: First the modeling of the scattering data inreciprocal space as we discuss in this section. DISCUS provides two dif-ferent ways to calculate the powder diffraction pattern. These will bediscussed in the remaining two parts of this section. The second, alter-native approach to analyst total scattering data is to model the atomicpair distribution function (PDF) which can be obtained from the total

Page 51: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

40 Simulating experimental data

scattering pattern. Obtaining a PDF experimentally and calculating aPDF from a structural model is the subject of Section 4.3.

4.2.1 Complete integration

706050403020107

108

109

1010

107

108

109

1010

1011

Inte

nsity

(ar

b. u

nits

)In

tens

ity (

arb.

uni

ts)

2Θ (degrees)

Fig. 4.6 Top panel: calculated powderpattern from disordered structure usingno instrument resolution function. Bot-tom panel: same as above using a resolu-tion function with Δ2Θ = 0.25◦ . Notethat the intensities are given on a loga-rithmic scale.

File: expt/pow.1.mac1 variable real,step2 #3 step=1.0/50.04 #5 powder6 set calc,complete7 set temp,ignore8 set wvle,1.09 set delt,0.0

10 set lpcor,neutron11 neutron12 #13 set axis,tth14 set tthmin, 9.0015 set tthmax,74.0016 set dtth, 0.0217 #18 set dh,step19 set dk,step20 set dl,step21 #22 show23 run24 exit25 @output powder.dat,tth

A powder diffraction pattern is in principle nothing other, than thespherical average of a single-crystal diffraction pattern, which can beeasily calculated from a model structure as we have seen in the pre-vious sections. The first algorithm DISCUS uses to calculate a powderpattern does nothing more than perform this averaging. It works asfollows: The intensity along a line parallel to h in reciprocal space iscalculated using the normal Fourier transform discussed earlier. Therange in h that is actually computed depends on the user defined rangeof the scattering angle 2Θmin < 2Θ < 2Θmax. The calculated intensityis than mapped onto the 2Θ array. Next k is incremented, and once thecomplete plane in reciprocal space is covered, the coordinate l is incre-mented until all reciprocal space in between the two spheres definedby 2Θmin and 2Θmax has been covered.

Let us consider the example shown in Fig. 4.6. Here the powderdiffraction pattern from a 50 x 50 x 50 unit cell model structure show-ing chemical short-range order is displayed. Note that the intensitiesare shown on a logarithmic scale, so the diffuse scattering can be easilyseen. The corresponding macro is shown below the figure. After en-tering the powder module (line 5), we select the complete integrationcalculation mode (line 6), disable the dampening due to thermal param-eters (line 7), set the wavelength (line 8), disable the use of a resolutionfunction (line 9), select the correction for neutron Debye Scherrer ge-ometry (line 10) and choose neutron scattering (line 11). Lines 13–16determine the x-axis to be 2Θ (in contrast to Q) and set the limits of thestep size of the calculation. In lines 18–20 the step size of the integra-tion in reciprocal space is selected. Note that we calculate the step sizefrom the number of unit cells (line 3) according to equation 4.5. Sincewe perform an explicit Fourier transform, everything we learned aboutcalculating single-crystal scattering applies here as well. In particularone needs to take care to choose a step size that will not miss any Braggreflections. The calculation is started in line 23 and the result is saved toa file using the macro output.mac in line 25. Even for a model as large as50 x 50 x 50 unit cells as in our example, the resulting powder patternlooks very noisy (Fig. 4.6 top). This is a result of the noise in the Fouriertransform as we discussed in the previous section. We also observe thatthe Bragg peaks are very sharp. This is of course due to the fact that ourstep size of 1/50 = 0.02 r.l.u. is large enough that a Bragg peak only fillsa single bin. Experimental data, however, will always have a finite peakwidth due to the resolution of the instrument. This can be simulated byconvoluting the calculated powder pattern with the resolution functionof the instrument. DISCUS provides a Gaussian resolution function andthe width can be set using the set delt command (line 9). The samepowder pattern but with a resolution of Δ2Θ = 0.25◦ is shown in the

Page 52: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.2 Powder diffraction 41

bottom panel of Fig. 4.6. As a result, the Bragg peaks have an observ-able width and the noise in the diffuse scattering signal is almost gone.

4.2.2 Debye formula

An alternative approach to calculating the powder pattern of a struc-ture is the Debye formula [3] shown in equation 4.9.

I(h) =∑

j

f2j +

∑i

∑j,i�=j

fifjsin(2πhrij)

2πhrij(4.9)

File: expt/pow.2.mac1 powder2 set calc,debye3 set temp,ignore4 set wvle,1.05 set delt,0.06 set lpcor,neutron7 neutron8 #9 set axis,tth

10 set tthmin, 9.0011 set tthmax,74.0012 set dtth, 0.0213 #14 show15 run16 exit17 @output powder.dat,tth

Here the intensity is simply calculated by adding contributions for eachatom atom pair. The first sum is over all atoms j in the structure andfj is the scattering power of atom j. In addition to this constant termwe have a sum over all atom pairs i and j. Each pair contributes a sinewave to the intensity I(h). As one can imagine, this calculation is muchquicker than the explicit integration of diffraction intensities discussedin the previous section. Details about the Debye formula, its applicationto nanomaterials as well as even faster implementations can be foundin [4, 5]. In fact even DISCUS uses a quicker way to calculate expression4.9 internally. The calculation is done in the same way as in the previoussection, except for the command set calc, debye (line 2). Also thesettings for dh, dk and dl are no longer needed.

20 30 40 50 60 70

2Θ (degrees)

0

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Inte

nsity

(ar

b. u

nits

)

Fig. 4.7 Top panel: powder pattern calcu-lated using the Debye formula for a per-fect nickel structure of 5 x 5 x 5 unit cells.Middle panel: same for 20 x 20 x 20 unitcells. Bottom panel: same as above butcalculated using complete integration ofintensities.

The question arises: what is the difference between the two methodsto calculate the powder pattern, and why not always use the faster al-gorithm? A simple comparison for a perfect nickel structure is shownin Fig. 4.7. The top two panels show the powder pattern calculated us-ing the Debye formula for two different model sizes: 5 x 5 x 5 unit cellscontaining 500 atoms (top) and 20 x 20 x 20 unit cells containing 32 000atoms. The small model contains only Ni-Ni pairs up to a maximumdistance of ≈ 30.5 Å, defining the narrowest contribution to the pow-der pattern. As a result, the pattern in the top panel of Fig. 4.7 showsrather broad Bragg peaks. In fact the small peak at 2Θ ≈ 58◦ is notresolved. The larger model contains distances up to ≈ 122 Å leading tomuch sharper Bragg peaks (Fig. 4.7 center). Obviously a large enoughmodel is needed to calculate a sensible powder pattern using the De-bye approach. The bottom panel of Fig. 4.7 shows the same powderpattern calculated using the complete integration discussed in the lastsection. As long as we use a grid for the calculations that satisfied equa-tion 4.5, we get narrow Bragg peaks independent of the model size. Inthe case of a disordered system, of course, we need a sufficiently largesize to observe the diffuse scattering contribution. Note that equation4.5 only holds for models made out of complete unit cells and the ques-tion arises: how to best calculate the powder pattern of a particle. Toillustrate this, we have cut our 20 x 20 x 20 unit cell nickel crystal intothe largest possible sphere. The resulting powder patterns calculatedwith both methods are shown in Fig. 4.8. The pattern calculated via theDebye method is shown on the top. The pattern is similar to the one

Page 53: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

42 Simulating experimental data

calculated from the crystal (Fig. 4.7) and small differences are due tothe different shape. The pattern calculated using the integration, how-ever, is quite different (Fig. 4.8 bottom). This can be understood when

20 30 40 50 60 70

0

5

10

15

20

0

5

10

15

20

Inte

nsut

y (a

rb. u

nits

)In

tens

uty

(arb

. uni

ts)

2Θ (degrees)

Fig. 4.8 Top panel: powder pattern fora spherical nickel particle calculated viathe Debye equation. Bottom panel: cal-culated via integration.

looking at the corresponding diffraction patterns shown on the bottomtwo panels in Fig. 4.9. In the case of the crystal, there are no contribu-tions from the finite size of the model, because we are fulfilling equa-tion 4.5 by choosing the appropriate grid size. As the powder patternis an integration of these intensities, only sharp Bragg peaks will ap-pear. The situation is quite different in the case of the particle. Here weclearly observe intensities that originate from the spherical shape of ourmodel. As the pattern is integrated, extra intensity due to the shape ap-pear in the powder pattern. In the case of an infinitely fine grid used forthe integration, both methods will produce a similar calculated powderpattern.

In summary, in cases of particles, the Debye method is the preferredway to calculate the powder pattern. For disordered crystals it is ingeneral best to use the complete integration even though it is quite anintensive calculation for larger models. One should also note that thereis a special calculation mode for stacking faults (see Chapter 7).

–2 0 2h (r.l.u.) h (r.l.u.)

k (r

.l.u.

)y

(l.u

.)

–2

–8

–4

0

4

8

0

2

–2 0 2

–8 –8–4 –40 04 48 8x (l.u.) x (l.u.)

1000

2000

3000

Inte

nsity

(ar

b. u

nits

)

Fig. 4.9 Top panel: nickel crystal (left) and nickel particle (right). Bottom panel: corre-sponding diffraction patterns.

Page 54: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.3 Atomic pair distribution function 43

4.3 Atomic pair distribution function

In the previous section we discussed the appearance of diffuse scatter-ing in the powder diffraction pattern, and how DISCUS can be usedto calculate it from a structural model. An alternative approach tostudy total scattering (i.e. diffuse and Bragg scattering) is the analysisof the atomic pair distribution function (PDF). This method originatesfrom the study of the structure of glasses and liquids, but is becomingmore and more popular to study disordered or nanocrystalline mate-rials [6, 7, 8]. It should be noted that the software package includedwith this book also contains the PDF refinement program PDFFIT [9],which allows one to refine a small structural model based on a PDF. Wewill not discuss the use of PDFFIT in this book, however, and interestedreaders are encouraged to study the users guide distributed with theprogram. Very recently a successor to PDFFIT, the completely new PDFrefinement program PDFGUI [10], has become available. The principles http://www.diffpy.orgof PDF calculation and modeling, however, are unchanged.

First we need to mention some of the basics of the PDF techniqueneeded to understand the PDF calculation module of DISCUS. The PDFis obtained from the powder diffraction data via a simple Fourier trans-form of the normalized scattering intensity S(Q):

G(r) = 4πr[ρ(r) − ρ0] =2

π

∫ ∞

0

Q[S(Q) − 1] sin(Qr)dQ (4.10)

Fig. 4.10 PDFGETN User Interface.

where ρ(r) is the microscopic pair density, ρ0 is the average numberdensity, and Q is the magnitude of the scattering vector, for elastic scat-tering Q = 4π sin(θ)/λ with 2θ being the scattering angle and λ thewavelength of the radiation used. Today the task of obtaining S(Q)and G(r) is made easy thanks to modern, user-friendly software. Neu-tron scattering data can be processed using PDFGETN [11] (Fig. 4.10)and in fact on the instrument NPDF at the Lujan Neutron ScatteringCenter, S(Q) and G(r) are calculated completely automatically once ameasurement has finished. Similar software to process X-ray data isPDFGETX2 [12].

4.3.1 Calculating the PDF from a model

After having constructed a disordered structure, one needs to calculatethe PDF. The PDF can simply be understood as a bond-length distri-bution between all pairs of atoms i and j within the crystal (up to amaximum distance); each contribution, however, has a weight corre-sponding to the scattering power of the two atoms involved. The PDFof a given structure can be calculated using the relation:

Gc(r) =1

r

∑i

∑j

[bibj

〈b〉2 δ(r − rij)

]− 4πrρ0 (4.11)

Page 55: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

44 Simulating experimental data

where the sum goes over all pairs of atoms i and j within the modelcrystal separated by rij . The scattering power of atom i is bi and 〈b〉is the average scattering power of the sample. In case of neutron scat-tering bi is simply the scattering length; in the case of X-rays it is theatomic form factor evaluated at a user-defined value of Q. The defaultvalue is Q = 0 in which case bi is simply the number of electrons ofatom i. Generally there are two different ways to account for displace-ments (either thermal or static) from the average position. First one canuse a large enough model containing the desired displacements andperform an ensemble average. Secondly one can convolute each contri-bution given by δ(r − rij) in equation 4.11 with a Gaussian accountingfor the displacements. A more detailed discussion of this point is givenin Section 4.3.2.

As we have seen before, the experimental PDF is obtained by Fouriertransform of the reduced structure factor. However, in practice, theaccessible range in Q is limited to a finite value of Qmax. This can bedescribed by a multiplication of the structure factor up to infinity witha step function cutting off at Q = Qmax resulting in the convolution ofthe PDF with the Fourier transform S(r) of the step function. DISCUSmodels the finite Q-range by convoluting the model G(r) with

S(r) =sin(Qmax · r)

r. (4.12)

1 2 3 4

Qmax=infinity

Qmax=20 Å–1

5 6 7 8 9

–10

–5

0

5

10

15

20

25

30

35

r (Å)

G(r

) (Å

–2)

Fig. 4.11 Calculated PDF of nickel.

With the availability of modern synchrotron and neutron sources it ispossible to collect powder diffraction data up to high values in Q; how-ever in many cases a sufficient PDF can be obtained using a conven-tional X-ray tube. One last correction applied to the calculated PDF,Gc(r), accounts for the limited resolution of the experiment in Q-space.This leads to a decrease of the PDF peak as a function of r accordingto the relation exp(−σ2

Qr2/2). A detailed discussion of the accuracy ofPDF analysis is given in [13].

File: expt/expt.5.mac1 pdf2 set rang,10.0,0.023 set therm,gaus4 set qmax,20.05 set qsig,0.06 set rad,xray7 #8 calc9 #

10 save pdf,ni.pdf11 exit

Now it is time to calculate a PDF from a structural model. An exam-ple for nickel is shown in Fig. 4.11. The PDF was calculated for twodifferent situations: The PDF shown as the dotted line was calculatedwithout applying convolution given by Qmax. This is achieved in DIS-CUS by setting the value of Qmax to zero. The second PDF shown asthe solid line in Fig. 4.11 was calculated for Qmax = 20 Å−1. The re-sulting termination ripples are clearly visible. Below the figure is thesimple macro used to calculate the PDF. We assume that a structure hasalready been read or created in DISCUS. After entering the PDF mod-ule (line 1) we specify the maximum value of r and grid size Δr (line2). In our case we calculate up to a value of r = 10 Å using a gridof Δr = 0.02 Å. In line 3, we choose to model thermal motion usinga Gaussian (see next section). The next command (line 4) specifies thevalue of Qmax to be set to 20 Å−1. Finally we set σQ to zero (line 5)meaning no Q-resolution correction and select X-ray radiation (line 6).Now we are ready to calculate the PDF, done in line 8. All we have todo now is to save the result to a file (line 10). The result is shown in Fig.

Page 56: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.3 Atomic pair distribution function 45

4.11. Note the negative slope which is caused by the term −4πrρ0 inequation 4.11. This definition of G(r) turns out to be advantageous forcrystalline materials as G(r) oscillates around zero for large distances[14].

4.3.2 Modeling of thermal motion

As discussed in the introduction to this chapter, thermal motion canbe introduced in two different ways: by ensemble average of a largemodel crystal containing explicit thermal displacements or by convo-lution of δ(r − rij) in equation 4.11 with a distribution function, in ourcase a Gaussian. In this case the delta function is simple replaced bythe Gaussian and the expression for the calculated Gc(r) becomes:

Gc(r) =1

r

∑i

∑j

[bibj

〈b〉2 Tij(r)

]− 4πrkρ0(p) (4.13)

Tij(r) =1√

2πσij(r)exp

[− (r − rij)

2

2σ2ij(r)

]·[1 +

(r − rij

rij

)](4.14)

File: expt/expt.6.mac1 read2 cell ni.cll,3,3,33 #4 pdf5 set rang,5.5,0.026 set qsig,0.07 set rad,xray8 #9 set qmax,0.0

10 set therm,off11 calc12 save pdf,therm.1.pdf13 #14 set qmax,35.015 set therm,off16 calc17 save pdf,therm.2.pdf18 #19 set qmax,0.020 set therm,gauss21 calc22 save pdf,therm.3.pdf23 #24 set qmax,0.025 set therm,gauss26 set delt,0.0127 calc28 save pdf,therm.4.pdf29 #30 exit31 therm32 #33 pdf34 set qmax,0.035 set therm,off36 calc37 save pdf,therm.5.pdf38 #39 set qmax,35.040 set therm,off41 calc42 save pdf,therm.6.pdf43 #44 set qmax,35.045 set therm,gauss46 calc47 save pdf,therm.7.pdf48 exit

The expression 4.13 is the same as before, except it now contains thedistribution function Tij(r) (4.14). Next let us have a look at Tij(r).The first part is a simple Gaussian. It is multiplied by a modificationfunction, which is caused by anisotropic averaging. This is beyond thescope of this chapter and discussed in detail in [15]. Also note that thiscorrection is not needed in the case when an ensemble average is usedrather than a distribution function. The width of the function Tij isgiven by the atomic displacement parameters, B, of atoms i and j. Fur-thermore the σij(r) shows an r-dependence to account for correlatedmotion. Imagine atoms that are close vibrating in phase and causingthe PDF peaks at low r to sharpen [16, 17]. The r-dependence of thepeak width is implemented as follows:

σij(r) =

√σ

′2ij − δ

r2ij

− γ

rij+ α2r2

ij (4.15)

Here σ′ is the peak width without correlation given by the structuralmodel. The first two terms correct for the effects of correlated motion.The last term in equation 4.15 models the PDF peak broadening as aresult of the Q-resolution of the diffractometer. Except for the instru-ment broadening contribution, one needs to take care when using thesecorrections. In a large disordered model, the best way is to use the en-semble average, since the disorder should reflect the correct PDF peakwidth dependence. However, if one uses small models or only partof the disorder is present in the model, using these corrections can behelpful to match the observed G(r).

Next we want to illustrate this point by a series of examples shown inFig. 4.12. The corresponding macro file is listed in the margin. First we

Page 57: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

46 Simulating experimental data

200

(a)

(c) (d)

(e) (f)

(b)

100

G(Å

–2)

0

40

20

G(Å

–2)

0

20

10G(Å

–2)

0

20

10G(Å

–2)

0

20

10G(Å

–2)

0

20

10G(Å

–2)

0

2 3 4 5

r(Å)

2 3 4 5

r(Å)

2 3 4 5

r(Å)

2 3 4 5

r(Å)

2 3 4 5

r(Å)

2 3 4 5

r(Å)

Fig. 4.12 Modeling of thermal motion: (a) no thermal motion; (b) no thermal motion,Qmax = 35 Å−1; (c) convolution with Gaussian (solid line) and correlated motion (dottedline); (d) ensemble average 3 x 3 x 3 unit cells; (e) ensemble average, Qmax = 35 Å−1 and(f) ensemble average and convolution (see text for details).

read the unit cell of nickel and create a crystal of 3 x 3 x 3 unit cells (lines1–2). Next we enter the pdf module and make some general settingsas in the examples before (lines 5–7). Next we disable the convolutiondue to Qmax (line 9) and disable the convolution with the "thermal"Gaussian (line 10). Finally we calculate the PDF (line 11) and save the

Page 58: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.3 Atomic pair distribution function 47

result to a file (line 12).The calculated PDF is shown in Fig. 4.12a. Weobserve just the δ contribution at the positions of the neighboring dis-tances within the crystal. This can be understood since the atoms arestill at their ideal positions and no convolution is carried out. The widthobserved in the figure is due to the finite step size in r. Next we leaveeverything the same, but specify Qmax = 35 Å−1 (line 14). The convolu-tion is still disabled, however, Fig. 4.12b clearly shows a broadening ofthe PDF peaks. This is caused by the convolution with S(r) defined inequation 4.12. The observed termination ripples are very strong since thesignal is a sharp δ-type function. In order to obtain a PDF peak widthcorresponding to the isotropic thermal parameter B without actuallymoving a single atom, we enable the convolution with the "thermal"Gaussian (line 20) in our next example. The result is shown in Fig.4.12c as solid line. Note that the convolution with S(r) due to the finiterange in Q is disabled again (lines 19 and 24). The dashed line in Fig.4.12c shows the case where correlated motion is modeled according toequation 4.15. The parameter δ in equation 4.15 is set to 0.01 (line 26)and we can easily observe a sharpened near-neighbor peak and even asomewhat sharper next-near-neighbor peak in the calculated PDF.

The remaining examples use the ensemble average. We use the com-mand therm to displace the atoms according to their B values (line 31).Now the atoms are actually displaced from their ideal positions and cal-culating the PDF the same way as in the first example yields the PDFshown in Fig. 4.12d. No convolution was carried out. The noise thatcan be seen in the figure reflects the rather small crystal size of only 3 x 3x 3 unit cells. Figure 4.12e shows the same PDF as before, however thistime a value of Qmax = 35 Å−1 has been selected (line 39). It is immedi-ately obvious that the convolution with S(r) has a smoothing effect onthe PDF as one might expect. The final example uses the convolutionwith a Gaussian (line 45) on a crystal that already contains the thermaldisplacements, i.e. atoms are moved from the average positions. Notethat one needs to take care when mixing thermal displacements rep-resented by the Gaussian, which are actually not present in the modelcrystal with the real displacements in the model. There are cases, how-ever, where a simple model does account for some, e.g. static disorder,but the thermal contribution is accounted for using the convolution.

Setting up PDF segment ...Current PDF calculation settings :

Maximum r [A] : 6.6429Grid size DR [A] : 0.0200 ( 332 pts)Radiation : X-Rays (at 0.0 A**-1)

Applied corrections :Q termination (SINC) : applied, Qmax = 35.0 A**-1Instrument resolution : not appliedPeriodic boundaries : applied - 3DConvolution therm. Gauss.: appliedResolution broadening : 0.0000Quad. correlation fac. : 0.0000Linear correlation fac. : 0.0000PDF peak width ratio : 1.0000 below 0.0000 ANumber density (0=auto) : 0.0000Correction for RHO0 : 1.0000

Page 59: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

48 Simulating experimental data

Refinement settings :Fit minimum r [A] : 0.0200 (pt. 1)Fit maximum r [A] : 5.5000 (pt. 275)Current scale factor : 1.0000 (refined = F)

Selected atoms for PDF calculation :Atoms (i) : NI(1)Atoms (j) : NI(1)

As we have seen in the example, there are many settings in the PDFmodule and we have not even discussed all of them. As in most othermodules of the DISCUS program, the command show will display a listof current settings. An example for the output of the show commandin the PDF module can be found above.

4.4 Properties of the Fourier transform

Next we want to give a brief summary of properties of the Fouriertransform.

Function f(x) Fourier transform F (h)

f(x) = a(x) ⊗ b(x) ⇔ F (h) = A(h) · B(h) (4.16)f(x) = a(x) · b(x) ⇔ F (h) = A(h) ⊗ B(h) (4.17)

f(x) = a(x) + b(x) ⇔ F (h) = A(h) + B(h) (4.18)f(x) = α · a(x) ⇔ F (h) = α · A(h) (4.19)

f(x) = a(α · x) ⇔ F (h) =1

αA

(h

α

)(4.20)

f(x) = a(x − x0) ⇔ F (h) = A(h) exp(2πihx0) (4.21)f(x) = δ(x) ⇔ F (h) = 1

The following list sums up the Fourier transforms of some functionsused in this book.

Function f(x) Fourier transform F (h)

f(x) = k ⇒ F (h) = kδ(h) (4.22)

f(x) =

{a for |x| ≤ x0

0 otherwise⇒ F (h) = 2ax0 · sin(2πx0h)

2πx0h(4.23)

f(x) =

√a

πexp(−ax2) ⇒ F (h) = exp

(−π2h2

a

)(4.24)

f(x) = a cos(2π(bx + φ)) ⇒ F (h) =a

2exp(2πiφ) δ(h + b)

+a

2exp(−2πiφ) δ(h − b) (4.25)

Page 60: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

4.5 Bibliography 49

Of particular importance is the Fourier transform of an infinite latticeg(x):

g(x) =

+∞∑n=−∞

δ(x − na) ⇒ G(h) =1

a

+∞∑n=−∞

δ(h − n

a

)(4.26)

4.5 Bibliography

[1] Th. Proffen, R.B. Neder, DISCUS, a program for diffuse scatteringand defect structure simulations, J. Appl. Cryst. 30, 171 (1997).

[2] B.D. Butler, T.R. Welberry, Calculation of diffuse scattering fromsimulated disordered crystals: a comparison with optical trans-forms, J. Appl. Cryst. 25, 391 (1992).

[3] P. Debye, Scattering of X-rays, Annalen der Physik 46, 809 (1915).[4] B.D. Hall, Debye function analysis of structure in diffraction from

nanometer-sized particles, J. Appl. Phys. 87, 1666 (2000).[5] A. Cervellino, C. Giannini, A. Guagliardi, On the efficient evalu-

ation of fourier patterns for nanoparticles and clusters, J. Comp.Chem. 27, 995 (2006).

[6] T. Egami, S.J.L. Billinge, Underneath the Bragg-Peaks: StructuralAnalysis of Complex Materials, Elsevier Science, Amsterdam, 2003.

[7] Th. Proffen, S.J.L. Billinge, T. Egami, D. Louca, Structural analysisof complex materials using the atomic pair distribution function -a practical guide, Z. Krist. 218, 132 (2003).

[8] S.J.L. Billinge, M.G. Kanatzidis, Beyond crystallography: thestudy of disorder nanocrystallinity and crystallographically chal-lenged materials, Chem. Commun. 7, 749 (2004).

[9] Th. Proffen, S. J. L. Billinge, PDFFIT, a program for full profilestructural refinement of the atomic pair distribution function, J.Appl. Cryst. 32, 572 (1999).

[10] C.L. Farrow, P. Juhas, J.W. Liu, D. Bryndin, J. Bloch, Th. Prof-fen, S.J.L. Billinge, PDFfit2 and PDFgui: Computer programs forstudying nanostructure in crystals, J. Phys.: Condens. Matter 19,335219 (2007).

[11] P.F. Peterson, M. Gutmann, Th. Proffen, S.J.L. Billinge, PDFGETN:A user-friendly program to extract the total scattering structurefunction and the pair distribution function from neutron powderdiffraction data, J. Appl. Cryst. 33, 1192 (2000).

[12] X. Qiu, J.W. Thompson, S.J.L. Billinge, PDFGETX2: A GUI drivenprogram to obtain the pair distribution function from X-ray pow-der diffraction data.

[13] B.H. Toby, T. Egami, Accuracy of pair distribution function analy-sis applied to crystalline and non-crystalline materials, Acta Cryst.A 48, 336 (1992).

[14] D.A. Keen, A comparison of various commonly used correlationfunctions for describing total scattering, J. Appl. Cryst. 34, 172(2001).

Page 61: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

50 Simulating experimental data

[15] M.F. Thorpe, V.A. Levashov, M. Lei, S.J.L. Billinge, in From Semi-conductors to Proteins, edited by S. J. L. Billinge, M. F. Thorpe, page105, New York, 2002, Plenum.

[16] I.-K. Jeong, Th. Proffen, F. Mohiuddin-Jacobs, S.J.L. Billinge, Mea-suring correlated atomic motion using X-ray diffraction, J. Phys.Chem. A 103, 921 (1999).

[17] I.-K. Jeong, R.H. Heffner, M.J. Graf, S.J.L. Billinge, Lattice dynam-ics and correlated atomic motion from the atomic pair distributionfunction, Phys. Rev. B 67, 104301 (2003).

Page 62: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Exercises 51

Exercises(4.1) In this exercise, we want to study the dependence

between finite size contributions in the scatteringpattern and the size of the model crystal. Createmodel crystals of different size and compare thescattering intensity calculated on a narrow grid, e.g0.01 r.l.u.

(4.2) A diffraction pattern of a cubic model crystal of 20 x20 x 20 unit cells and a lattice parameter of a = 5.0 Åwill show no finite size effect contributions for agrid size of Δh=0.05 r.l.u. Consider the two mod-ifications listed below. How does the grid size needto be changed to still avoid finite size contributionsin both cases?

• increase lattice parameter to a = 10.0 Å;• increase crystal size to 10 x 10 x 10 unit cells.

(4.3) Consider the following two structures, nickel andLaMnO3. The structural information is given be-low. Use DISCUS to calculate the X-ray and neutronPDF for both systems and compare the result. Whatare the differences between the neutron and X-rayresults? Which radiation would you choose in bothcases ?

• Nickel: Space group: Fm3m, a = 3.52 Å. Nioccupies the site (0,0,0).

• LaMnO3: Space group: Pbnm, a = 5.5367 Å,b = 5.7473 Å, c = 7.6929 Å. Fractional coordi-nates as follows:

La −0.0078 0.0490 0.25Mn 0.0 0.5 0.0O 0.0745 0.4874 0.25O 0.7256 0.3066 0.0384

Page 63: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 64: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Correlations and creatingshort-range order 5

Negative correlation

Positive correlation

Random

Fig. 5.1 Example of different correlationsalong x and y directions.

One of the most common forms of disorder in crystals is so-called short-range order (SRO), which as the name suggests has a limited correla-tion length. In this chapter the concept of correlations will be intro-duced. The main focus is on creating model structures showing SROusing Monte Carlo simulations.

http://en.wikipedia.org/wiki/Correlations

5.1 What are correlations?

Correlation is a term used in probability theory and statistics and in-dicates the strength and direction of a linear relationship between tworandom variables. If the correlation coefficient is zero, there is no rela-tion between the variables. A positive or negative correlation is a mea-sure for the strength and sign of the relation. Let us illustrate this con-cept with the simple two-dimensional example of chemical SRO (Fig.5.1). Here we have a model crystal containing vacancies. Our randomvariables are the occupancy of two sites that are nearest-neighbors inthe x or y directions. The top panel shows the case of a correlation co-efficient of zero. Since this indicates no relation between the two sites,it results in a random distribution. The case of a positive correlation isshown in the middle. In this case both sites in the model want to beoccupied by the same type of atom or by a vacancy. As a result, we ob-serve chains of vacancies and atoms along the x and y directions (Fig.5.1 middle). On the other hand, a negative correlation will cause thetwo sites to be preferably occupied by different atom types. Inspectionof the bottom panel of Fig. 5.1 shows the expected alternation of atomsand vacancies in the x and y directions.

Within the scope of disordered structures, the two aspects describecorrelations: (A) the type of variables, and (B) the relation of the twocorresponding sites in the crystal. Variables include occupancies asin this example, displacements from the average site, orientations ofmolecules or type of domain, just to name a few. The relation of thesites is basically given by the difference vector. In your simple exam-ple, it was the nearest neighbor. We could easily ask about 〈11〉 corre-lations or about 〈20〉 correlations, and so on. In fact one can explore acorrelation field by e.g. calculating correlations 〈N0〉 for increasing N .Details about how to use DISCUS to calculate correlations are given in

53

Page 65: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

54 Correlations and creating short-range order

Fig. 5.2 Schematic diagram of MC algorithm.

Chapter 10. Although, in principle, the concept of correlations can beextended to include more than two sites, one should keep in mind, thatonly two-body correlations actually contribute to the scattering [1, 2].

5.2 Monte Carlo simulations

Now we will discuss how to actually create model structures showingcorrelations or short-range order. A widely used approach is so-calledMonte Carlo (MC) methods [3]. In general MC can be described as sta-tistical simulation methods, involving sequences of random numbersto perform the simulation. In the past several decades this simulationtechnique has been used to solve complex problems in nuclear physics,quantum physics, and chemistry as well as for simulations of e.g. trafficflow or econometrics. The name "Monte Carlo" was coined during theManhattan Project of World War II, because of the similarity of statisti-cal simulation to games of chance, and because the capital of Monacowas a center of gambling. In this analogy the "game" is a physical sys-tem and the scientist might "win" a solution for his particular problem.An excellent application for this kind of statistical methods is the studyof diffuse scattering and subsequently the solution of the underlyingdefect structure. In solid state sciences, MC is usually used to minimizethe energy E of a system and there are a number of books and reviewarticles discussing this subject [2, 4, 5, 6]. Another technique using theMC algorithm is the so-called Reverse Monte Carlo simulation methoddescribed in Section 11.1.

In this section, we use MC to minimize the energy of a model sys-

Page 66: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5.3 Creating chemical short-range order 55

tem in order to generate a disordered structure. The different possibleenergies that can be used with DISCUS are presented in the followingsections. A schematic view of the MC algorithm is shown in Fig. 5.2.The total energy E of the crystal is expressed as a function of randomvariables such as site occupancies or displacements from the averagestructure. Next a site within the model crystal is chosen at random,and the associated variables are altered by some random amount. Theenergy difference ΔE of the configuration before and after the changeis computed. The new configuration is accepted if the transition prob-ability P given by

kT = 50.0

kT = 5.0

kT = 0.0

Fig. 5.3 Example of different values of kTin MC simulation.

P =exp(−ΔE/kT )

1 + exp(−ΔE/kT )(5.1)

is less than a random number η, chosen uniformly in the range [0,1]. Tis the temperature and k Boltzmann’s constant. The effect of the tem-perature T on the MC simulations is shown in Fig. 5.3. If kT is zero,only changes that decrease the energy of the system will be accepted.This situation is shown in the top panel of Fig. 5.3. We use the sameexample as in the previous section with a large positive correlation in〈10〉 direction. In the case of kT = 0, we observe long chains of vacan-cies and no thermal fluctuations. There is a danger in a more complexsystem, that one ends up in a local energy minimum. If we run theidentical simulation with a higher kT , more and more configurationsleading to a higher energy will be accepted (Fig. 5.3 middle) until thekT or the temperature is so high that virtually all configurations areaccepted and the result is very close to a random distribution (Fig. 5.3bottom). One can use simulated annealing and reduce the temperatureduring the MC simulations to find the global energy minimum.

Two more terms used in this book need to be defined. We refer toa MC move as the modification of a single variable such as occupancyor atom position. One MC cycle corresponds to the number of movesneeded to visit every site within the model crystal once on average.

5.3 Creating chemical short-range order

Chemical SRO, as in our two examples so far, can be described usingthe Ising model [7], which was originally used to model magnetism. Werepresent the occupancy of a site in the crystal using Ising spin variablesσi = ±1. Here σi = 1 means site i is occupied with type A and σi = −1stands for type B being present on site i. Using these variables, theenergy, Eocc, takes the following form:

Eocc =∑

i

Hσi +∑

i

∑n,n�=i

Jnσiσi−n (5.2)

The sums are over all sites i and neighbors n. The value σi−n refers tothe occupancy (spin) of the neighboring site i − n of site i. The quan-tities Jn are pair interaction energies corresponding to the neighboringvector defined by i and n. The quantity H is a single site energy, which

Page 67: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

56 Correlations and creating short-range order

has the effect of an external field in magnetic Ising models. Here it con-trols the overall concentration. If two neighboring sites are occupied bythe same atom type, the product σiσi−n = 1 and if the energy term Jn

is positive, alike pairs will lead to a larger energy and thus be avoided.If Jn is negative, alike pairs will be favored.

The interaction energies H and Jn can either be specified by the user,or one can choose to employ a feedback mechanism to determine theirvalues. This is done in the following way: After a MC cycle, definedas the number of MC steps needed to visit every crystal site once onaverage, has been carried out, the resulting correlations are computedand compared to the target values defined by the user. If the computedlattice averages are too low, then the corresponding H and Jn are de-creased by an amount proportional to the difference between calculatedand required value and vice versa.

5.4 Creating displacement disorder

The second class of disorder are distortions or displacements away fromthe average site position, for example relaxations of atoms around a va-cancy. DISCUS offers different energies or potentials that can be used inMC simulations to generate displacement disorder.

5.4.1 Simple spring

00

1

2

3

1 2 3Distance d (Å)

τ = 2.0Å

Ene

rgy

Fig. 5.4 Spring potential.

The simplest idea is hooking atoms together by springs, and atoms ormolecules move in a harmonic potential (Hooke’s law, Fig. 5.4). Theexpression for the energy Espring is

Espring =∑

i

∑n,n�=i

Kn[din − τin]2 (5.3)

The sums are over all sites i within the crystal and all neighbors naround site i. The distance between neighboring atoms or moleculesis given by din. The desired distance is defined by τin. The value Kn isa user defined force constant for each individual neighbor type n.

5.4.2 Lennard-Jones potential

A more realistic potential taking into account the repulsion betweenatoms at close distances is the Lennard-Jones potential [8] (Fig. 5.5).The energy Elj is defined as:

Elj =∑

i

∑n�=i

[A

dMin

− B

dNin

](5.4)

withA =

DN

N − MτMin and B =

DM

N − MτNin (5.5)

Page 68: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5.5 Example: Chemical short-range order 57

The sums are over all sites i within the crystal and all neighbors naround site i. The values for A and B are calculated from the targetdistance τin, i.e. the distance where Lennard-Jones has its potentialminimum, and from the potential depth D, which must be negative.

5432

Ene

rgy

0.5

0

–0.5

–1

Distance d (Å)

τ = 2.0Å

Fig. 5.5 Lennard-Jones potential.

Note that the values of M and N are user defined in DISCUS, butfor the "normal" Lennard-Jones potential, M = 12 and N = 6 and thepotential changes to the better known expression

Elj =∑

i

∑n�=i

D

[(τin

din

)12

− 2

(τin

din

)6]

(5.6)

5.4.3 Bond angles

The last energy term is in terms of bond angles rather than bond lengths.Otherwise it is similar to equation 5.3:

Eangle =∑

i

∑n�=i

∑m �=i

Kn,m[αinm − ψinm]2 (5.7)

Here the sums go over all center atoms i and atoms n, m that make thebond angle αinm. Knm is a user-defined force constant and ψinm is thedesired target angle. Note that some other programs define a similarequation using cos(α), but DISCUS uses the angles directly. However,the angle is always compared in an interval of ψinm/2 around all integermultiples of the angle. This is necessary, if for example the bond angleis intended to be 60◦. Values close to 120◦ are then obviously fine aswell.

5.5 Example: Chemical short-range order

Now that we have discussed all the ingredients such as correlations andenergy definitions, we are ready for a first detailed example. In this first Please note that older versions of DISCUS

were using the module MC for MC simu-lations. Recently a new module MMC al-lowing users to combine energy terms inthe minimization has been added. How-ever, for compatibility DISCUS still pro-vides the now obsolete MC module.

example, we start by discussing the macro file that was used to gener-ate the example structures shown in Section 5.1. The process starts by

File: sro/sro-ran.1.mac1 read2 cell crystal.cll,$1,$1,13 #4 replace cu,void,all,$2

generating a starting structure of the desired size and introducing theright amount of vacancies, which will later be ordered by the MC pro-cess. Creating the initial structure is done by the small macro shownhere. First we read the content of the unit cell from the file crystal.clland expand it to the desired size. Here we generate a two-dimensionalstructure, since the last parameter in line 2 is set to one. As we have dis-cussed in Chapter 2, the variables $1 and $2 will be replaced by the com-mand line input. This macro is later called from the main simulationmacro. The structure file contains one copper atom per unit cell. Thecommand replace (line 4) then replaces copper atoms with vacancieswith a probability given by parameter $2. Note that DISCUS treats va-cancies just as another atom type called VOID. The main macro to carryout the MC simulations is shown here. First we call the macro that gen-erates the initial structure @ran 50,0.3 (line 1). This corresponds to

Page 69: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

58 Correlations and creating short-range order

Fig. 5.6 Neighbor definitions in DISCUS.

generating a structure 50x50 unit cells in size and replacing 30% of cop-per atoms with vacancies. Then we enter the mmc module. In this sec-tion we need to define the neighbor relation as well as the energy termsused. Before discussing the part of the macro file defining neighbors,File: sro/sro.1.mac

1 @ran 50,0.32 #3 mmc4 set neig,rese5 #6 set vec,1,1,1, 1, 0, 07 set vec,2,1,1, 0, 1, 08 set vec,3,1,1,-1, 0, 09 set vec,4,1,1, 0,-1, 0

10 set neig,vec,1,2,3,411 set neig,add12 #13 set vec,5,1,1, 1, 1, 014 set vec,6,1,1,-1, 1, 015 set vec,7,1,1, 1,-1, 016 set vec,8,1,1,-1,-1, 017 set neig,vec,5,6,7,818 #19 set mode, 1.0, swchem,all20 set targ,1,corr,cu,void,$1,0.0,CORR21 set targ,2,corr,cu,void,$2,0.0,CORR22 set cyc, 100*n[1]23 set feed, 5*n[1]24 set temp,$325 run26 exit27 #28 save example.stru

let us inspect how DISCUS references atoms as schematically shown inFig. 5.6. Each atom can be identified by the unit cell it belongs to, andthe site number it occupies within this unit cell. Neighbors within DIS-CUS are defined via vector definitions. Consider atom A in Fig. 5.6and the neighbors schematically indicated by arrows. The neighbor isuniquely defined by the vector to the corresponding unit cell as well asthe site number. Take the command set vec,1,1,1,1,0,0 for ex-ample (line 6). The first number one is simply the number of the vectordefinition. The next number refers to the site number in the unit cell ofthe atom at the origin, here site number one. The next number is thesite at the end of the vector, here site one again. The last three numbersrefer to the unit cell of the destination atom, here it is [1, 0, 0], in otherwords in the neighboring unit cell in the x direction. In our example,we assume square symmetry for our two-dimensional structure. Thevector definitions in lines 6–9, define all four vectors for the 〈10〉 direc-tions. We group the four vectors to one neighbor definition (line 10)and add it to the list of neighbor definitions (line 11). Next we carryout the same steps for the 〈11〉 direction (lines 13–17). Note that we donot need the command set neig,add in this case, because no otherneighbor definitions are made. With all the neighbors defined, the nextpart defines the allowed moves and energy terms. First the commandset mode (line 19) selects what modifications DISCUS is making to the

Page 70: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5.5 Example: Chemical short-range order 59

crystal. In our case mode swchem is chosen with a probability of one.In this mode, two sites are selected and the atom types occupying thosesites are switched. Imagine a copper atom on site A and a vacancy onsite B. The new configuration would be copper atom on site B and avacancy on site A. More information about the possible moved are dis-cussed in Section 11.1. DISCUS also allows us to select more than onetype of modification for more complex simulations. The only part miss-ing is the definition of the energies to be used. Since we have definedneighbors in 〈10〉 and 〈11〉 directions, the energy becomes:

c10 = 0.5 – c11 = –0.3

Fig. 5.7 Structure showing correlations.

E = E10occ + E11

occ (5.8)

with Eocc as defined in equation 5.2. Consequently, two energy termsneed to be defined. This is done via the command set target (lines20–21). The first parameter specifies the corresponding neighbor def-inition. The next parameter specifies the energy term. The keywordcorr selects the energy for chemical SRO (equation 5.2). The next twoparameters define the atom types to be used, here copper and vacan-cies. The last three parameters specify a target correlation, the energyterm Jn and the mode. As we have discussed earlier in this chapter,DISCUS offers two different ways to create chemical SRO: First one canspecify the energy coefficients Jn. In this case the last parameter wouldbe ENERGY, and the target correlation value is ignored. Alternativelyone can specify a desired correlation and DISCUS will adjust the valuesfor Jn automatically. In this case the last parameter is, as in our exam-ple, CORR. All that is left now is to set the number of MC cycles (line 22),the feedback interval to determine values of Jn (line 23), and a value forkT to be used in the MC simulation (line 24). Note that variable n[1]contains the number of atoms in the structure. Finally the commandrun starts the MC simulation. The result for 50 x 50 unit cells, 30% va-cancies and target correlations of c10 = 0.5 and c11 = −0.2 is shown inFig. 5.7. As expected for these values, vacancies form chains along the〈10〉 directions. The output of DISCUS after the last MC cycle is listedbelow:

--- Final multiple energy configuration ---

Gen: 593926 try: 250000 acc: (good/bad): 4610 / 4308 MC moves

Correlations/Neig.- Energy- Atoms Target Distance/ Diff NumberDef. Type central Neig. Angle of pairs

1 Occupancy VOID CU 0.500 0.370 0.130 100002 Occupancy VOID CU -0.200 -0.141 -0.059 10000

--- Average energy changes ---

Energy type number number numberE < 0 <E> E = 0 E > 0 <E>

Occupation correlation 4610 -0.807 2475 242915 7.332

The output in line 3 shows that from a total of 250 000 moves, 4 610bad ones (ΔE > 0) and 4 308 good ones (ΔE ≤ 0) were accepted. As

Page 71: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

60 Correlations and creating short-range order

Table 5.1 Values of interaction energies, Jn, used for simulations shown in Fig. 5.8.

J10 J01 J11 J−11 J40 J04

Simulation 1 0.0 0.0 0.5 −0.5 0.0 0.0Simulation 2 −0.5 0.5 0.0 0.0 0.0 0.0Simulation 3 0.0 0.0 −0.5 0.0 0.0 0.0Simulation 4 −0.5 −0.5 0.0 0.0 0.5 0.5

we have discussed in Section 5.2, the ratio of good to bad moved willdepend on the temperature selected. For T = 0, no bad moves will beaccepted at all. In lines 9–10 of the output, the target correlations aswell as the achieved correlations are shown. As one can see, there arestill differences between the desired and actual values. To improve this,File: sro/sro.2.mac

1 @ran 50,0.22 #3 mmc4 set neig,rese5 #6 set vec, 1,1,1, 1, 0, 07 set vec, 2,1,1,-1, 0, 08 set neig,vec,1,29 set neig,add

10 #11 set vec, 3,1,1, 0, 1, 012 set vec, 4,1,1, 0,-1, 013 set neig,vec,3,414 set neig,add15 #16 set vec, 5,1,1, 1, 1, 017 set vec, 6,1,1,-1,-1, 018 set neig,vec,5,619 set neig,add20 #21 set vec, 7,1,1, 1,-1, 022 set vec, 8,1,1,-1, 1, 023 set neig,vec,7,824 set neig,add25 #26 set vec, 9,1,1, 4, 0, 027 set vec,10,1,1,-4, 0, 028 set neig,vec,9,1029 set neig,add30 #31 set vec,11,1,1, 0, 4, 032 set vec,12,1,1, 0,-4, 033 set neig,vec,11,1234 #35 set mode, 1.0, swchem,all36 set targ,1,corr,cu,void,0.0,$1,ENER37 set targ,2,corr,cu,void,0.0,$2,ENER38 set targ,3,corr,cu,void,0.0,$3,ENER39 set targ,4,corr,cu,void,0.0,$4,ENER40 set targ,5,corr,cu,void,0.0,$5,ENER41 set targ,6,corr,cu,void,0.0,$6,ENER42 set cyc, 100*n[1]43 set feed, 5*n[1]44 set temp,0.00145 run46 exit47 #48 save example.stru

one can employ simulated annealing as well as running the simulationfor more cycles. Also consider that correlations are not independentand a certain set of desired correlations might not be achievable. Moreon correlations and their limits and calculation is given in Chapter 10.The last line of the output gives a summary of the number of movesleading to a smaller, larger or same energy, together with the averageenergy values 〈E〉 in each case. These values help to tune the forceconstants of interaction energies of the simulation.

After working through this simple example, we can extend the macroto be able to control correlations e.g. in the 〈10〉 and 〈01〉 directions in-dependently. This done by splitting the neighbor definition into two,as can be seen in lines 6–14 in the modified macro shown on this page.We do the same for the 〈11〉 and 〈−11〉 directions (lines 16–24). Finallywe add interactions for the 〈40〉 and 〈04〉 directions. This allows us ina simple way to limit the chains in the previous example to a length offour atoms or vacancies by requiring the fourth neighbor to show a neg-ative correlation. Since we now have six neighbor definitions, we needsix set target commands as well. Note that we use the ENERGYmode in this example, so we enter interaction energies, Jn rather thantarget correlations. It is important to understand that setting the targetcorrelation to zero is not the same as setting the corresponding energyto zero. If the energy term is zero, the corresponding pair does not con-tribute to the energy of the system. If, on the other hand, one wantsa correlation to be zero, it might require a non-zero energy term. Themacro takes the six interaction energies, Jn, as input and the results offour different example runs with their corresponding diffraction pat-terns are shown in Fig. 5.8. The corresponding values are listed in Ta-ble 5.1. Simulation 1 has negative energy terms for the 〈11〉 and 〈−11〉directions and as a result the vacancies order in a kind of superstruc-ture looking like the value five on a dice. Because the superstructurevirtually doubles the lattice parameter in certain regions, we observe

Page 72: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5.5 Example: Chemical short-range order 61

5050

010

0015

0010

015

020

0In

tens

ity (

arb.

uni

ts)

Inte

nsity

(ar

b. u

nits

)50

010

0015

00In

tens

ity (

arb.

uni

ts)

5010

015

020

0In

tens

ity (

arb.

uni

ts)

Fig. 5.8 Example of different chemical correlations. Results for simulations 1–4 are shownfrom the top to the bottom, respectively. The diffraction patterns range from −2 r.l.u. to 2r.l.u. and grid lines are at integer h and k values. Disordered structures are shown on theleft and the corresponding diffraction patterns in the hk-plane are shown on the right.

Page 73: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

62 Correlations and creating short-range order

intensity at locations (12 , 1

2 ). Simulations 2 and 3 show chains of va-cancies in the 〈10〉 and 〈11〉 directions. The corresponding diffractionpatterns show diffuse streaks in perpendicular directions. In the caseof chemical SRO, the observed diffraction intensities can be readily un-derstood. The diffuse intensity is given by:

Isro(k) = −∑ij

∑lmn

cicjfifjαijlmn cos(2πkrlmn) (5.9)

Fig. 5.9 Schematic view of periodicboundaries.

Here the first sum is over all atoms i and j in the crystal and the secondsum is over all neighbors l, m, n. The respective concentrations of eachatom type are given by ci and cj . The scattering power is given by fi

and fj . The correlation coefficient between atoms i and j separated byl, m, n is given by αij

lmn (see Chapter 10). So every non-zero correlationresults in a modulation, giving a streak in the diffraction pattern. In thelast simulation 4, the energy terms for near neighbors are negative caus-ing a positive correlation, but 〈40〉 and 〈04〉 neighbors have a positiveenergy term causing a negative correlation. This results in the observedclustering of blocks of 4 x 4 vacancies. The resulting diffraction patternshows weak broad diffuse streaks along the h and k directions. Butthese streaks are also modulated by the Fourier transform of the 4 x 4shape of the vacancy clusters. A detailed discussion of features in thediffraction pattern is not the aim of this book, and readers might referto the book [5].

The examples in this chapter so far have dealt with disordered crys-tals, but what happens at the boundaries of our model crystal? By de-fault, DISCUS applies so-called periodic boundaries (Fig. 5.9). Essen-tially the complete crystal is repeated at every boundary. One needsto take care that the model is sufficiently large that this "artificial" pe-riodicity does not influence the results. However, in some cases oneis actually interested in the finite size in the case of, e.g. crystallinenanoparticles (see Chapter 9). In these cases, periodic boundaries canbe turned off within DISCUS. What about non-crystalline structures? Inthis case the complete model can be imbedded in a single unit cell andthe atom number becomes the site number.

5.6 Example: Distortions

The second very common type of short-range order is distortions andwe have discussed the corresponding energy terms in Section 5.4. Letus start with a model structure consisting of copper atoms where 30%of the copper atoms are replaced by gold atoms. The recipe for creatingthis starting structure is of course the same as in the previous chap-ter. Once we have the starting structure, we are displacing the nearestneighbor atoms around every gold atom as systematically shown inFig. 5.10. This is often referred to as the size effect [1] and there areplenty of examples in the book by Welberry [5]. Here we concentrate

Page 74: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5.6 Example: Distortions 63

on how such disordered structures can actually be created using DIS-CUS. Looking at the corresponding DISCUS macro file we see that targetdistances are calculated for all three pairs (Cu-Cu, Cu-Au and Au-Au)based on the desired distortion for Cu-Au distances. In lines 1–3 three

Fig. 5.10 Schematic view of the size effect.

variables are declared and in lines 5–7 the target distances are calcu-lated. Note that lat[1] contains the lattice parameter of this cubicmodel system. The target distance Cu-Cu is unchanged. The distanceCu-Au is calculated from the user input parameter $1 which is the firstparameter given on the command line when the macro is executed. A

File: sro/sro.3.mac1 variable real,eCC2 variable real,eCA3 variable real,eAA4 #5 eCC= 1.0 *lat[1]6 eCA=(1.0+$1) *lat[1]7 eAA=(1.0+2.0*$1)*lat[1]8 #9 mmc

10 set cyc, 50*n[1]11 set feed,10*n[1]12 #13 reset14 @neig15 set targ,1,lennard,cu,au,eCA,100.,12,616 set targ,1,lennard,cu,cu,eCC,100.,12,617 set targ,1,lennard,au,au,eAA,100.,12,618 set mode,1.0,shift,all19 set move,cu,0.02,0.02,0.0220 set move,au,0.02,0.02,0.0221 set temp,0.122 run23 exit

value of 0.05 for example would lead to an increase of the Cu-Au dis-tance by 5%. Finally we need to take care of Au-Au distances whichin our simple model we assume to be distorted by twice the amount.Next we enter the already familiar mmc module of DISCUS (line 9). Thenumber of cycles and the screen update interval are set as in the last ex-ample. All the neighbor definitions are given in a file neig.mac whichis executed in line 14. The neighbor definitions are the same as in thelast example. Often, the main macro is more legible, if extended tasksare written to a separate macro. One can also build a macro library forcommon tasks. Next the energy term is defined, and in our case weuse the Lennard-Jones potential (equation 5.4) for the three distancesdefined. The resulting energy term becomes

E = E100lj (Cu-Cu) + E100

lj (Cu-Au) + E100lj (Au-Au) (5.10)

As one can see, only 〈100〉 neighbors are defined and the three termscorrespond to the potential energy for the three different possible com-binations of neighboring atoms. The DISCUS commands are shown inlines 15–17. Note that the target distance is given in Å. The value 100 isthe potential depth and in complicated systems this value can be usedto tune the relative contributions to the total energy. The last two valuesare the exponents N and M in equation 5.4. Next the type of modifica-tion to the crystal is selected, in this case shift. Finally the width ofthe Gaussian distribution for the random shifts is set for the two atoms(lines 19–20). Here the width is given in lattice units, so in our casethe width of the distribution is 2% of the lattice parameter or 0.05 Å,since the lattice parameter in our model system is a = 2.5 Å. Last thevalue for kT in the MC simulation is specified (line 21) and the sim-ulation is started (line 22). Here we only show the part related to theMC simulation in reality commands to save the resulting structure orcalculate a diffraction pattern or bond length distributions would needto be added.

The resulting diffraction pattern as well as bond length distributionsof this example are shown in Fig. 5.11. The top example used a valueof 0.05 as user input resulting in a target distance of rCu-Au = 2.65 Å.The achieved bond length distribution (Fig. 5.11b) shows that the finalCu-Au distance is somewhat smaller. The distribution also shows asomewhat shorter Cu-Cu distance. The average distance, however, hasremained at 2.5 Å as it should. The different heights in the bond lengthdistribution reflect the different numbers of Cu-Cu, Cu-Au and Au-Au

Page 75: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

64 Correlations and creating short-range order

(a)

2

1

0

–1

–2

Prob

abili

ty

0

0.25

0.5

5×10

71.

5×10

810

8

Prob

abili

ty

0

0.25

0.5

5×10

71.

5×10

8

Inte

nsity

(ar

b. u

nits

)In

tens

ity (

arb.

uni

ts)

108

210–1–2

2

1

0

–1

–2

210–1–2

(b)

Cu–Cu

Cu–Cu

2 2.25 2.5 2.75

Cu–Au

Cu–Au

Bond length (Å)

2 2.25 2.5 2.75Bond length (Å)

Au–Au

Au–Au

(c) (d)

Fig. 5.11 Example of simple size effect.

nearest neighbor pairs in the structure. Note that the model startedwith all distances being 2.5 Å. The width of the distribution as wellas the resulting shifts will depend on the value of kT for the simulationand the target distances used. The diffraction pattern (Fig. 5.11a) showsthe characteristic asymmetry of the diffuse intensities around lines ofBragg peaks [5]. The stronger diffuse scattering will either be the lowor high Q side of these Bragg rows depending on the direction of theshift and the difference in scattering power of the two atoms involved[5]. The bottom part of Fig. 5.11 shows the diffraction pattern andbond length distribution of the same shift as before, but in the oppositedirection.

In this example, the size of the model used was 50 x 50 x 50 unit cellscontaining about 37 500 gold atoms and 87 500 copper atoms. This sizeis sufficient to generate a smooth bond length distribution even for theleast frequent Au-Au pairs (Fig. 5.11). In the case of smaller concen-trations, however, a larger model crystal might be needed. The modelsize should be chosen carefully considering the available computing re-sources and the size needed to create a statistically meaningful model.The second consideration should be the number of neighbors that needto be defined. In our example, we only used the nearest neighbors

Page 76: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

5.7 Bibliography 65

of 〈100〉 directions. Since this is the only contribution to the energyterm, DISCUS is free to introduce any longer range distortions withoutpenalty or gain. If one desires to have only 〈100〉 distortions with as lit-tle other deviations as possible, 〈110〉 vectors should be defined and thetarget distances should be set to the values of the average structure. Inany case after a MC simulation the resulting structure should be stud-ied carefully, and tools to extract any correlations and distortions fromthe model structure are discussed in Chapter 10.

shift

swdisp

Fig. 5.12 Schematic view of distortionmodes in DISCUS .

Analysis of the resulting structure is particularly important with re-spect to the average displacements within the crystal. For example,these values should be consistent with the atomic displacement param-eters obtained from a structure refinement. The introduction of shiftsusually broadens the overall distribution. One way around this is to usethe swdisp mode in DISCUS rather than the shift mode (Fig. 5.12)which allows us to keep the overall displacements unchanged with re-spect to the starting structure. Basically in this mode, two atoms aredisplaced, but since their displacements from the average position aresimply exchanged, the overall displacements present in the model areunchanged. Using this mode obviously required some initial distor-tions present in the model. The simplest way to achieve this is using thecommand therm which will displace every atom by a random amountcorresponding to its atomic displacement parameter. This is discussedin more detail in Section 11.1.

In cases where chemical short-range order and distortions coexist,the strategy is to model the chemical short-range order first just as wehave done in the previous chapter. The distortions can then be mod-eled in the same way as discussed here. The only difference is that thestarting structure is not generated with a random distribution but isthe output of the chemical ordering step. The MC simulation moduleof DISCUS can not only be used to create correlations and distortions be-tween atoms, but also to create distributions of layers in case of stackingfaults (Chapter 7) or domains (Chapter 8).

5.7 Bibliography

[1] T.R. Welberry, Multi-site correlations and the atomic size effect, J.Appl. Cryst. 19, 382 (1986).

[2] T.R. Welberry, B.D. Butler, Interpretation of diffuse X-ray scatteringvia models of disorder, J. Appl. Cryst. 27, 205 (1994).

[3] N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller, E.J.Teller, Equation of state calculations by fast computing machines,J. Chem. Phys. 21, 1087 (1953).

[4] K. Binder, editor, The Monte Carlo Method in Condensed MatterPhysics, volume 71 of Topics in Applied Physics, Springer, 1 edition,1995.

[5] T.R. Welberry, Diffuse X-ray Scattering And Models Of Disorder, In-ternational Union of Crystallography Monographs on Crystallog-raphy, Oxford University Press, Oxford, 2004.

Page 77: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

66 Correlations and creating short-range order

[6] T.R. Welberry, B.D. Butler, Diffuse X-ray scattering from disorderedcrystals, Chem. Rev. 95, 2369 (1995).

[7] E. Ising, Report on the theory of ferromagnetism, Zeitschrift fürPhysik 31, 253 (1925).

[8] J.E. Lennard-Jones, Cohesion, Proceedings of the Physical Society 43,461 (1931).

Page 78: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Exercises 67

Structure A Structure B

Exercises(5.1) Consider the two disordered structures labeled

Structure A and Structure B shown on top of thispage. Both two-dimensional structures consist of50 x 50 unit cells with one atomic site occupied at(0, 0, 0) with a probability of 80%, in other wordsthere are 20% vacancies. As one can see from the fig-ure above, the two structures exhibit chemical SRO.Make a guess about what correlations are present inthe two structure and verify your guess by creatingyour structure using MC simulations.

(5.2) In this chapter we have briefly touched on the con-cept of simulated annealing. Modify the example

given in Section 5.5, so that the value of kT de-creases from a given starting value as the simulationprogresses.

(5.3) How does the resulting bond length distribution de-pend on the value of kT used in the simulation in-troducing distortions? Modify the example given inSection 5.6 and verify your expectations.

(5.4) Create a structure with vacancy short-range order.In a second step, relax the neighboring atoms in the〈10〉 direction towards the vacancy. Calculate thescattering intensities and describe the diffuse scat-tering observed.

Page 79: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 80: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Creating modulations 6In this chapter we will discuss periodic deviations of the scattering den-sity or of the positions of an atom or molecule from its average. The firstquestion we might ask ourselves is how do those modulations arise ina material?

As a first possibility, modulations can be dynamic in origin, in otherwords they are caused by thermal fluctuations, always present in acrystal (as well as in other materials). In this case the incident radia-tion might gain or lose energy by creating or annihilating such a vi-bration, which is called a phonon. In the case of neutron scattering,the difference in energy between the incident and scattered neutronscan easily be measured making neutrons the ideal probe for analyz-ing phonons. The thermal vibrations have two effects on the diffrac-tion pattern: First the intensity of the Bragg reflections is dampened bythe Debye-Waller factor. The simple Einstein model of thermal motionassumes independent displacements of the atoms, however in realitythose displacements will be correlated (e.g. neighboring atoms move inthe same direction) causing additional thermal diffuse scattering (TDS).Each thermal wave will create a set of satellites around each Bragg peakat positions inversely proportional to the wavelength of the wave. Theenvelope of all these contributions is referred to as TDS. For a detaileddiscussion about phonons and their properties see, e.g. [1].

As the second possibility, a wide range of structurally flexible or adap-tive phases exist that form modulated structures with long periodici-ties. Those modulated structures consist of two parts, the underlyingaverage structure and a perturbation thereof, which is characterized byone or more linearly independent modulation wavevectors. This al-lows a higher dimensional description (h, k, l and modulation vectors)of those structures, and the usage of structure refinement tools simi-lar to normal structure determination of unmodulated structures. Theperturbation from the average structure can either be occupational ordisplacive or a combination of both. A recent summary of those compo-sitionally and/or displacively flexible systems and their crystal chem-istry can be found in [2].

So far we have simply talked about modulations in general and notdistinguished between commensurate and incommensurate modula-tions. In the first case, the ratio of the wavelength λ of the modulationand the lattice parameters of the underlying structure is rational, forincommensurate modulations it is not. In reality, however, it is im-possible to determine whether the position of the resulting satellites is

69

Page 81: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

70 Creating modulations

irrational with respect to the parent Bragg reflections. A much betterdefinition for incommensurate structures is a continuous change of thesatellite position (or modulation wave length) as a function of tempera-ture as, e.g. observed for NaNO2 [3]. In this chapter we will talk aboutmodulated structures and satellites for the commensurate as well as theincommensurate case since the principles discussed in this chapter ap-ply to both. It should be noted, however, that in cases where the modu-lation wavelength is a (small) integer multiple of the lattice parameterthe term superstructure is generally used.

In the following sections we will first discuss density waves or inother words modulations of the occupancy of an atomic site. Nextdisplacement waves are illustrated. In both cases a brief mathemat-ical background is given, and (simple) simulation examples are usedto verify the analytical results. The last two sections focus more onthe simulation of modulated structures and deal with finite waves andvarious pitfalls one should be aware of when performing those simu-lations. In order to keep the mathematics simple, we have limited theexamples to systems with one atom per (primitive) unit cell. However,the simulation of more complex modulated structures using DISCUS isstraightforward and readers are encouraged to see the examples as anintroduction and try further more complex simulations. The followingdiscussion of the diffraction intensities follows the works by Korekawa[4] and Böhm [3].

6.1 Density waves

0 1 2 3 4 5 6 7 8 9r (l.u.)

D(r)ρ

Fig. 6.1 Modulated scattering density.

As mentioned in the introduction to this chapter, a density wave mod-ulates the scattering density within a crystal. As first example we willuse a harmonic density wave. Here the scattering density of the perfectstructure, ρp(r), is modified by a function that has the following form:

ρd(r) = ρ + A cos

(2π

[kr

λ+ φ

])(6.1)

The average scattering density is given by ρ. The wave is defined byits wavelength λ, the propagation direction given by the wavevectork of unit length, the amplitude A of the wave and by a phase φ. Thescattering density of the perfect structure is multiplied by the functiongiven in equation 6.1 as illustrated in Fig. 6.1. In this example the per-fect structure consists of equally spaced identical atoms. The size of thecircles represents their scattering density. After multiplying with equa-tion 6.1, we get the structure in the upper part of the figure. Here theatoms remain equally spaced but their respective scattering density isnow a function of the real space coordinate. Naturally, the scatteringdensity of an individual real atom cannot be changed, and we will de-scribe later in this chapter how a density wave is actually created in acomputer simulation.

First, we will derive analytically the expected scattered intensity of a

Page 82: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.1 Density waves 71

structure containing density modulations. The total scattering densityof the modified crystal can be expressed as ρ(r) = ρp(r) · ρd(r), i.e. theproduct of the scattering density of the perfect crystal and the densitymodulation given in equation 6.1. According to the convolution theo-rem (see Section 4.16) the Fourier transform of this product is equal tothe convolution of the individual Fourier transforms. We will refer tothe scattering amplitude of the perfect crystal as G(r) as discussed inmore detail in Chapter 3. Subsequently the total scattering amplitudeF (h) of our modulated crystal structure can be calculated as follows:

F (h) = G(h) ⊗F{ρd(r)}= G(h) ⊗

{ρ δ(h) +

A

2

{exp(2πiφ) δ

(h ± 1

λk

)}}

= ρ G(h) +A

2

{exp(2πiφ)G

(h± 1

λk

)}(6.2)

The Fourier transform F{ρd(r)} can easily be calculated using equation4.25 given earlier. Let us have a closer look at this expression. The termG(h) gives the Bragg reflections of the average crystal structure. Notethat their amplitude is changed by an overall scale factor of ρ, whichreflects the changed scattering density of the crystal. The density wavedoes not cause an intensity fluctuation of the Bragg reflections as a func-tion of the scattering vector h. Additional intensity appears as one pairof satellites at positions ± 1

λk around each Bragg peak. Those satelliteshave the intensity Isat ≈ 1

4ρ2 A2. The phase factor disappears when cal-culating the intensity as I(h) = F (h)F ∗(h). Thus the resulting intensityis independent of the phase φ of the density wave. By observing the po-sition and the intensity of the satellites, the direction of wavevector k,the wavelength λ and the amplitude A of the wave can be determined.

λ

ξ λ (1−ξ) λ

ρΑ

ρΒ

Δ= ρΑ

−ρΒ

Fig. 6.2 Box shaped wavefunction.

Note that equation 6.2 and the corresponding remarks on the rela-tive intensities of the Bragg reflections and the satellites hold only ifall atoms are affected by the density modulation. In a real system, thedensity modulation might affect only part of the crystal structure; forexample, the silicon/aluminum ratio in a silicate might oscillate whilethe density of the surrounding oxygen atoms remains constant. Equa-tion 6.2 has to be augmented by a second term that describes the re-maining structure. In this case, a constant ratio between the intensity ofthe Bragg reflections and the satellite reflections can no longer be given,but instead the ratio depends on the specific structure.

Let us move on to a slightly more complicated situation, an anhar-monic density wave, in our case a box shaped wavefunction as schemat-ically shown in Fig. 6.2. Here the scattering density ρd(r) has two pos-sible values, ρA and ρB . As before, λ stands for the wavelength and theparameter ξ controls the asymmetry of the wavefunction. In order tolearn how the scattering intensity is different from the harmonic case,we need to look at the Fourier transform of the scattering density ρd(r)again. First we expand ρd(r) in a Fourier series (see mathematical textbooks) :

Page 83: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

72 Creating modulations

ρd(r) = ρ +

∞∑n=1

nπsin(nπξ) cos

(2πn

[kr

λ+ φ

])(6.3)

Here ρ represents the average scattering density with ρ = ξρA + (1 −ξ)ρB and Δ is the difference marked in Fig. 6.2. Since only the cosineterm depends on r we can calculate the Fourier transform as before.The resulting total scattering amplitude F (h) is given in equation 6.4:

F (h) = ρ G(h)+

∞∑n=1

Δ

nπsin(nπξ) ·

{exp(2πinφ)G

(h± n

λk)}

(6.4)

As before the term G(h) gives the Bragg reflections. Again, their over-all intensity is changed proportional to ρ2, but is not modulated bythe density wave. The main difference to the harmonic case discussedbefore is the fact that we now have an infinite number of satellitesaround each Bragg peak at positions given by ± n

λk. The direction ofthe satellites in relation to the Bragg position is again determined bythe wavevector k. The intensity of the n-th satellite is given by

Isatn ≈

)2

sin2(nπξ) (6.5)

It can easily be seen that the intensity of the satellites decreases withincreasing order n. In practice one will only be able to observe a lim-ited number of satellites before they become too weak. Equation 6.5shows also that in case of a symmetric box function defined by ξ = 0.5,satellites for n even are systematically extinct.

Now we know what kind of scattering to expect from structures con-taining density waves. The next step is to use DISCUS to actually createthose modulated structures. In the calculations we have treated thescattering density ρ(r) as a continuous function of r. In a real crystal agiven atomic site is either occupied by a certain atom type or it is not.Although one could imagine using fractional atoms in a simulation, theaim of computer simulations is to create an as realistic as possible pic-ture of a real crystal. Thus DISCUS always uses complete atoms and adifferent way of simulating density waves is employed. A continuousprobability for replacing an atom defined by the modulation functionρd(r) oscillates between an upper and lower limit, defined by the user.A random number is then generated and compared to the probability todecide whether an individual atom is replaced or not. While the typeof an individual atom in the crystal cannot be predicted, the averageoccupation on those planes where the argument kr in equation 6.1 isconstant reflects the calculated probability. As a first two-dimensionalsimulation example, we are going to create a structure modulated bya harmonic density function propagating in the crystallographic [11]direction. Before we look at the input used for DISCUS to create thisdisordered structure, let us have a look at the resulting structure and

Page 84: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.1 Density waves 73

[ 0

k]

0

1

2

(b)(a)

0 1 2

[h 0]

Fig. 6.3 Simulated structure showing a harmonic density modulation: (a) structure with100 x 100 x 1 unit cells and (b) corresponding neutron diffraction pattern.

the corresponding diffraction pattern. Both are shown in Fig. 6.3. Thedensity modulation, i.e. occupied and unoccupied atomic sites, canclearly be seen. The model structure is cubic with a lattice constant ofa = 5 Å and a zirconium atom occupies site (0, 0, 0). The wavelength λof the density wave used in this example is λ = 35 Å, the phase is set toφ = 90◦. File: mod/mod.1.mac

1 wave2 dens3 func sinus4 len 35.05 plow 0.06 phigh 1.07 vect 1,1,08 phase 90.09 repl zr,void

10 run11 exit

The resulting satellites shown in Fig. 6.3b are located around allBragg peaks in the [11] direction, and as expected from equation 6.2, weobserve only one pair of satellites around each Bragg position. We willdiscuss the resulting diffraction pattern in more detail later in this sec-tion, but first the actual sequence of DISCUS commands used to createour example structure is discussed. We need to start with the creationof a starting structure 100 x 100 x 1 unit cells in size. Details about howto create such structures were already given in Chapter 3 and are notrepeated here. Once we have our structure to start from, the followingsequence of commands will introduce the desired density wave. As inprevious examples, the line numbers are not a part of the DISCUS input.The function of most of the commands listed above is easy to guess, sowe have just a quick run through. First we need to enter the modulationwave module of DISCUS which is done in the first line. Next we select adensity wave followed by the setting of the wave function, in our case asinusoidal wave corresponding to the expression given in equation 6.1.The wavelength is set to λ = 35 Å in line 4. As discussed earlier, theamplitude of the density wave is used to determine the probability ofreplacing a given atom. The upper and lower limit of this probability isset to 0.0 and 1.0, respectively (lines 5–6). The amplitude A for the den-sity wave is determined by these two limits. The command vect in thenext line defines the wavevector k. Note, that the vector is internally

Page 85: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

74 Creating modulations

normalized to a vector of unit length. The last property of the densitywave we have to set is the phase φ which is set to φ = 90◦ in line 8.Although the wave is now completely determined, one final step is todetermine which atom type will be replaced by which other atom typevia the defined density wave. In our case, we want to replace the zir-conium atoms (Zr) present in the structure with vacancies (void). Thisis done by the command repl in line 9. Finally we need to start themodification of the structure using the command run (line 10) and exitthe modulation wave segment of DISCUS (line 11).

(a)

(b)

(c)

(d)

00

40

80

0

20

–4

0

4

8

0

40

80

Inte

nsity

Inte

nsity

Inte

nsity

F(h)

1 2 3[hh]

Fig. 6.4 Cross-section along [11] of thescattering intensity from the modulatedstructure. (a) Harmonic density wavecalculated for neutron scattering, (b) real(solid line) and imaginary (dashed line)part of the scattering amplitude, (c) in-tensity for a structure with an asymmet-ric box shaped density wave (ξ = 0.75)and (d) for a symmetric density wave(ξ = 0.5).

The resulting structure is shown in Fig. 6.3a. The correspondingscattering intensity (Fig. 6.3b) was calculated for neutron scattering ata wavelength of 1.0 Å. The calculated area extends from 0.0 to 3.5 r.l.u.with a grid size of Δh = 0.01 r.l.u. corresponding to a grid where scat-tering contributions due to the finite size of the model crystal are zero.A discussion of finite size effect contributions and other problems whencalculating the Fourier transform as well as various DISCUS examplesof calculating scattering intensities was already given in Chapter 4.

Figure 6.4a shows a cross-section of the calculated scattering inten-sity. Its direction is parallel to [11] through the origin of the reciprocalspace. The single pair of satellites around each Bragg peak can easilybe observed. The satellite positions are about ±0.1 r.l.u. away from theBragg position. This corresponds to a wavelength of the density waveof 5 Å/(

√2·0.1) ≈ 35 Å, just the wavelength we used for the simulation.

The observed intensity ratio between satellites and Bragg reflections isabout 1 : 4. The amplitude of the wave for the oscillation of the replace-ment probability is A = 0.5. Since we replaced about 50% of the atoms,the average density ρ is 0.5. Consequently the satellite intensity is thenIsat = 1

4ρ2 A2 = 14 of the Bragg peak just as observed. Next we dis-

cuss the resulting scattering amplitude shown in Fig. 6.4b. As expectedfrom equation 6.2 the amplitude of each satellite pair is imaginary andof opposite sign for the chosen phase of φ = 90◦. The Bragg reflectionsfor our sample structure have only a real component.

Figures 6.4c and d show the scattering intensity from a structure hav-ing the same density modulation but rather than a harmonic sinusoidalwave form, a box shaped wave function was used. In Fig. 6.4c anasymmetric box function with ξ = 0.75 was selected. This is simplyachieved by replacing line 3 of our example with the command funcbox,0.75. According to equation 6.5, we observe n satellites with de-creasing intensity for increasing n around each Bragg reflection. Thespacing of the satellites corresponds as before to the wavelength of thedensity modulation of λ = 35 Å. Note that the intensity of the Braggreflections for this figure is smaller compared to the other examples.This can be explained by a different average scattering density ρ forthe asymmetric wave function compared to the symmetric wave formsused in the other examples, because 75% of the width of the box func-tion causes the replacement of a zirconium atom. Figure 6.4d shows thecase of a symmetric box shaped function selected by the DISCUS com-mand func box,0.5. The first satellite pair appears again at the ex-

Page 86: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.2 Displacement waves 75

pected position but in agreement with what we said earlier all satelliteswith n even are extinct. In these examples we have used neutron scat-tering. Note that for a similar X-ray diffraction pattern the two satelliteswould show different intensities. The atomic form factor causes an ad-ditional decrease as a function of the scattering angle (see Chapter 4).

After demonstrating the basic features of density waves, we will moveon to a different type of modulation, displacement waves. Those mod-ulations are always present in a crystal in the form of phonons.

6.2 Displacement waves

0 1 2 3 4 5 6 7 8 9r (l.u.)

u(r)

Fig. 6.5 Modulated displacements fromaverage position.

A displacement wave modulates the position of atoms within a crys-tal. In the first part we will look at the mathematics for a harmonicdisplacement wave followed by some examples. Later in this sectiona brief discussion of related topics like acoustic versus optical modula-tion waves will be given. The definition of a sinusoidal displacementwave is given in equation 6.6. Each atom within the crystal is displacedby the vector u(r):

u(r) = a cos

(2π

[kr

λ+ φ

])(6.6)

The vector k defines the propagation direction of the wave, the wave-length is given by λ and the phase is represented by φ. These propertiesare similar to those used to describe a density wave in the previous sec-tion. Since our displacement u is a vector, the amplitude a of the waveis a vector too, defining the maximum size and the direction of the dis-placements. Obviously there are two extreme cases. For waves wherethe wavevector k and the displacement a are perpendicular we speakof transverse waves; cases where both vectors are parallel are calledlongitudinal waves. In principle there is no difference in the treatmentof both cases.

A schematic representation of a displacement wave as described byequation 6.6 is shown in Fig. 6.5. As in the previous section, the perfectstructure shown on the bottom of the figure consists of equally spacedidentical atoms. The modulated structure is shown in the upper half ofthe figure. In this case the wavevector is normal to the oscillation of thewave, so we have a transverse wave here.

Now we will analytically derive the resulting scattering from a crys-tal containing a displacement wave. The position of an atom is simplygiven by rd = r+u(r). Thus the scattering amplitude can be written asfollows:

F (h) =∑

atoms

f(h) exp (2πih (r + u(r)) (6.7)

=∑

atoms

f(h) exp (2πihr) · exp

(2πiha cos

(2π

[kr

λ+ φ

]))

Page 87: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

76 Creating modulations

In order to simplify equation 6.7, we use the so called Jacobi-Augerexpansion [5] given in equation 6.8 assuming small displacements:

exp(ix sin(θ)) =

∞∑m=−∞

Jm(x) exp(imθ) (6.8)

Here Jm(x) stands for the m-th order Bessel function. Using equation6.8 and the relation cos(φ) = sin(φ + π

2 ) = sin(φ′) we can rewrite theexpression for the scattering amplitude F (h) in equation 6.7 as follows:

F (h) =∑

atoms

f(h) exp (2πihr)∞∑

m=−∞

Jm(2πha) exp

(2πim

[kr

λ+ φ′

])

=

∞∑m=−∞

Jm(2πha) exp (2πimφ′) · G(h +

m

λk)

(6.9)

Furthermore it is convenient to split the sum up into a term for m = 0and terms for positive and negative values of m. Thus the final expres-sion for the scattering density becomes:

F (h) = J0(2πha)G(h) +

∞∑m=1

J−m(2πha) exp (−2πimφ′)G(h − m

λk)

+

∞∑m=1

Jm(2πha) exp (2πimφ′)G(h +

m

λk)

(6.10)

0 5

J(3,x)

J(2,x)

J(1,x)

J(0,x)1

0.75

0.25

J(n,

x)

–0.25

0.5

–0.5

0

10 15x

Fig. 6.6 Graph of Bessel functions J0 toJ3 discussed in the text.

As for the density wave, the resulting scattering consists of the Braggscattering described by the term including G(h) and an infinite num-ber of satellites at positions given by ±m

λ k. In order to discuss theintensity variations of Bragg peaks and satellites, we need to have acloser look at the Bessel functions Jm. The definition of these Besselfunctions and their properties can be found in standard mathematictextbooks. For our further discussion the Bessel functions Jm for m =0 . . . 3 are shown in Fig. 6.6. The scattering intensity is calculated byI(h) = F (h)F ∗(h). The phase factors disappear and using the relationJ−n(x) = (−1)nJn(x) the intensity for the Bragg peaks and the satellitesbecomes:

Ibragg(h) ≈ J20 (2πha) (6.11)

Isat±m(h) ≈ J2

m(2πha) (6.12)

Note that all cross terms of G(h) with different arguments are zero.The intensity of the Bragg reflections, Ibragg(h), is in contrast to den-sity waves modulated by the displacement wave. The intensity of thesatellites is given by higher order Bessel functions. Note that the satel-lite intensity is symmetric around the Bragg peaks. A look at Fig. 6.6shows that J0 has its maximal value at zero, whereas all higher orderBessel functions are zero at the origin. Subsequently Bragg reflectionswith ha = 0 show no satellites. We will illustrate the variation of Braggand satellite intensities using the following simple example.

Page 88: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.2 Displacement waves 77

[0 k]

0

1

2

(b)(a)

0 1 2

[h 0]

Fig. 6.7 Simulated structure showing a transverse displacement modulation. (a) Area of40 x 40 unit cells of the simulated structure sized 100 x 100 x 1 unit cells and (b) corre-sponding neutron diffraction pattern.

We are going to simulate a sinusoidal displacement wave using DIS-CUS. The propagation direction shall be [10] and the displacement di-rection [01]. Thus we have a transverse wave. The wave length of the File: mod/mod.2.mac

1 wave2 func sinus3 acco4 trans5 len 25.06 vect 1,0,07 amp 0.58 osci 0,1,09 phase 0.0

10 sel zr11 run12 exit

modulation shall be λ = 25 Å. We use as in the density wave examples acubic structure with a lattice constant of a = 5 Å and a zirconium atomon (0, 0, 0). The size of the model crystal is again 100 x 100 x 1 unit cells.After generating this structure, the following sequence of DISCUS com-mands will create the desired displacement wave. First the modulationsegment of the program is entered. Next the type of modulation is setto a sinusoidal (line 2) acoustic (line 3) transverse (line 4) wave. Foran acoustic wave all atoms are displaced in the same way like a mod-ulation created by a sound wave. We will discuss acoustic and opticalwaves later in this section. The command trans is needed to tell theprogram to use the given oscillation vector and is strictly speaking notlimited to the transverse case where propagation and oscillation vectorsare normal to each other. The wavelength is set to λ = 25 Å in line 5. Inlines 6–9 the other properties of the displacement wave are defined, i.e.wavevector k, amplitude and direction of the displacements and thephase φ. Finally the atoms that should be displaced by the wave are se-lected, in our case zirconium (line 10). All that remains is to execute themodulation (line 11) and exit the modulations segment of DISCUS. Partof the resulting structure is shown in Fig. 6.7a. As for the density wavebefore, the corresponding diffraction pattern displayed in Fig. 6.7b wascalculated for neutron scattering at a wave length of 1.0Å. The grid sizeof the calculated diffraction pattern is Δh = 0.01 r.l.u. corresponding toa situation where no finite size contributions are observed (see Section4.1.1).

Page 89: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

78 Creating modulations

Inspection of the calculated intensities in Fig. 6.7b shows the ex-pected satellites in the [10] direction corresponding to the direction ofthe wavevector k. The spacing of the satellites is about 0.2 r.l.u. corre-sponding to the wavelength of λ = 25 Å or 5 unit cells. This behavior issimilar to the case of the density waves discussed in the previous sec-tion. However, there are obvious differences. First of all, Bragg peakswith k = 0 show no satellites at all. This is due to the fact, that theproduct ha is zero and subsequently the intensity of the satellite givenby equation 6.12 is zero as well. Furthermore the intensity of theseBragg peaks is not affected by the modulation. The cross-section par-allel to h at k = 0 corresponds to a projection of the structure downy, the direction of the displacements. In this projection the modulatedstructure is not different from the perfect structure and subsequentlyno satellites and changes in Bragg intensities are observed. The second

00

40

80

0

20

80

–20

4

80

6

2

40

80

Inte

nsity

Inte

nsity

Inte

nsity

F(h)

1 2 3Direction (r.l.u)

[h 2](a)

(b)

(c)

(d)

[h 2]

[1 k]

[1.2 k]

Fig. 6.8 Cross-sections of the calculatedscattering. (a) Parallel h at k = 1, (b) real(solid line) and imaginary (dashed line)part of the scattering amplitude, (c) in-tensity parallel k at h = 1. The dashedline is J2

0and (d) cross-section through

satellites at h = 1.2 parallel k. Thedashed line is J2

1.

observation from Fig. 6.7b is that the satellite intensities are identical onboth sides of each Bragg peak, but their intensities change in the k di-rection. The contour plot in Fig. 6.7b makes an accurate estimate of theintensities impossible. To illustrate the intensity behavior further, somecross-sections through the diffraction pattern are shown in Fig. 6.8. Thetop graph shows the intensity distributions along h at k = 2. It can beseen that the satellite intensities are the same for each Bragg peak in hdirection as expected, since the scalar product ha in the argument ofJn is constant for constant k. Next we want to verify the phase factorsin equation 6.10. Besides saving the calculated intensity, DISCUS cansave (among others) the real and imaginary part of the scattering am-plitude F (h) as shown in Fig. 6.8b. Here the real part is shown as thesolid line, whereas the imaginary part is represented by the dashed line.The Bragg peaks of our primitive structure with only an atom on (0, 0,0) have only a positive real component. Simply square the maximumvalue and you end up at the same value as in the plot of the intensity inthe view graph above. Next we work out the scattering amplitudes forthe satellites using equation 6.10. We chose a phase of φ = 0 resultingin φ′ = π

2 . For the first order satellite (m = 1), we get an imaginaryamplitude of iJ1 and for the second-order (m = 2) the result is a realamplitude of −J2 as can be seen in Fig. 6.8b. Note that the change ofsign of the phase factor for, e.g. the first satellite pair is compensated bya change of sign of the Bessel function, i.e. J−1(x) = −J1(x). Figures6.8c and d show cross sections along k through a row of Bragg peaksand a row of satellites. In contrast to the behavior along the h direction,the intensities of Bragg reflections and satellites change dramatically inthe k direction. This can be understood since the argument of the Besselfunctions determining these intensities only depends on the displace-ments given by vector a. The dashed lines in Figs. 6.8c and d show thevalue of the corresponding squared Bessel function J2

n. As you can see,the Bragg intensities follow the values of J2

0 perfectly and the satelliteintensities match the values of J2

1 .So far we have looked at a transverse wave. The position of the satel-

lites is given by the wavevector k and the direction of the intensity de-

Page 90: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.3 Finite waves 79

pendence of Bragg reflections and satellites is given by the oscillationdirection. We have also seen that the satellites at ±hs have the same in-tensity. This is not the case for a longitudinal wave. Here the wavevec-tor k and the oscillation defined by the vector a are parallel. The in-

00

10

20

30

40

50Inte

nsity 60

70

80

90

100

1 2[h 1]

3

Fig. 6.9 Scattering intensity along h atk = 1 of the simulated structure contain-ing a longitudinal displacement wave.The solid line is J2

0, the dashed line rep-

resents J2

1.

tensity from a structure modulated by a longitudinal wave is shown inFig. 6.9. Other properties of the wave are identical to the example of atransverse wave, i.e. |a| = 0.5 Å and λ = 25 Å. The DISCUS macro fileto create this example is nearly the same as before, just the commandtrans in line 4 is replaced by the command long. DISCUS will thenignore the oscillation vector given by the command osci and use thedirection of the wave vector as the displacement direction. Inspectionof the resulting intensities clearly shows that the satellite intensities aredifferent at ± 1

karound the Bragg reflections in contrast to the trans-

verse wave. Here the intensity dependence is in the same direction asthe wavevector. To show that the intensities correspond to equations6.11 and 6.12, the values of J2

0 (2πha) are shown as a solid line andJ2

1 (2πha) is shown as a dashed line in Fig. 6.9. As expected the twofunctions describe the intensity behavior of the Bragg reflections andthe first order satellites perfectly. Obviously transverse and longitudi-nal waves are the two extremes and DISCUS is capable of simulatingdisplacement waves for any combination of wavevector and oscillationvector.

We have mentioned earlier that we simulate acoustic waves. Thissimply means that all atoms are displaced in the same way. This wouldbe the case if we were to hit our crystal with a hammer (without de-stroying it) or excite the displacement by a sound wave. In contrast ifthe wave were generated by an electromagnetic excitation such as light,positively charged atoms would be displaced in opposite direction tonegatively charged atoms. DISCUS can generate optical displacementwaves with the command opti. This (admittedly crude) optical modewill displace all atoms that are identified as negative ions in the oppo-site direction to all others. Negative ions are recognized through theirrespective name, e.g. CL1-. As a side-effect, if charged ions are used,the Fourier transform will use the corresponding scattering curve. Ifthis is to be avoided, calculate the desired wave twice, once with posi-tive amplitude and once with negative, while selecting the correspond-ing atoms.

So far we have worked on the simple case of infinite waves affectingall atoms within the crystal. Some more realistic simulations of a modu-lated structure with finite waves as well as a discussion about problemswith those simulations are given in the next sections.

6.3 Finite waves

In the previous sections we have assumed that the modulation wavesextend indefinitely within the model crystal. In this section we will seehow a finite propagation of the wave influences the diffraction pattern

Page 91: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

80 Creating modulations

[ 0

k]

0

1

2

(b)(a)

0 1 2

[h 0]

Fig. 6.10 (a) Area of 40 x 40 unit cells of the simulated crystal. The transverse displace-ment wave is limited to a circle with a radius of 75 Å. (b) Corresponding scattering pat-tern.

and we will learn how DISCUS is capable of simulating such a situation.In real crystals modulations will often have a finite length and addi-

tionally the amplitude of the modulation will fade out until no mod-ulation can be observed any more. We will start with a rather sim-File: mod/mod.3.mac

1 read2 cell wave.cll,100,100,13 #4 wave5 func sinus6 acco7 trans8 vect 1,0,09 osci 0,1,0

10 len 25.011 amp 0.512 phase 0.013 sel zr14 run15 exit16 #17 save domain_wave.stru18 #19 read20 cell cell.cll,100,100,121 #22 domain23 reset24 mode pseudo25 input domain_origin.pseudo26 assign char,d1,sphere27 assign fuzzy,d1,0.528 assign content,d1,domain_wave.stru29 assign shape ,d1,1,15.0, 0.0, 0.0, 0.030 assign shape ,d1,2, 0.0,15.0, 0.0, 0.031 assign shape ,d1,3, 0.0, 0.0, 1.0, 0.032 assign orient,d1,1, 1.0, 0.0, 0.0, 0.033 assign orient,d1,2, 0.0, 1.0, 0.0, 0.034 assign orient,d1,3, 0.0, 0.0, 1.0, 0.035 show36 run37 exit38 #39 save domain_single.stru40 @four domain_single41 @plot domain_single

ple model, simply restricting the transverse modulation wave we haveused in the previous section to an area defined by a sphere (or circlein our 2D example) with a given radius. The modulation wave shallterminate abruptly at the boundary of the sphere. In Fig. 6.10a the re-sulting simulated structure is shown. Atoms represented by solid blackcircles are affected by the modulation wave; all other atoms plotted asopen circles are not displaced from their average position. The dis-placement wave within the circle is identical to the example in Section6.2, i.e. a transverse displacement wave with k in the [10] direction anddisplacements in the [01] direction. The amplitude is |a| = 0.5 Å and thewavelength is λ = 25 Å. The average structure is again of cubic sym-metry with a lattice constant of a = 5 Å and a zirconium atom on (0, 0,0). The radius of the sphere limiting the extension of this displacementwave is 75 Å or 1.5 unit cells. The corresponding diffraction pattern isshown in Fig. 6.10b. At first glance, the diffraction pattern is similarto pattern calculated for the infinite displacement wave shown in Fig.6.7b. The width of the satellites, however, has changed. They appearbroader for the finite wave. We will discuss the resulting intensities inmore detail later after we have had a look at how DISCUS generated thisexample. The tool we use is the domain module of DISCUS to define re-gions within the model crystal. This allows us to restrict the area ofthe modulations. A detailed discussion about domains and all relatingfeatures of DISCUS is given in Chapter 8.

The macro can be divided into two parts, first we create a struc-

Page 92: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.3 Finite waves 81

ture with the desired modulation (lines 1–15) and save the result in thestructure file domain_wave.stru (line 17). This is exactly the way we pre-viously created infinite modulations. The only consideration is to makethe structure larger than the desired largest domain. Now we generatethe host structure (lines 19–20) which in our example is the same as theunmodulated domain structure. In other words we have a cubic struc-ture with a = 5 Å and a zirconium on (0, 0, 0). The next step is to insertthe modulated structure created before as a domain of the desired sizeinto this host structure. This is done in the domain module of DISCUS,which is discussed in much more detail in Chapter 8. In line 26 we spec- File: mod/mod.3.pseudo

1 title Distribution of domains2 spcgr P13 cell 5.00 5.00 5.00 90.0 90.0 90.04 atoms5 D1 0.00 0.00 0.00 0.10

ify the file domain_origin.pseudo containing the origins of the domains tobe created. In our case, this file contains only one domain called d1 at(0, 0, 0). As can be seen from inspecting this file, the format is identicalto DISCUS structure files and to make life simple, the origins are definedin the same cubic metric with a = 5 Å. All the following commands as-sign properties to our domain d1. We specify its shape as a sphere (line25) and remove all host atoms closer than 0.5 Å to the domain (line 27).Next the content of the domain is specified in file domain_wave.stru, themodulated structure we created in part one of this macro. Lines 29–31determine the shape of the domain, in our case a diameter of 15 unitcells or 75 Å in the a and b directions. The orientation of the domainrelative to the host structure is specified in lines 32–34, in our case asimple identity. This formalism is presented in more detail in Chapter8. The command run will then place the domain into the host structureand we are done. In lines 39–41 the structure is saved and macros to

0

40

80

Inte

nsity

0

0.1

0.2

Inte

nsity

0

0.1

0.2

Inte

nsity

0

(c)

(b)

(a) [h 3]

[h 3]

[1.2 k]

1 2 3Direction (r.l.u)

Fig. 6.11 Cross-section of the calculatedscattering from the structure containinga finite displacement wave: (a) parallelh at k = 3, (b) magnified view and (c)cross-section parallel k through satellitesat h = 1.2. The dashed line is αJ2

1.

calculate scattering intensities and export the structure for plotting areexecuted.

Now we have defined the circular area with a radius of 75 Å in themiddle of our crystal as shown in Fig. 6.10a. In order to discuss theresulting intensities in more detail, cross sections parallel to h and kof the calculated scattering pattern are shown in Fig. 6.11. The uppertwo graphs show the resulting intensity along h at k = 3 on differ-ent intensity scales. As for the infinite displacement wave, the satelliteintensities are symmetrical around each Bragg reflection and identicalfrom one Bragg reflection to another (at least in our example where allBragg peaks have the same intensity). However, two differences canbe observed. First the intensity of the satellites is much weaker due tothe fact that only a fraction of the atoms within the crystal are actuallydisplaced. The intensity of the first-order satellites along k is shown inFig. 6.11c. The dashed line is αJ2

1 representing the expected intensityof the satellite. The factor α gives the ratio of the modulated and un-modulated part of the crystal. Note that the Bragg intensity has beennormalized to 100 as in the other examples. The second observationis that the satellites are much broader compared to the infinite wave.The width of the satellites is approximately 0.03 r.l.u. corresponding tothe inverse diameter of our domain of 1

30 ≈ 0.03. Furthermore smallpeaks next to the Bragg peaks and the first satellite can be seen. TheBragg peaks appear broader as well, but a closer look at Fig. 6.11a and

Page 93: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

82 Creating modulations

b shows that additional broader scattering appears at the Bragg posi-tion. Since the average structure is unchanged, the width of the Braggpeaks itself is not affected by the finite wave. The area around the (13)reflection including the first-order satellites is shown in Fig. 6.12a andb on a finer scale. As for finite size contributions from the boundaries

0.8 0.9 1 1.1 1.2[h 3]

0

Inte

nsity

Inte

nsity

0.01

0

0.5

1

Fig. 6.12 Cross-section along h at k =3 through (13) Bragg reflection and thecorresponding first-order satellites (a)and (b) on a 50 times enlarged intensityscale.

of the complete crystal (see Section 4.1.1) this additional scattering iscaused by the limiting boundary of our modulation. More specifically,what we see is the result of the convolution of the scattering amplitudewith the Fourier transform of the limiting circle. The Fourier transformof a circular aperture with radius a is given by

F (h) =1

2πa2 J1(πah)

πah(6.13)

Here h is a radial coordinate in Fourier space and J1 is the first-orderBessel function we already used. This function is similar in form tosin(h)/h (see Section 4.1.1) but has a broader central maximum and itsfirst zero is at 1.22a−1 rather than a−1. This is approximately where weobserve the additional maxima around the Bragg and satellite positionsin Fig. 6.12b.

Obviously the abrupt boundary in our example does not describe avery realistic situation. As a next step we will dampen the displace-ments towards the boundary of the circle. There are two cases to con-sider, large areas where the dampening only affects a small outer shellof the domain and, on the other hand, small areas where we have noor only a very small area showing the full modulation amplitude. Forthe first situation a suitable function to describe the decrease of the dis-placements at the domain boundary would be T (r) ≈ tanh(r). In thecase of the second situation where e.g. the wave might be excited in onepoint and dampen immediately in all directions, a suitable function touse would be a Gaussian G(r). Here we will discuss the latter case. Thegeneral form of a Gaussian is given by

G(r) = A · exp

(−k(r − r0)2

σ2

)(6.14)

The simplest way to simulate such a situation using DISCUS is to gener-ate a dampened wave that is then inserted into the host structure. Themacro shown here will perform this task. The macro expects one pa-File: mod/mod.4.mac

1 #2 # $1 : FWHM of Gaussian distribution3 #4 variable real,width5 variable real,abst6 variable real,damp7 variable integer,at8 #9 width=$1

10 #11 do at=1,n[1]12 abst=blen(x[at],y[at],z[at])13 damp=exp(-4.*ln(2.)*abst**2/width**2)14 y[at]=nint(y[at])15 y[at]=y[at]+damp*(y[at]-nint(y[at]))16 enddo

rameter ($1) specifying the full width at half maximum (FWHM) of theGaussian distribution. In our example we chose σ = 45 Å. Lines 4–7define variables used later and in line 9 the user-specified value for σ isstored in variable width. As we have mentioned before, the origin is inthe center of DISCUS structures. We can simply calculate the distance ofan atom at coordinates x, y, z from the origin using the function blen(line 12). Next we calculate the value of the Gaussian (line 13) based onthe distance from the center and the desired width. Finally the displace-ment in the y direction is reduced by the factor given by the Gaussiandistribution (lines 14–15). Note that the function nint returns the near-est integer value of its argument. This rather simple way of altering the

Page 94: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.3 Finite waves 83

displacement from the average positions might not work for atoms indifferent positions than (0, 0, 0) as in our example. Furthermore foroscillation vectors in other directions, the adjustment of the displace-ments might be somewhat more complex. The resulting scattering of

0.8 0.9 1 1.1 1.2[h 3]

Inte

nsity

0.01

0.02

0.03

0.04

0

Fig. 6.13 Cross-section along h at k = 3through scattering intensity of simulatedstructure with dampened finite displace-ment wave.

this dampened finite displacement wave can be seen in Fig. 6.13. Firstof all the additional scattering around the Bragg peak and the satellitesdue to the sharp circular boundary has disappeared or in fact been re-placed by the Fourier transform of the Gaussian distribution which isagain a Gaussian according to equation 4.24. The satellite intensities aresomewhat smaller due to the fact that the average displacement causedby the wave has been decreased by the dampening.

As a final example of finite waves, we will simulate a distribution ofdomains of different sizes containing a displacement wave. In our casewe want a distribution of spherical domains with a radius of 75± 10 Å.The displacements are identical to the previous example, so we canreuse the domain structure file domain.wave.stru created earlier. The re-

File: mod/mod.5.mac1 read2 cell cell.cll,100,100,13 #4 varible integer,loop5 varible integer,dmax6 varible real,dia7 varible real,dox8 varible real,doy9 #

10 dmax=1011 #12 do loop=1,dmax13 dia=15.0+gran(10.0,f)14 dox=nint(40.0-80.0*(ran(0)))15 doy=nint(40.0-80.0*(ran(0)))16 #17 domain18 reset19 mode pseudo20 input domain_origin.pseudo21 assign char,d1,sphere22 assign fuzzy,d1,1.523 assign content,d1,domain_wave.stru24 #25 assign shape ,d1,1, dia, 0.0, 0.0, dox26 assign shape ,d1,2, 0.0, dia, 0.0, doy27 assign shape ,d1,3, 0.0, 0.0, 1.0, 0.028 #29 assign orient,d1,1, 1.0, 0.0, 0.0, 0.030 assign orient,d1,2, 0.0, 1.0, 0.0, 0.031 assign orient,d1,3, 0.0, 0.0, 1.0, 0.032 show33 run34 exit35 enddo36 #37 boundary hkl, 1, 0, 0, 0.5*100*lat[1]38 boundary hkl,-1, 0, 0, 0.5*100*lat[1]39 boundary hkl, 0, 1, 0, 0.5*100*lat[1]40 boundary hkl, 0,-1, 0, 0.5*100*lat[1]41 #42 save domain_many.stru43 @four domain_many44 @plot domain_many

sulting simulated structure is displayed in Fig. 6.14. The correspondingmacro file is shown here. Again we start with creating a host structure(lines 1–2) and define some variables (lines 4–10). Before we used thedomain module to insert one domain. Now we execute a loop over thenumber of domains we want to insert (line 12). Next we use randomnumbers to generate a domain diameter (line 13) and coordinates forthe origin (lines 14–15). The shape and orientation are defined in lines25–31 using these random numbers and the corresponding domain isinserted. Note that we have made no effort to prevent overlap of do-mains as one can clearly see in Fig. 6.14. Finally the commands in lines37–40 remove all atoms outside of the model crystal. As we mentionedbefore, many more details about the domain module of DISCUS can befound in Chapter 8.

[ 0

k]

0

1

2

(b)(a)

0 1 2

[h 0]

Fig. 6.14 Simulated structure with multiple domains containing finite displacementwaves.

Page 95: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

84 Creating modulations

This brings us to the end of the modulation examples. These exam-ples could be easily extended to include different phases or different

0

50

100

Inte

nsity

0

25

0 1 2 3

Direction (r.l.u.)

(a)

(b) [1.14 k]

[1 k]

50

Inte

nsity

Fig. 6.15 Cross-sections of the calculatedscattering from the modulated structure:(a) intensity parallel to k at h = 1.The dashed line is J2

0. (b) Cross section

through satellites at h = 1.14 parallel tok. The dashed line is J2

1.

–0.1

0.1

0

0

(b)

(a)

0

20

40

60

80

100

0 1 2 3

[h 2]

3 4 521 6 7 8 9 10

x [l.u.]

y [l

.u.]

Inte

nsity

Fig. 6.16 (a) Cross section parallel to k ath = 2 through scattering from a struc-ture showing a sinusoidal transverse dis-placement wave with a wavelength ofλ = 15Å (for details see text). (b) Partof the modulated structure showing dis-placed atoms and the sinusoidal modula-tion (dashed line) and a triangular modu-lation (solid line) describing the displace-ments equally well.

orientations of each domain and we leave it to the reader to continueexperimenting. In the next section we will discuss some of the prob-lems that can occur when simulating modulations and quite frequentlydid during the preparation of this book.

6.4 Pitfalls when simulating modulations

The examples we have shown so far in this chapter were carefully cho-sen to give the expected results. However, satellites are sharp featuresin reciprocal space and accompanied by various difficulties when sim-ulating them using a computer model. Some of these problems will bediscussed in this chapter and some "not so perfect" examples will begiven.

When simulating waves that extend over the complete crystal, theresulting satellites are as sharp as the Bragg reflections. The width isgiven by the reciprocal size of the model crystal. Subsequently if thesatellite positions do not coincide with the grid the Fourier transform iscalculated on, the resulting satellite intensities might appear too small.If the chosen grid in reciprocal space is broader than the width of thesatellites, they might not show up at all. In the examples in Section 6.2the chosen wavelength of the displacement wave of λ = 25 Å or 5 unitcells resulted in satellite positions at ±0.2 r.l.u. exactly correspondingto a grid point of the calculated Fourier transform. In Fig. 6.15 we showthe same example but using a wavelength of λ = 35 Å or 7 unit cells.

The intensity dependence of the Bragg reflections (Fig. 6.15a) followsexactly the expected behavior indicated by the dashed line. However,the satellite intensities (Fig. 6.15b) are systematically smaller than theexpected values shown as the dashed line. The reason is that the satel-lite positions of ± 1

7 = ±0.1428 . . . around the Bragg peaks do not coin-cide with the grid the Fourier transform is calculated on. Subsequentlywe do not see the true maximum of the satellite intensity as can be seenin Fig. 6.15b.

Another common pitfall occurs when simulating "easy" examples.Care needs to be taken to ensure that the wavelength λ of the mod-ulation wave is sufficiently large that the displaced atoms reflect thecharacter of the modulation wave. Figure 6.16a shows the scatteringof a structure containing a sinusoidal transverse displacement wavesimilar to the examples in Section 6.2. The only difference is that thewavelength is set to λ = 15 Å or 3 unit cells. However, the satellites inFig. 6.16a at positions ±m

λ k have clearly different intensities in contrastto the expected behavior. This can be understood when looking at Fig.6.16b. For this particular wavelength the displacement of the atoms canbe described by the (desired) sinusoidal wave shown as the dashed lineor alternatively by a triangular wave plotted as a solid line. However,the characteristic of an asymmetric triangular wave is the fact that the

Page 96: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

6.5 Bibliography 85

satellites at ±hsat have different intensities. This is obviously a veryspecial case but it shows the type of problem one can run into whenthinking of simple demonstration examples.

Some hints concerning the calculation of the Fourier transform itselflike avoiding finite size effects or the usage of "lots" were already dis-cussed in Section 4.1.2.

6.5 Bibliography

[1] J.A. Reissland, The Physics of Phonons, John Wiley & Sons Ltd, 1973.[2] R.L. Withers, S. Schmid, J.G. Thompson, Compositionally and/or

Displacively Flexible Systems and their Underlying Crystal Chem-istry, Prog. Solid St. Chem. 26, 1 (1998).

[3] H. Böhm, Eine erweiterte Theorie der Satellitenreflexe und die Bestim-mung der Modulierten Struktur des Natriumnitrits, Habilitation thesis,Universität Münster, Germany, 1977.

[4] M. Korekawa, Theorie der Satellitenreflexe, Habilitation thesis, Uni-versität München, Germany, 1967.

[5] J.M. Pérez-Mato, G. Madariaga, M.J. Tello, Diffraction symmetryof incommensurate structures, J. Phys. C: Solid State Phys. 19, 2613(1986).

Page 97: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

86 Creating modulations

Exercises(6.1) Simulate a structure modulated by two harmonic

density waves with different wavevectors ki andwavelengths λi, i = 1, 2. The starting structureshould be the same as used in the example in Sec-tion 6.1. Where do you expect satellites, and whatwill be their intensity ? Verify your expectationswith the simulation results.

(6.2) The density wave discussed in Section 6.1 modu-lates the scattering density of an atom on a givensite. Use DISCUS to simulate a modulated struc-ture with two sites at (0, 0, 0) and at (0, 1

4, 0) oc-

cupied by zirconium with an average occupancy ofc1 = c2 = 0.5. The occupancy of site one, c1, shall bemodulated by a sinusoidal wave in the [100] direc-tion. The occupancy of site two shall be c2 = 1 − c1

in each unit cell. Derive an analytic expression forthe scattering intensity for this type of modulationand compare it to the simulation results. How doesthe result compare to the situation of a density wave

operating on a single site?

(6.3) Change the wavevector k of the example of a trans-verse displacement wave given in Section 6.2 to [11].What scattering pattern do you expect? Run thesimulation and verify your answers.

(6.4) Use DISCUS to simulate one finite displacementwave that is limited by a square box rather thana sphere. What difference in the resulting diffrac-tion pattern do you expect compared to the exam-ple given in Section 6.3? Vary the size of the boxand compare the results.

(6.5) Replace the Gaussian in the example of a dampenedfinite displacement wave discussed in Section 6.3 bya tanh(r) type of dampening and vary the size ofthe domain. What change in the scattering patterndo you expect? Verify your answers by running thecorresponding simulation.

Page 98: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Creating structures withstacking faults 77.1 Types of stacking faults

Stacking faults are another type of defect often observed in crystals.They are very commonly found in two classes of crystal structures,namely those derived from the cubic and hexagonal closed packing andthose built up from layer-like structural units. Examples of the firstclass are found among the metals, and especially in compounds likeSiC, ZnS and CdI2. Examples of the second class are graphite and thesheet silicates. All these crystal structure can be described as a stack-ing of two-dimensional layers. Both within the layer, as well as alongthe axis normal to the layer, the ideal crystal structure is strictly peri-odic. A stacking fault can be defined as any deviation from the periodicsequence along the direction normal to the layers.

a

b

B

C

B

A A

C

Fig. 7.1 Relative location of atoms in closepacked layers. The continuous circlesrepresent the atoms in one close packedlayer defined as location A at (0, 0) withinthe hexagonal unit cell. The coarsely bro-ken circles represent the possible locationof an adjacent layer type B at (1/3, 2/3)and the finely broken circles the locationC at (2/3, 1/3).

In the close packed structures and their derivatives, identical layersare stacked upon each other. In the case of close packed metals, eachlayer consists of a hexagonal close packing of atoms, and thus thesestructures are best described in a hexagonal unit cell. The first layercan be placed at the position 0, 0, 0 within this hexagonal cell. The nextlayer will form a close packing, if it is located on top of the first layer ateither 1/3, 2/3, z, marked B or at 2/3, 1/3, z, marked C in Fig. 7.1. Inthe ideal close packed structure, the distance between two atoms witha layer and an atom in the next layer is identical. This is fulfilled, if theratio between the a-axis and the distance of two layers along the c-axisis equal to

√(4/3).

The simplest periodic structure is a alternation of layers at positionA and position B. This is the hexagonal close packed structure foundin many metals. Its space group is P63/mmc with an ideal c : a ra-tio of

√(8/3) and the atoms at site 2b: 1/3, 2/3, 0 and 2/3, 1/3, 1/2.

Since each layer has strict hexagonal symmetry, the vectors from anA layer to a B layer are [1/3, 2/3, 1/2], and its symmetrically equivalentvectors [1/3,−1/3, 1/2] and [−2/3, 1/3, 1/2]. Equivalently, the vectorsfrom an A layer to a C layer are [2/3, 1/3, 1/2], or [−1/3, 1/3, 1/2], or[−1/3,−2/3, 1/2]. Any combination of an AB and an AC vector willbe just as good. In this chapter we will usually refer to the pair AB:[1/3,−1/3, 1/2] and AC: [−1/3, 1/3, 1/2]. For this pair, the respectivecomponents along the a and b axes best reflect the alternation between

87

Page 99: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

88 Creating structures with stacking faults

A and B layers that is characteristic of the hexagonal close packed struc-ture.

The next simple structure type is a periodic stacking of three layersat positions ABC, which corresponds to the cubic close packed struc-ture. Copper is the typical representative of this structure class. Thespace group is Fm3m, with the copper atom at position 4a: 0, 0, 0. Astacking fault with respect to these two structures would be any de-viation of the stacking from the ideal ABAB. . . or ABCABC. . . stackingsequence. However no two adjacent layers may be in the identical posi-tion. Thus a sequence of ABACABAB may be observed in a hexagonalclose packed structure, while a sequence ABBA would not occur. Theposition of two adjacent layers in the AA, BB, or CC positions wouldplace the atom exactly on top of each other rather than on top of the tri-angular voids in the previous layer. This would shift the second layerfurther apart and is energetically much less favorable than an AB or ACsequence.

All layered silicates consist of layers composed of corner sharingSiO4 tetrahedra that build hexagonal rings and edge sharing AlO6 oc-tahedra. The octahedral sheet can also be considered to consist of twolayers of close packed oxygens, while the Al ions occupy a part of theoctahedral sites between these two layers. Considerable chemical vari-ety is realized by replacing Si and Al with other ions. These two blockscan be attached to each other in several ways. In the simplest layeredsilicate, kaolinite, just one tetrahedral sheet and one octahedral sheetare connected via common oxygen atoms. In most layered silicates,a central octahedral sheet is sandwiched in-between two tetrahedralsheets. Depending on the net charge of these packages, additional ionsare located between successive layers. Despite the large variation alongthe c-axis, the ab-planes of most layered silicates are fairly similar, a re-sult of the tetrahedral layer. Thus, intergrowth of different layered sili-cates can occur, creating a complex pattern of stacking faults. A simplerpattern can occur as well if successive layers are shifted with respect toeach other. In kaolinite, for example, if the layers are shifted by approx-imately b/3, almost the same pattern of hydrogen bonds between thelayer packages results as for a regular stacking.

Stacking faults in layered materials may arise during crystal growthor by deformation of an already grown crystal. Corresponding namessuch as growth fault and deformation fault exist in the literature.

7.1.1 Growth faults

... A B A B A B C B C B C B ...

... + - + - + + - + - + - ...

... h h h h h c h h h h h h ...

The first concept of stacking fault simulation closely resembles the crys-tal growth process. In this simulation layers are stacked on top of pre-vious layers. A stacking fault results, if a layer is added at the wrongposition during the growth, respectively the simulation of the crystal.After this fault, the crystal continues from this layer again in a peri-odic fashion. For the hexagonal close packed structure 2H such a faultis shown in the margin. Prior to the first C-type layer the strict alter-

Page 100: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.1 Types of stacking faults 89

nation of inter-layer vectors, as depicted by the "+" and "−" signs isinterrupted and then continues with a phase shift. The letters h andc symbolize a hexagonal or cubic translation vector, respectively. Al-ternatively speaking, the B layer prior to the first C layer is in a cubicenvironment, since its neighbors to the left and to the right are at dif-ferent positions. A growth fault in the cubic close packed structure isshown here. In the cubic close packed structure, each layer is shifted in

... A B C A B C B A C B A C B ...

... + + + + + - - - - - - - ...

... c c c c c h c c c c c c c ...

the same direction as the previous ones. As a result each layer is in adifferent position from the previous two layers. At the growth fault, thedirection of the interlayer vector reverses, and the structure continueswith a layer that is in the identical position to the second last layer. Asa consequence, the structure continues to grow in the twinned orienta-tion.

The type and position of the current layer is determined by the typeof n previous layers. Often, it is sufficient for this Reichweite n to be German for reach or range

equal to one. Periodic faults can be created with n > 1.

7.1.2 Deformation faults... A B A B A B A B A B A B ...... + - + - + - + - + - + ...... h h h h h h h h h h h h ...

into

... A B A B A B C A C A C ...

... + - + - + + + - + - + ...

... h h h h h c c h h h h ...

Deformation faults result if one part of the crystal is shifted parallel tothe layers with respect to the other part. In the case of the close packedstructures, the shift is equivalent to the projection of the ordinary in-terlayer vector [1/3,−1/3, 1/2] into the ab-plane i.e. it is the vector±[1/3,−1/3, 0] and its symmetrically equivalent vectors ±[1/3, 2/3, 0]and ±[2/3, 1/3, 0]. Each of these vectors shifts an A layer into a B orC layer, and correspondingly shifts a B or C layer. Accordingly, sucha shift would change a hexagonal close packed 2H structure as shownin the margin. This is achieved by shifting all layers on the right of thesixth layer along the shift vector [-1/3, 1/3, 0]. Compared to the growthfault, two adjacent layers disrupt the strict alternation of the interlayervector.

... A B C A B C A B C A B C ...

... + + + + + + + + + + + ...

... c c c c c c c c c c c c ...

into

... A B C A B C B C A B C A B ...

... + + + + + - + + + + + + ...

... c c c c c h h c c c c c c ...

The corresponding fault in the case of the cubic close packed struc-ture 3C changes the perfect periodic structure as shown here. Here, theseventh layer should have been an A layer. This layer, and all layer tothe right are shifted by [-1/3, 1/3, 0]. Between the sixth and the seventhlayer, the direction of the inter layer vector changes, but then returns tothe same direction as before the fault. As a consequence, the sixth andthe seventh layer can be considered to be in a hexagonal environment,since their respective neighbors are of the same type. The deformationfault can also be considered as a special type of growth fault, where twogrowth faults occur right next to each other.

7.1.3 Stacking fault parameters

These examples illustrated some of the aspects that have to be consid-ered when simulating a structure with stacking faults. A more formallist of aspects includes:

Page 101: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

90 Creating structures with stacking faults

• types of layers, including a complete list of atoms;• translation vectors from one layer to another;• transition probabilities by which one layer type is stacked on top

of a given layer type with a given translation vector;• number of previous layers that determine the type of the next

layer, often called the Reichweite.

Any simulation of a crystal with stacking faults has to define parame-ters for these aspects. Depending on the stacking fault type present, thesimulation will then have to build a crystal layer by layer or to modifyan existing crystal.

7.2 Notations for stacking sequences

Particularly for the packing of close packed structures and their deriva-tives, several notations have been developed to describe the sequenceof layers. Here a selection of the most common notations is given; for amore complete listing see [1].

ABC notation

Probably the most well known is the ABC notation, implicitly used inthe introduction. This notation refers to the positions of layers, ratherthan to the vectors between the layers. In the hexagonal unit cell the A,B, and C layers correspond to layers whose atoms are on the positions0, 0, z, 1/3, 2/3, z, and 2/3, 1/3, z, respectively. A modification of theABC notation is used for derived structures like the ZnS modificationszincblende and wurtzite. In this modified notation, capital Latin lettersrefer to the position of one atom type, or more general building block,while small Greek letters refer to the position of the other atom type.Thus the wurtzite structure would be referred to as AαBβAαBβ. . . andthe zincblende structure as AαBβCγAαBβCγ. . .

Ramsdell notation

In this notation [2], the number of layers in a periodic structure andtheir lattice type are given. Thus the notation nH refers to a structurewith primitive hexagonal lattice and n layers in the unit cell, while nRrefers to a structure with rhombohedral unit cell. The Ramsdell nota-tion is applicable to periodic structures only.

Hägg notation

The Hägg notation [3] describes a stacking sequence of close packedstructure with reference to the vectors between two successive layers.Using a hexagonal unit cell, the sequence of layers ABCA always corre-sponds to the vector [1/3,−1/3, z], while the sequence of layers ACBAcorresponds to the vector [−1/3, 1/3, z]. Hägg used a plus sign "+" to

Page 102: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.3 Reciprocal space of layered structures 91

denote the first sequence and a minus sign "−" for the second. Thus aperfectly periodic ABCABC sequence is described as "+ + + + + + . . .",a periodic hexagonal sequence ABAB. . . as "+ − + − . . .". Alternativesymbols have been used for these stacking sequences like δ [4] or "0"instead of the "+" sign and ∇ or "1" for the "−" minus sign.

Notations in this book

Any of these notations can be used to derive the positions of the atomsin a simulated crystal. The main disadvantage of all these notationsis, however, that they are applicable only to a specific crystal structureand stacking type. In order to simulate any disordered crystal, we usea description that can be applied to basically any sequence of layers.Before the description scheme is given in detail, we need to point outa few points regarding the simulation of disordered layer sequences.First, the number of layers in a disordered crystal must be large. Onlyfor a large number of layers will the transition probabilities from layerto layer determine the diffuse scattering. For a small number of layers,the actual sequence of layers may differ from one simulation to the next,even if the transition probabilities are identical. Keep in mind the dis-cussion on coherence in Chapter 4. Since a large number of layers maybe required to create a proper representation of the stacking sequences,the high frequency oscillations mentioned in Chapter 4 may also occurand it can be tedious to separate these effects. As a consequence, onemight have to calculate the Fourier transform using very large lots or torepeat the simulation several times and to average the resulting diffrac-tion pattern. Secondly, a shift of the whole crystal, even by a randomvector, does not affect the diffuse intensity. This shift will, of course,produce a phase shift of the diffuse scattering. Since the main scope inthis chapter, however, is the calculation of the intensity, this phase shiftis of no importance.

Keeping these two points in mind, it is not really important at whichactual coordinates a given layer is within the simulated crystal. Themain point is to specify the vector between two adjacent layers, andto specify the probability with which a layer type follows on top of aprevious layer or on top of a sequence of previous layers.

7.3 Reciprocal space of layered structures

In the examples in this book we will limit ourselves to structures thatconsist of a stacking of plane layers. The two-dimensional periodicitywithin each layer is considered to be perfect. Thus we exclude struc-tures in which the layers are of finite extent or bend around like onewould find in a structure with edge dislocations. Here a particular layerdoes not extend all the way across the crystal and the adjacent layerswill close the gap.

The limitation imposed by a stacking of periodic plane layers is of

Page 103: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

92 Creating structures with stacking faults

great consequence for the intensity distribution in reciprocal space. Toexplain this consequence, we will start with the simple model of astacking of close packed layers. Here all layers are identical to eachother. Without loss of generality, we can define the a and b-axis to bewithin this layer and the c-axis to be normal to the layer. The positionof all atoms within the crystal is therefore completely described by de-scribing the atomic position within one layer with respect to a freelychosen origin and the location of each layer’s origin within the three-dimensional crystal. We can essentially create the location of all atomsby convoluting the list of origins with the content of one layer. We canuse the convolution theorem (see Section 4.4) to determine the intensitydistribution in reciprocal space as well as speeding up the actual calcu-lation. The Fourier transform of the convolution of two function g andh is equal to the product of the individual Fourier transforms G and H :

F (g ⊗ h) = F (g) · F (h) = G · H (7.1)

The Fourier transform of a single two-dimensionally periodic layer con-sists of rods of intensity parallel to c*, i.e. normal to the layer at integerh, k values. The Fourier transform of the list of origins will, in general,be a continuous function in reciprocal space. Since the Fourier trans-form of the layers is zero except along the rods normal to the layer theproduct of the two Fourier transforms will only be non-zero along theserods. The exact intensity distribution along the rod depends on the po-sition of the origins as well as on the structure factor of the layer alongthis rod. The effect of stacked layers is thus confined to rods parallel toc* through integer values of h and k.

From a computational point of view, the convolution also offers atremendous increase in computational speed. Since the Fourier trans-form of the full crystal can be calculated as the product of the Fouriertransform of the list of origins and the Fourier transform of one layer, itis sufficient to simulate the list of origins and just one layer instead ofthe full crystal. Since this is only a fraction of the number of atoms thatwould be present in the fully simulated crystal, the simulation and thecalculation of the Fourier transform are accordingly much faster.

A crystal that consists of different layers that still have the same two-dimensional periodicity and only differ in their composition or the po-sition of the respective atoms can be described similarly. Now, the fullcrystal consists of the sum of two terms, which are by themselves iden-tical to those described in the previous part of this section. The Fouriertransform of a sum is the sum of the individual Fourier transforms.Since both layer types have the same periodicity along a and b, theirFourier transforms are both non-zero only for integer values of h andk and the total Fourier transform is again non zero only along rodsnormal to the planes through these integer h and k values. Since the in-dividual Fourier transforms will in general be complex numbers, theyhave to be added accordingly, which does not, however, change thelimitation to integer h and k values. Since we are limiting ourselves to

Page 104: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.4 Algorithms to simulate stacking faults 93

structures that consist of two-dimensional layers, all with the identicalperiodicity in the ab-plane, another huge computational gain is possi-ble. As pointed out in Chapter 4, the structure factor of a single unitcell and of a complete periodic crystal are identical at integer valuesh, k, l, except for the pure scale factor given by the number of unit cells.Accordingly, if we limit our calculation in reciprocal space to integerh, k values, it is sufficient to simulate a layer that consists of just oneunit cell! Except for the scale factor, the Fourier transform calculatedalong the rods at integer h, k does not differ between that of a crystalthat consists of these miniature layers and that of a full crystal. As anexample, the same intensity distribution results for these two extremes:on the one hand a full crystal that consists of 100 000 layers each of 50 x50 unit cells with one atom per unit cell and thus of 250 000 000 atoms,and on the other hand a list of 100 000 origins and one single atom!

This idealization only holds, if the two-dimensional periodicity isvalid. If the layers are of finite extent, or if not all of them are all strictlytwo-dimensional, or if they are nor strictly periodic, the intensity dis-tribution in reciprocal space will be more general. Fairly often, finitestructural coherence exists within the layer. As long as the periodicitystill holds within each structurally coherent block, we can describe sucha layer as the product of an infinite layer with a shape function, whosevalue is one inside the finite layer and zero outside. The Fourier trans-form will accordingly be the convolution of the Fourier transform of aninfinite layer and the Fourier transform of the shape function. The de-tails depend on the exact shape function, but in general this will causethe Bragg reflections to be widened; see also the discussion of finite sizeeffects in Chapter 4. In this case one has to either calculate the Fouriertransform in a rod of finite diameter around integer h, k positions orconvolute the line through integer h, k positions by an appropriate pro-file function.

7.4 Algorithms to simulate stacking faults

In the following we will limit ourselves to a stack of perfectly peri-odic plane layers. This reduces the simulation to the creation of a one-dimensional sequence of different layer types. The different pairs oflayer types that may contain a different two-dimensional structure andthe different vectors from one layer to the next can all be combined intoone order scheme. Each pair of layer types and each vector connectingthis particular pair can be encoded by a symbolic name. The simulationtask then reduces to creating a specific order of theses symbolic names.In the second step, each of these names will then be replaced by theappropriate atoms.

Over the last 60 years the general theory of diffraction by layeredmaterials with stacking faults has been developed by several authors,see Wilson [5], Hendricks and Teller [6], Jagodzinski [7, 8, 9], Pater-son [10], Christian [11], Johnson [12], Allegra [13], Kakinoki and Ko-

Page 105: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

94 Creating structures with stacking faults

mura [14]. Good solutions exist, however, only for basic 3C and 2Hstructures. The theoretical descriptions for more complex polytypesand disordered structures with long-range interactions are much morecomplex, see Sebastian and Krishna [1] and references therein. Thesehave also been worked out for disordered structures that occur duringphase transitions; Pandey et al. [15, 16, 17, 18, 19] and Sebastian et al.[20, 21, 22, 23, 24, 25]. A thorough overview of the scattering theory forlamellar system, like layered silicates, graphite, and mixed-layer min-erals, is given by Drits and Tchoubar [26] and references therein. Sincemost of these minerals occur only as microcrystals, the theory is lim-ited to the calculation of the powder pattern. It includes, however, fi-nite thickness effects, and further stacking fault types like random androtational faults.

To describe the diffuse scattering by more complex structures, MonteCarlo simulations have been applied by Berliner and Werner [27], Kabra& Pandey [28], Nikolin andBabkevich [29] Shresta et al. [30], Babkevichet al. [31], Shrestha and Pandey [32], and Gook [33, 34]. These simula-tions include a growth fault-like approach, where faults are introducedinto the crystal from one end to the other, as well as approaches simi-lar to deformation faults, where faults are introduced into a crystal in arandom sequence both in time and space.

The basic assumptions made in all theoretical approaches and also inthe Monte Carlo simulations by Gook [33, 34] include perfectly periodiclayers free of other distortions, and identical layer types (at least forstructures derived from close packed structures). Another importantrestriction is the assumption that the interlayer distance is identical forall layer pairs. This limitation does not apply to the simulation of dis-ordered structures, and we can simulate structures with different layertypes, whose interlayer spacing differs. This situation is encountered,for example, for mixed layer minerals or during the phase transition oflayered silicates.

7.4.1 Growth faults

In the simulation of a crystal with growth faults, layers are added oneby one to an existing crystal. The type and the translation of the cur-rent layer is determined by the type and translation of the n previ-ous layers. This simulation process corresponds to a one-dimensionalMarkov chain [35]. Two different algorithms are used to create sucha one-dimensional Markov chain. In the first algorithm, two differentstates may exist, a state A and a state B, which are assigned numeri-cal values of xA = 1 and xB = 0. Although there are three differentlayer positions, A, B, and C in close packed structures, these two statesare sufficient to simulate close packed structures with random growthfaults. In the case of growth faults in closed packed structures, thesestates would correspond to a vector between adjacent layers of A =[1/3,−1/3, 1/2] and B = [−1/3, 1/3, 1/2], rather than corresponding tothe absolute position of an individual layer. The Markov chain deter-

Page 106: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.4 Algorithms to simulate stacking faults 95

mines the probability that a state x at position i − 1 is followed by astate A at position i by:

P (xi−1|xi = A) = α + βxi−1 (7.2)

where α and β are parameters that determine the pair probabilities.For α = 1 and β = −1, the probability of AA pairs is 0 and that of ABpairs is 1, while for α=0 and β=1, the probability of AA pairs is 1. Thusthe first set of parameters would create a periodic ABAB. . . sequencewhile the second would create a periodic AAA. . . sequence. Since thesestates A and B correspond to the vector between adjacent layers, thefirst sequence corresponds to a hexagonal close packed sequence, whilethe second corresponds to the cubic close packed sequence.

The parameters α and β are related to the relative number of A statesand the pair correlation parameter defined in Chapter 5 by:

mA = α/(1 − β) (7.3)C = β (7.4)α = mA(1 − β) = mA(1 − C) (7.5)

An alternative, completely equivalent algorithm specifies the probabil-ities of pairs in the form of a matrix:

(PAA PABPBA PBB

)=

(α + β 1 − α − βα 1 − α

)(7.6)

Both algorithms can be expanded to include the influence of more dis-tant layers, i.e. a Reichweite n > 1. In terms of the Markov chain, thiswould give in its most general form:

P (xi−1, xi−2|xi = A) = α + βxi−1 + γxi−2 + δxi−1xi−2 (7.7)

The matrix form would require a 2 x 2 x 2 tensor whose elements Pijk

give the probability that the current layer is of type i, if the previouslayer is of type j and the previous but one layer is of type k. The tensoralgorithm can also very easily be expanded to include more than twostates. This is simply done by expanding the size of the tensor alongeach dimension to the number of different layers.

7.4.2 Deformation faults

To create a growth fault, one initially simulates a perfectly periodiccrystal. In the second step, one layer is chosen and all atoms in thislayer are shifted by the chosen shift vector. The same shift is appliedto all atoms in the crystal that are on one side of the layer. If the layerconsists of the ab-plane, this shift is thus applied to the chosen layer

Page 107: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

96 Creating structures with stacking faults

and all layers with either a higher or lower z component along the c-axis. Periodic boundary conditions are, of course, not applied. As waspointed out for the Fourier transform, the computational effort can sub-stantially be reduced by operating on the list of layer origins rather thanoperating on the final crystal. With this approach, one initially simu-lates a perfectly periodic list of layer origins. This list would consistof M different atom types, as each atom type represents a combina-tion of the encoding for a specific layer type and its translation vectorfrom a previous layer type. Within this list, one atom, representing onelayer, is chosen at random. To simulate the shift, the type of this atomis changed so that its new type reflects the identical layer type but dif-ferent translation vector.

The atom type of all atoms to one side of the stacking fault is thenchanged such that the relation between two immediate neighbors re-mains the same as in the ideal crystal. The exact realization of this stepdepends on the encoding of the layer type and translation vector, as il-lustrated by the deformation fault in the cubic closed packed structure3C. The ideal sequence now changes as shown here. If the encoding

... A B C A B C ...

... + + + + + ...

into

... A B C B C A ...

... + + - + + + ...

reflects the three layer positions A, B, and C, then all atom types in theright half of the crystal must be changed according to: A → B, B→ C,and C → A. The simulation becomes easier, if the encoding reflects sim-ply the interlayer vector, [1/3,−1/3, 1/2] or [−1/3, 1/3, 1/2], or in theHägg notation "+", "−", as shown in the second line of the sequences.Now, one only has to change the inter layer vector at the stacking fault,while all other vectors remain unchanged. In terms of the simulation,this means that just one atom type is changed!

Stacking fault probabilities with independent, randomly distributeddeformation faults are taken into account by repeating this process forseveral layers.

7.4.3 Ordering of faults

As a third alternative algorithm to strict growth or deformation faultformation, one can also use the short-range order concepts developedin Chapter 5 to create a sequence of layers with variable amounts ofstacking faults.

As the first step N different states are defined, which each representa possible layer type or combination of layer type and interlayer vector.These states are then ordered according to the required scheme, whichcan include interactions beyond Reichweite 1. To model stacking faultsin close packed structures, one could define the states as layer types A,B, and C, each located at the corresponding origin. The order schemewill have to sort these into the required order, while ensuring that pairsof equal layer types are absent. The stacking of close packed layerscan, however, be achieved in an easier fashion. As is obvious fromthe Hägg notation, it is sufficient to define two different states, thatcorrespond to interlayer vectors [1/3,−1/3, 1/2] and [−1/3, 1/3, 1/2].By stacking these states on top of each other, no two adjacent layers will

Page 108: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.5 Example: Growth faults 97

be in the identical position and any random sequence between the purehexagonal close packed structure and the cubic close packed structurecan be simulated. To simulate structures with longer periodicities, oneneeds to define pair correlations that correspond to first and secondneighbor or even longer interactions.

If an Ising model is used as in Chapter 5, one is free to define thedesired pair correlation values or to use fixed energies for the orderingscheme. Using the close packed structures as an example, by setting theAA interaction energy to a very high positive value will effectively pre-vent any such pairs. Once the states have been sorted in the requiredform, the type and coordinates of each state are saved and later on in-terpreted as origins of the actual layers.

7.5 Example: Growth faults

In this first example, we will develop the simulation of a close packedstructure with random growth faults along one direction. Thus eachlayer consists of a hexagonal close packing of atoms. It will not changethe sequence of layers nor the resulting diffraction pattern, if we de-scribe this layer within a hexagonal or within a cubic coordinate sys-tem. In a hexagonal setting the layer would be the 001 plane of thehexagonal cell and the stacking direction is the c-axis, while in the cu-bic setting the layer would be any of the {111} planes and the stackingdirection the corresponding normal i.e. the [111] direction. In the File: stack/hexagonal.cell

1 title Primitive hexagonal cell2 spcgr P63 cell 1.0, 1.0, 1.6329932, 90., 90., 120.4 atom5 Co 0.0000, 0.0000, 0.0000, 0.2000

File: stack/stack.01.mac1 # stack.01.mac2 #3 read4 cell hexagonal.cell, 1, 1, 15 #6 stack7 layer hexagonal.cell8 layer hexagonal.cell9 trans 1,1, 1./3.,-1./3., 1./2

10 trans 1,2,-1./3., 1./3., 1./211 trans 2,1, 1./3.,-1./3., 1./212 trans 2,2,-1./3., 1./3., 1./213 distr matrix14 crow 1, 0.00, 1.0015 crow 2, 1.00, 0.0016 number 1217 #18 aver 0.00, 0.00, 1.0019 modul 1.00, 0.00, 0.00, 0.00, 1.00, 0.0020 set modulus,off21 set trans,fixed22 #23 create24 run25 exit

hexagonal setting, we start with a unit cell in space group P6 with unitcell length c : a =

√8/3. The c : a ratio is chosen to reflect the com-

plete cell of the hexagonal close packed structure, which contains anatom at 0, 0, 0 and a second at 1/3, 2/3, 1/2. Rather than the true spacegroup P63/mmc, the space group P6 was chosen in order to be able toexpand the asymmetric unit of this starting configuration into a largestrictly two dimensional layer that contains only one atom along the c-axis. Equally well, one could use the true space group P63/mmc, andexpand this to a large slab in the ab-plane. This slab would, however,consist of two layers one at z = 0.0 and a second at z = 0.5. Since thesimulation shall create sequences of layers with one atom thickness,this approach would require an additional step, in which the secondlayer of atoms is removed before using the slab as a building block ofthe simulation.

First we will create a crystal with perfect hexagonal structure. In thisstructure the vector from an A-type layer to a B-type layer is tAB =(1/3,−1/3, 1/2), and the corresponding vector from a B-type layer toan A-type layer is tBA = (−1/3, 1/3, 1/2). By defining just these twovectors as translation between two successive layers in lines 9 through12 in the macro, two adjacent layers are always shifted in the ab-planewith respect to each other. In other words, an AA, BB, or CC sequence isimpossible in this simulated crystal. Since all layers are identical exceptfor their horizontal position, we define two identical layer types in lines

Page 109: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

98 Creating structures with stacking faults

7 and 8, which in turn allows us to define two different vectors betweenthese layer types. Just to start off, each layer consists of just one atom!Lines 14 and 15 give the first and second row of the correlation matrixFile: stack/stack.01.list

1 0.0000 0.0000 0.00002 0.3333 -0.3333 0.50003 0.0000 0.0000 1.00004 0.3333 -0.3333 1.50005 0.0000 0.0000 2.00006 0.3333 -0.3333 2.50007 0.0000 0.0000 3.00008 0.3333 -0.3333 3.50009 0.0000 0.0000 4.0000

10 0.3333 -0.3333 4.500011 0.0000 0.0000 5.000012 0.3333 -0.3333 5.5000

that defines the probabilities for one of the translation vectors betweentwo adjacent layers to be chosen.

Pij =

(0 11 0

)(7.8)

By setting the diagonal elements of the matrix to zero, the vectors asso-ciated with a sequence of layer type 1 followed by layer type 1, and thelayer sequence 22 are never chosen. Instead, the program will alwayschoose the layer sequence 12 and 21, lines 10 and 11 in the macro. Theresulting crystal will consist of N atoms at positions listed in the mar-gin, where the number of layers N is defined in line 16 of the macro.The atom positions printed in the margin show that the x, y coordinatesof the layers alternate between integer x, y values and x = 1/3, y = 2/3,i.e. a strictly periodic ABAB. . . structure. If the correlation matrix inlines 14, 15 of the macro had been set to:File: stack/stack.h0l.mac

1 # stack.h0l.mac2 #3 variable real,prob4 prob = 0.155 #6 read7 cell hexagonal.cell,100,100, 18 #9 save

10 outf hexagonal.layer11 run12 exit13 #14 fourier15 ll -0.5,-3.0,-0.516 lr 3.5,-3.0,-0.517 ul -0.5,-3.0, 4.518 na 20119 no 25120 abs h21 ord l22 neut23 temp ignore24 exit25 #26 stack27 layer hexagonal.layer28 layer hexagonal.layer29 trans 1,1, 1./3.,-1./3., 1./230 trans 1,2,-1./3., 1./3., 1./231 trans 2,1, 1./3.,-1./3., 1./232 trans 2,2,-1./3., 1./3., 1./233 #34 crow 1, prob, 1.-prob35 crow 2, 1.-prob, prob36 number 400037 #38 aver 0.00, 0.00, 1.0039 modul 1.00, 0.00, 0.00, 0.00, 1.00, 0.0040 set modulus,on41 set trans,fixed42 exit43 #44 stack45 create46 four47 exit48 outp49 outfil "stack.h0l.%4.2F.inte",prob50 run51 exit

Pij =

(1 00 1

)(7.9)

each type 1 layer would always be followed by another type 1 layerseparated by the vector [1/3,−1/3, 1/2] and thus a periodic ABCABC,i.e. a cubic close packed structure would be simulated. If the first layeris a type 2 layer, the twinned sequence ACBACB would result.

Since the translation vectors for 11. . . and 22. . . sequences always re-main constant, the position of successive layers in a cubic closed packedstructure continually shifts in the [110] direction, effectively creating aslanted crystal. As pointed out earlier, this horizontal shift does not af-fect the intensity distribution in rods parallel to c* calculated at integerh and k values. To plot the crystal and if we later on need to determinethe average environment around different atoms, it is more convenientif the crystal grows along the [001] direction. This can be done by shift-ing the origin r of all layers, whose origin is outside the first unit cellback into this unit cell by replacing r by its modulus with respect to twovectors that are within the plane. In the present macro this can by doneby switching the flag off to on in line 20, which will shift the originsinto the first unit cell, as soon as its modulus with respect to the twovectors given on the modulus command in line 19 is outside the range[0,1]. As the next example we will use macro stack.h0l.mac to create acrystal with actual stacking faults. Compared to the first macro, thesize of the layer in the ab-plane was increased to 100 x 100 unit cells.This is achieved by expanding the unit cell to 100 x 100 x 1 unit cells(line 6–7) and saving this layer to the file called hexagonal.layer (line 9–12). This structure file is used in turn in lines 27 and 28 of the newmacro. In addition, the transition probability is now defined via thevariable prob which is declared in lines 3 and 4 of the new macro. Avalue of prob = 0.0 would give the strictly periodic hexagonal close

Page 110: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.5 Example: Growth faults 99

packed sequence ABAB. . . , while prob = 1.0 would give the equallyperiodic cubic sequence ABCABC. . .

0

1

0 1 2 3

[H 0 0 ]

[0 0

L ]

2

3

4

5×10

910

10In

tens

ity

Fig. 7.2 Diffuse intensity distribution fora crystal of 100× 100 × 4000 atoms. Dif-fuse streaks parallel to c* run through in-teger h and k values

0

Inte

nsi

ty (

arb u

nit

s)

20

40

60

80

100

21

l (r.l.u)

Fig. 7.3 Diffuse intensity distributionalong the 10l streak. The stacking proba-bility coefficient was 0.15. Average of 200calculations.

0

Inte

nsity

(ar

b un

its)

20

40

60

80

100

21

l (r.l.u)

Fig. 7.4 Diffuse intensity distributionalong the 10l streak. The stacking proba-bility coefficient was 0.15. Calculation fora single crystal of 4 000 layers.

The definition of the reciprocal layer to be calculated is done in lines14 through 24, prior to the creation of the layers. Once the recipro-cal layer has been defined, we can make use of the convolution theo-rem as described in Section 7.3 to speed up the calculation. The pro-gram DISCUS implicitly does this if the fourier command is usedwithin the stack menu, as in line 63 of the present macro. The cal-culated diffuse intensity in Fig. 7.2 is achieved with a value of prob= 0.15. From this figure it is obvious that the diffuse intensity is lim-ited to rods parallel to c* through integer values of h and k, as wasalready pointed out in Section 7.3. Additionally, one can see that inthe h0l layer all rods with h = 3n are free from diffuse scattering. Toexplain this extinction rule for the diffuse scattering, we have to re-member that the position of all layers is either [0, 0, z], [1/3, 2/3, z], or[2/3, 1/3, z]. Let us put these three positions into the structure factorequation: F (hkl) =

∑fj exp(2πi(hx + ky + lz )) It is obvious, that for

all integer h and k, where h = 3n and k = 3n, the contribution by anyof these positions to the structure factor is identical:

fj exp(2πi(3n0 + 3n0 + lz )) = fj exp(2πi(lz ))

fj exp(2πi(3n1/3 + 3n2/3 + lz )) = fj exp(2πi(lz ))

fj exp(2πi(3n2/3 + 3n1/3 + lz )) = fj exp(2πi(lz )) (7.10)

Since the z-values of all layers are periodic as in the perfect crystal,the rods with h = 3n and k = 3n are free from diffuse scattering. Ifone tries the calculations for other rods in reciprocal space, one quicklyfinds out that also the rods with h = k and their symmetrically equiv-alent rods are free from diffuse scattering. To explain this it is helpfulto look at Fig. 7.1. All three sites [0, 0, z], [1/3, 2/3, z], and [2/3, 1/2, z]lie on the (110) plane. A shift from one site to another at a stackingfault corresponds to a shift in the [110] direction, which is parallel toall hhl lattice planes. Such a shift parallel to the lattice plane does not,however, change the phase of the atoms, and thus the hhl planes seethe crystal as a periodic structure. The two-dimensional intensity dis-tribution in Fig. 7.2 does not easily allow to asses the variation of theintensity along l. For this it is better to calculate the intensity just alonga one-dimensional line, as shown in Fig. 7.3. Two features should bepointed out in this intensity distribution. Since the probability vari-able was set to 0.15, the stacking sequence is close to the hexagonalABAB. . . sequence. As a consequence, the 10l reflections are widenedslightly. Additionally, the width of the 10l and the 102 reflection differsmarkedly. As pointed out by Sebastian and Krishna [1] on the basisof analytical expressions, the full width at half maximum of reflectionswith l = 2n are about three times as wide as those with l = 2n + 1. Asthe stacking fault probability is increased, the FWHM increases propor-tional to the square of the stacking fault probability. The intensity dis-tribution in Figs. 7.2 and 7.3 was calculated by repeating the macro 200

Page 111: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

100 Creating structures with stacking faults

times and averaging the intensities! The Fourier transform along 10l ofa single simulated crystal is shown in Fig. 7.4. Despite the 4 000 lay-ers created, the diffuse scattering is not a smooth intensity distribution.The many small maxima are due to the limited thickness of the crys-tal and thus to the limited number of defects in this crystal. Since theprobability for a deviation from perfect hexagonal ABAB order is 0.15,only some 600 layers do not follow the proper sequence and thus areresponsible for the diffuse scattering. This number is much too smallfor a smooth intensity distribution. The average over 200 crystals cor-responds to a total number of 800 000 layers and 120 000 defects, whichis large enough to produce a smooth intensity distribution.

If the stacking fault probability parameter in the macro is changed toa value closer to 1, for example 0.85, segments ABCABC are more likelythan ABAB segments, and the crystal will be more like the cubic closepacked structure with stacking faults, see Fig. 7.5. Two comparablysharp maxima at l = 2/3 and l = 4/3 appear, while the maximum atl = 1 has disappeared. The transformation between the hexagonal andcubic systems is given by:

0

Inte

nsity

(ar

b un

its)

20

40

60

80

100

21

l (r.l.u)

Fig. 7.5 Diffuse intensity distributionalong the 10l streak. The stacking proba-bility coefficient was 0.85.

(a,b, c)c = (a,b, c)h

⎛⎝ 4/3 −2/3 −2/3

2/3 2/3 −4/31/2 1/2 1/2

⎞⎠ (7.11)

(a,b, c)h = (a,b, c)c

⎛⎝ 1/2 0 2/3

−1/2 1/2 2/30 −1/2 2/3

⎞⎠ (7.12)

The hkl components are transformed be the same rule as the base vec-tors. Accordingly the reciprocal lattice point 101h transforms into thecubic reciprocal coordinates hkl = (11/6,−1/6,−1/6), a non integerpoint in reciprocal space. The two sharp maxima transform into:

(1, 0, 2/3)h → (4/3,−1/3,−1/3)c

(1, 0, 4/3)h → (2, 0, 0)c

Thus the second maximum corresponds to a Bragg reflection of thecubic close packed structure, a result of ABCABC. . . segments. Sincethe crystal is a disordered crystal, we also have ACBACB. . . segments,which correspond to a twin with mirror plane (110) compared to theABCABC. . . segments. Accordingly, we have to transform (1, 0, 2/3)h

as (0, 1, 2/3)h → (1, 1,−1)c and the first maximum corresponds to aBragg reflection of the cubic system as well.

If the stacking fault probability parameter is systematically variedfrom 0 (perfect 2H) to 1 (perfect 3C) one will notice the following gen-eral rules for the diffraction maxima along a h0l rod:

Hexagonal reflections hkl with l integer:

• Diffuse scattering occurs in rods with h − k �= 3n.

Page 112: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.6 Example: Deformation faults 101

• The reflection shape is Lorentzian.• The reflection position does not shift.• The FWHM of the reflections increases proportional to the square

of the stacking fault probability. A constant and a linear term areless important. The width of reflections with l = 2n is approxi-mately three times as wide as that of reflections with l = 2n + 1.

• The reflection shape is symmetrical.File: stack/base.hexa.cell

1 title Primitive hexagonal cell2 spcgr P63 cell 1.0, 1.0, 1.6329932, 90.0, 90.0, 120.04 scat a , b5 adp 0.2 , 0.26 atom7 a 0.000000, 0.000000, 0.000000, 0.20008 b 0.000000, 0.000000, 0.500000, 0.2000

File: stack/base.cub.cell1 title Primitive hexagonal cell2 spcgr P63 cell 1.0, 1.0, 1.6329932, 90.0, 90.0, 120.04 scat a , b5 adp 0.2 , 0.26 atom7 a 0.000000, 0.000000, 0.000000, 0.2000

File: stack/stack.def.mac1 # stack.def.mac2 #3 variable integer, dimen4 variable integer, nstart5 variable integer, itype6 variable integer, indiv7 variable real , prob8 #9 dimen = 1000

10 prob = 0.0411 #12 do indiv = 1,20013 read14 lcell, base.$1.cell, 1, 1, dimen/215 #16 do i[1]=1,n[1]-117 if(ran(0).lt.prob) then18 itype = m[i[1]]+119 m[i[1]] = mod(itype-1,2) + 120 endif21 enddo22 save23 outf origin.list24 run25 exit26 #27 read28 cell hexagonal.cell, 1, 1, 129 #30 stack31 layer hexagonal.cell32 layer hexagonal.cell33 trans 1,1, 1./3.,-1./3., 1./234 trans 1,2,-1./3., 1./3., 1./235 trans 2,1, 1./3.,-1./3., 1./236 trans 2,2,-1./3., 1./3., 1./237 #38 distr file,origin.list39 number dimen40 #41 aver 0.00, 0.00, 1.0042 modul 1.00, 0.00, 0.00, 0.00, 1.00, 0.0043 set modulus,on44 set trans,fixed45 #46 create47 exit48 #49 @stack.h0l.individual $1,1,0,prob, indiv50 enddo

Cubic reflections hkl with l = 2n + 1 ± 1/3:

• Diffuse scattering occurs in rods with h − k �= 3n.• The reflection shape is Lorentzian.• The reflection position shifts towards l = 2n + 1.• The FWHM for all reflections is equal.• The reflection shape is slightly asymmetrical.

7.6 Example: Deformation faults

To simulate deformation faults, a whole part of the crystal must beshifted with respect to the rest of the crystal. This is a very time con-suming step, if this procedure is carried out with the complete crystal.If we limit ourselves to deformation faults in one direction that extendfully through the crystal and do not bend part of the crystal, the es-sential step of the simulation is reduced to the manipulation of a on-dimensional list of layer origins.

As in the previous example, the layers and the inter layer vectorsare encoded in two different states, A and B. These states representthe interlayer vectors A: [1/3,−1/3, 1/2] and B: [−1/3, 1/3, 1/2]. Aspointed out in Section 7.1.2, a deformation fault is created, if the peri-odic ABAB. . . or AAA. . . sequence of interlayer vectors is disrupted bychanging one state within the crystal. The initial one-dimensional pe-riodic arrangement of two states is created by simply expanding alongthe c-axis the unit cells base.hexa.cell and base.cub.cell, which are shownin the margin. The simulation of the deformation stacking faults is car-ried out several times, in order to ensure proper averaging. This loopextends from line 12 through 50 of the macro. The essential steps arecarried out in the loop over all states, lines 16 through 21. If the ran-dom number is less than a predefined probability, line 17, the currentstate, i.e. an atom serving as representation of the interlayer vector, ischosen as location of a deformation fault. This layer is shifted fromits current state to the next, lines 18 through 19. Since there are twostates, pseudo-atoms A and B, their scattering types have the values 1and 2. To shift the current state, we simply add a value of one to thescattering type and take this new value modulo 2. Since the modulofunction mod(i,2) will return a value of 0 or 1 for any integer num-ber i, the macro calculates mod(i-1,2)+1. Several deformation faultsmay be created within the crystal, since the decision about a deforma-tion fault is done independently at each individual state. The final list

Page 113: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

102 Creating structures with stacking faults

0In

tens

ity (

arb

units

)

20

40

60

80

100

2

2H 3C

1

l (r.l.u)

0 21

l (r.l.u)

Fig. 7.6 Left: section of 10l rod for a 2H structure with a 4% probability of deformationfaults. Right: same for a 3C structure.

of pseudo atoms/states is saved to a file, lines 22 and 25 and used asa list of layer origins in the main layer creation, line 38. Note that thedefinition of the correlation matrix is absent in this macro. The type ofthe atoms in file origin.list is interpreted to represent the correspondinglayer type. The other commands in the macro are equivalent to the pre-vious example. The macro stack.h0l.individual.mac contains the relevantcommands to calculate the Fourier transform along a h0l rod. Figure 7.6shows the intensity along the 10l rod for the hexagonal and cubic closepacked structures with 1% deformation faults. Each simulation is theaverage of 200 simulations. As for pure growth faults, the reflectionsare broadened, and the FWHM increases with increasing stacking faultprobability. Compared to pure growth faults, there is no difference inthe FWHM between different reflections.

If the stacking fault probability is systematically increased one willnotice the following general rules for the diffraction maxima along ahkl rod:

Hexagonal reflections hkl with l integer:

• Diffuse scattering occurs in rods with h − k �= 3n.• The reflection shape is Lorentzian.• The reflection position does not shift.• The FWHM for all reflections is equal and increases linearly with

stacking fault probability.• The reflection shape is symmetrical.

Cubic reflections hkl with l = 2n + 1 ± 1/3:

• Diffuse scattering occurs in rods with h − k �= 3n.• The reflection shape is Lorentzian.• The reflection position shifts towards l = 2n + 1.

Page 114: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.7 Example: Wurtzite and zincblende structures 103

ab

c

a b

cFig. 7.7 Left: stacking of layers in the wurtzite structure. Large spheres represent sulfur,small spheres zinc. Right: stacking of layers in the zincblende structure

• The FWHM for all reflections is equal and increases linearly withstacking fault probability.

• The reflection shape is slightly asymmetrical.

7.7 Example: Wurtzite and zincblende struc-tures

Crystal structures with the wurtzite or zincblende structure can be de- File: stack/stack.makelayers.mac1 # creates a Wurtzite double layer2 #3 variable real,width4 width = 55 #6 read7 cell $1.cell,width,width,28 #9 boundary hkl, 0, 0, 1, 0.5,inside

10 boundary hkl, 0, 0,-1, 1.3,inside11 purge12 #13 save14 outf $1.layer15 write all16 run17 exit18 #19 symm20 angle 180.021 type proper22 mode repl23 sel all24 incl all25 orig 0.333333, 0.666667, 0.0026 uvw 0,0,127 trans 0.00, 0.00, 0.0028 run29 exit30 #31 save32 outf $1.rotated33 run34 exit

File: stack/stack.wurtzite.mac1 #2 @stack.makelayers wurtzite3 #4 read5 lcell wurtzite.cell6 #7 @stack.wurtzite.run wurtzite, 0.50

scribed as hexagonal or cubic close packed structures of the anion withhalf the tetrahedral voids filled by the cation (Fig. 7.7). Equally well, thestructure can be described as a close packed structure of cations wherethe anions fill half the tetrahedral voids. Very much like the pure closepacked structures they often exhibit stacking faults. In terms of theABC notation, the wurtzite structure can be described as AαBβ. . . andthe zincblende structure as AαBβCγ. . . , where the Latin capital lettersdenote the position of the anion layer and the small Greek letters theposition of the cations. In the ideal wurtzite structure the atom posi-tions are at:

S 2b: 1/3, 2/3, 0 and 2/3, 1/3, 1/2Zn 2b: 1/3, 2/3, 3/8 and 2/3, 1/3, 7/8

To simulate the wurtzite or zincblende structure with stacking faults,it is convenient to group a sulfur and an adjacent zinc layer to form adouble layer. These double layers can then be packed either in hexag-onal or cubic sequence to give the wurtzite or zincblende structure.Such a double layer could be the pair of S, Zn atoms at 1/3, 2/3, 0 and1/3, 2/3, 3/8. By alternating the interlayer vectors [1/3,−1/3, 1/2] and[−1/3, 1/3, 1/2], the wurtzite structure results. If, on the other hand,the double layers are always stacked with the [1/3,−1/3, 1/2] vector,the cubic zincblende structure results. While this choice is computa-tionally convenient, since only one layer type is involved, there are dis-

Page 115: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

104 Creating structures with stacking faults

advantages to be considered in the simulation of small finite crystals.With this choice for the double layer, the first and last layer of aFile: stack/stack.wurtzite.run.mac

1 # Wurtzite/Zincblende random stacking2 #3 stack4 layer $1.layer5 layer $1.rotated6 trans 1,1, -0.3333, 0.3333, 0.50007 trans 1,2, 0.3333,-0.3333, 0.50008 trans 2,1, -0.3333, 0.3333, 0.50009 trans 2,2, 0.3333,-0.3333, 0.5000

10 sigma 1,1, 0.0000, 0.0000, 0.000011 sigma 1,2, 0.0000, 0.0000, 0.000012 sigma 2,1, 0.0000, 0.0000, 0.000013 sigma 2,2, 0.0000, 0.0000, 0.00001415 aver 0.0, 0.0, 1.016 modu 1.0, 0.0, 0.0, 0.0, 1.0, 0.017 set mod ,on18 set trans,fixed19 #20 random prob,0.0021 random offset, 0.00, 0.00, 0.0022 random sigma , 0.00, 0.00, 0.0023 #24 rotate status,off25 #26 distr matrix27 number 828 #29 crow 1, $2 ,1.00-$230 crow 2, 1.00-$2 , $231 #32 create33 run34 exit

File: stack/stack.sort.mac1 # stack.sort.mac2 #3 variable integer, indiv4 variable integer, width5 variable integer, dimen6 variable real, en_17 variable real, en_28 variable real, en_39 variable real, en_4

10 #11 width = 112 dimen = 99913 #14 @stack.sort.make.abc15 #16 en_1 = 1.017 en_2 = 0.018 en_3 = 1.019 en_4 =-1.020 #21 do indiv=3,1022 read23 cell hexagonal.cell,1,1,dimen24 #25 replace co,al,all,1./3.26 replace co,be,all,1./2.27 #28 @stack.sort.sort en_1,en_2,en_3,en_429 @plot.three sorted,i[0]30 chem31 corr occ,al,be32 corr occ,al,co33 corr occ,be,co34 exit35 save36 outf stack.sorted.stru37 write scat38 write adp39 run40 exit41 #42 @stack.sort.fourier.setup43 #44 @stack.sort.create indiv45 enddo

finite crystal will consist of atoms that have only one immediate neigh-bor within the crystal. Such a surface is energetically not as stable asthe alternative surface that results if the first and last layer of atoms isremoved. In this case all atoms in the outermost layer have three im-mediate neighbors within the crystal. To simulate such a finite crystal,one would have to remove the first and last atom layer. Alternatively,one can define the double layer to consist of the sulfur atom at z = 0and the Zn atoms at z = −1/8. Within this double layer, each atom hasthree immediate neighbors of the opposite type. The zincblende struc-ture results, if these double layers are stacked with inter layer vector[1/3,−1/3, 1/2]. To create the wurtzite structure, one has to alternatethe inter layer vectors [1/3,−1/3, 1/2] and [−1/3, 1/3, 1/2]. Addition-ally, the second double layer must be rotated around the c-axis by 180◦.It is a good choice to simulate these two double layers and to storethem as separate structures. Initially, the macro expands the wurtziteunit cell to a two-dimensional crystal of width x width x 2 unit cells,lines 6 and 7. All atoms except for the sulfur at z = 0 and the Zn atz = −1/8 are cut away, lines 9–11, and the resulting S-Zn double layeris saved to file wurtzite.layer, 13–17. Next, the whole layer is rotatedby a two-fold axis parallel to the c-axis through the sulfur atom, lines19–29, and stored as wurtzite.rotated, lines 31 through 34. Now we areready to create random growth faults in the wurtzite/zincblende struc-ture. Since the four atomic layers have been reduced to two doublelayers, the stacking is essentially identical to the initial example of sim-ple close packed structures. The short main macro stack.wurtzite.maccreates the layers by calling macro stack.makelayers.mac and then createsa random sequence of wurtzite double layers by means of the macrostack.wurtzite.run.mac. The second parameter passed to this macro isthe probability for zincblende sequences.

Most of the commands in this macro are identical to the previousexample. The main differences are the two different layer types definedin lines 4 and 5: wurtzite.layer and wurtzite.rotated.

7.8 Example: Short-range ordered faults

In this example we will illustrate the use of Monte Carlo methods tocreate short-range order between the layers with a Reichweite greaterthan 1. The corresponding macro stack.sort.mac is shown in the margin.The simulation consists of two different steps: first a number of statesthat represent the layer types and the interlayer vectors are orderedalong a one-dimensional row, line 28. In the second step, the resultingsequence is used to generate the actual faulted crystal (line 44), just asin the deformation fault example. The simulation is repeated severaltimes to ensure a smooth average intensity distribution. Initially a one-dimensional crystal is generated in which three different atoms Al, Be,

Page 116: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.8 Example: Short-range ordered faults 105

and Co are distributed at random. Equal amounts of these atoms areused. Here we choose a different encoding of the stacking faults. This

0

Inte

nsity

(ar

b un

its)

20

40

60

80

100

210.5 1.5

l (r.l.u)

Fig. 7.8 Intensity of the perfect 4H struc-ture along the 10l rod.

File: stack/stack.sort.sort.mac1 # stack.sort.sort.mac2 #3 mmc4 rese5 set neig, rese6 set vec, 1, 1,1, 0, 0, 17 set vec, 2, 1,1, 0, 0,-18 set vec, 3, 1,1, 0, 0, 29 set vec, 4, 1,1, 0, 0,-2

10 set vec, 5, 1,1, 0, 0, 311 set vec, 6, 1,1, 0, 0,-312 set vec, 7, 1,1, 0, 0, 413 set vec, 8, 1,1, 0, 0,-414 #15 set neig, vec, 1, 216 set neig, add17 set neig, vec, 1, 218 set neig, add19 set neig, vec, 1, 220 set neig, add21 set neig, vec, 3, 422 set neig, add23 set neig, vec, 3, 424 set neig, add25 set neig, vec, 3, 426 set neig, add27 set neig, vec, 5, 628 set neig, add29 set neig, vec, 5, 630 set neig, add31 set neig, vec, 5, 632 set neig, add33 set neig, vec, 7, 834 set neig, add35 set neig, vec, 7, 836 set neig, add37 set neig, vec, 7, 838 #39 set mode, 1.0, swchem,local40 #41 set target, 1,corr,al,be, -1.*$1,$1,ENER42 set target, 2,corr,al,co, -1.*$1,$1,ENER43 set target, 3,corr,co,be, -1.*$1,$1,ENER44 set target, 4,corr,al,be, -1.*$2,$2,ENER45 set target, 5,corr,al,co, -1.*$2,$2,ENER46 set target, 6,corr,co,be, -1.*$2,$2,ENER47 set target, 7,corr,al,be, -1.*$3,$3,ENER48 set target, 8,corr,al,co, -1.*$3,$3,ENER49 set target, 9,corr,co,be, -1.*$3,$3,ENER50 set target,10,corr,al,be, -1.*$4,$4,ENER51 set target,11,corr,al,co, -1.*$4,$4,ENER52 set target,12,corr,co,be, -1.*$4,$4,ENER53 #54 set temp, 0.155 set cycl, n[1]*2056 set feed, n[1]* 157 show58 run59 exit60 #

time each of these three atoms represents a layer type A, B, and C, inwhich the atoms are located at 0, 0, z at 1/3, 2/3, z and at 2/3, 1/3, z. Ini-tially, the macro stack.sort.make.abc.mac is used to create these individualclose packed layers and to save them as files layer.*, where * is a, b, c, line14. By using this encoding, all interlayer vectors will be equal to 0, 0,1/2. Since this present encoding, defines the individual layers locatedat A, B, and C, we will have to prevent the presence of AA, BB, and CCpairs, during the sorting process. The goal of this example is to create adisordered structure with predominant 4H segments. The periodic 4Hstructure consists of layer sequences

... A B C B A B C B ...

... + + - - + + - - ...

... h c h c h c h c ...

It is thus a strict alternation of layers in a hexagonal and a cubic envi-ronment, or a sequence of two [1/3,−1/3, 1/2] and two [−1/3, 1/3, 1/2]inter layer vectors. Since its period consists of four layers rather than2 as for the 2H structure, additional reflections appear at l = n + 1/2positions, in the metric of the 2H structure. The strictly periodic 4Hstructure can be simulated by using a unit cell that contains atoms at:

A: 0 , 0 , 0B: 1/3, 2/3, 1/4C: 2/3, 1/3, 2/4B: 1/3, 2/3, 3/4

As expected, the intensity along the 10l rod shows additional reflectionsat l = n + 1/2, once the 4H metric has been transformed into the 2Hmetric (Fig. 7.8).

The 4H structure consists of 25% A layers, 50% B layers and 25% Clayers. In the present simulation, we start with equal amounts of A,B, and C atoms and the final structure will thus contain in addition tothe ABCB sequence, equivalent blocks of BCAB, CABA sequences andthe twins ACBC, BACA, and CBAB. We will realize the 4H structureby sorting the A, B, and C atoms to obtain blocks of these six differ-ent sequences. The Monte-Carlo process will use first through fourthneighbor interactions and the corresponding Ising energies are definedin lines 16 through 19 of the main macro. These energies are describedin more detail in Chapter 5. As for all stacks of close packed layer, the4H structure does not contain pairs of equal layers as immediate neigh-bors. The sorting thus has to prevent these pairs, which we will do bysetting this Ising energy to a large positive value, line 16. A large posi-tive value will make immediate neighbors of equal atoms very unlikely,since they correspond to a high energy state.

As second neighbors in the 4H structure ABCBABCB, equal pairslike B_B and opposite pairs like A_C exist. Since our simulation willalso contain the other 4H sequences, the second neighbor correlation iseffectively zero, and the Ising energy is set to zero, line 17. All third

Page 117: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

106 Creating structures with stacking faults

neighbor pairs are of opposite type, and the energy is set to 1. Finallythe 4H periodicity of the 4H structure requires that all fourth neighborsare identical, and correspondingly the Ising energy is set to −1. In thesorting part of the simulation, stack.sort.sort.mac, we define as interac-tion directions all vectors ±[00l] with l = 1 to l = 4, lines 6–13. Neigh-borhoods are defined as each pair of ±[00l] vectors, lines 15–37. Foreach of these neighborhoods, we have three target values with identi-cal Ising energies for pairs AB, AC, and BC, lines 41–52. These threetargets are necessary, since our crystal consists of equal amounts of A,B, and C layers, and thus will consist of equal amounts of all six 4Hsequences. The remainder of the commands have the same function asFile: stack/stack.sort.create.mac

1 #stack.sort.create.mac2 #3 stack4 layer layer.a5 layer layer.b6 layer layer.c7 trans 1,1, 0.0, 0.0, 0.58 trans 1,2, 0.0, 0.0, 0.59 trans 1,3, 0.0, 0.0, 0.5

10 trans 2,1, 0.0, 0.0, 0.511 trans 2,2, 0.0, 0.0, 0.512 trans 2,3, 0.0, 0.0, 0.513 trans 3,1, 0.0, 0.0, 0.514 trans 3,2, 0.0, 0.0, 0.515 trans 3,3, 0.0, 0.0, 0.516 #17 distr file,stack.sorted.stru18 number dimen19 #20 aver 0.0, 0.0, 1.021 modul 1.0, 0.0, 0.0, 0.0, 1.0, 0.022 set modulus,on23 set trans,fixed24 #25 create26 four27 exit28 #29 output30 outfile "stack.sort.%4D",$131 value inte32 run33 exit

those in the short-range order (Chapter 5). After the sorting process,the list of atoms is saved in lines 35 through 40 of the main macro.

As pointed out earlier in this section, the three different atoms repre-sent the A, B, and C layers. Thus, three layer types are defined in themacro stack.sort.create.mac, lines 4–6, and the atoms in these files are lo-cated at 0, 0, 0, at 1/3, 2/3, 0, and at 2/3, 1/3, 0. Since the atom positionsalready include the horizontal shift from layer to layer, the translationvectors between all layer pairs are just [0, 0, 1/2], lines 7 through 15.The distribution mode is set to file, which means that a list of atomtypes, which represent the different layer types, is read from the givenfile name. The correlation matrix is ignored and therefore not includedin this macro. Figure 7.9 shows the intensity distribution along the 10lrod of the resulting structure. This intensity distribution is the averageof several calculations. Since the achieved order is not perfect, all peaksare wide compared to that of the ideal 4H structure. The relative inten-sity of the reflections is also not very close to that of the ideal structure.To understand this apparent failure of the simulation, we shall have alook at a sequence of layers in the actual simulated crystal. The follow-ing list has been generated from the list of origins during one of thesimulations. It is only a small part of the list of 4 000 sorted origins.

0

Inte

nsity

(ar

b un

its)

20

40

60

80

100

210.5 1.5

l (r.l.u)

Fig. 7.9 Intensity of the simulated 4Hstructure along the 10l rod. The calcula-tion is based on the average of 200 sim-ulations. Nevertheless, the width of thepeaks is fairly large, reflecting the shortlength of properly sorted 4H segments.

B A B A C A B A C A B A B C B A B C B A B C B C A C B A C4 4 4 4.4 4 4 4 4 4 4 4

4 4 4 4.4 4 4 4 4 4 4 4.4 4 4 4.4 4 4 44 4 4 4 4 4 4 4

4 4 4 4h h h h h h h h

The list starts with a short 2H segment and then several short 4H seg-ments follow. These segments have been emphasized by the rows of4’s separated by a decimal point. The limited length of the 4H seg-ments is responsible for the large width of the peaks in the intensitydistribution along the 10l rod. Note that the faults in the list of 4H seg-ments illustrated in the upper two lines of 4’s are themselves segmentsof one of the other 4H sequences as pointed out in the lower rows of4’s. Of all the segments of four atoms, those marked by h around thestacking faults are locally in a 2H sequence. Since the longest inter-action is the ±[004] vector, the Monte Carlo process sees most of theseneighborhoods across the faults as 4H structures as well and does notattempt to create longer 4H segments. Changing the number of Monte

Page 118: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.8 Example: Short-range ordered faults 107

Carlo cycles or the relative values of the Ising energies would not im-prove the length of 4H segments. We need even longer interactions.A good choice for this longer interaction is the ±[008] vector, since allatom pairs at this distance should be equal to each other due to the4H periodicity. By introducing this interaction and using a negativeIsing energy, the length of homogeneous 4H segments significantly im-proves. As a consequence, the width of the reflections deceases, and theintensity distribution is more similar to that of the true 4H structure. File: stack/stack.sortvec.mac

1 # stack.sortvec.mac2 #3 variable integer, indiv4 variable integer, width5 variable integer, dimen6 variable real, en_17 variable real, en_28 variable real, en_39 variable real, en_4

10 #11 width = 112 dimen = 99913 #14 read15 cell CELL/hexagonal.cell, 1,1, 116 save17 outf STRU/hexagonal.layer18 omit ncell19 run20 exit21 #22 en_1 = 0.023 en_2 = 1.024 #25 do indiv= 1, 1126 read27 cell CELL/hexagonal.cell,1,1,dimen28 #29 replace co,al,all,1./2.30 #31 @stack.sortvec.sort en_1,en_2,en_3,en_432 save33 outf "STRU/stack.sorted.%4D.stru",indiv34 write scat35 write adp36 run37 exit38 #39 @stack.sort.fourier.setup40 #41 @stack.sortvec.create indiv42 enddo

File: stack/stack.sortvec.sort.mac1 # stack.sortvec.sort.mac2 #3 mmc4 rese5 set neig, rese6 set vec, 1, 1,1, 0, 0, 17 set vec, 2, 1,1, 0, 0,-18 set vec, 3, 1,1, 0, 0, 29 set vec, 4, 1,1, 0, 0,-2

10 set vec, 5, 1,1, 0, 0, 311 set vec, 6, 1,1, 0, 0,-312 set vec, 7, 1,1, 0, 0, 413 set vec, 8, 1,1, 0, 0,-414 #15 set neig, vec, 1, 216 set neig, add17 set neig, vec, 3, 418 #19 set mode, 1.0, swchem20 #21 set target, 1,corr,al,co, -1.*$1,$1,ENER22 set target, 2,corr,al,co, -1.*$2,$2,ENER23 #24 set temp, 0.125 set cycl, n[1]*10026 set feed, n[1]* 127 show28 run29 exit30 #

The simulation becomes much more efficient if we sort the inter layervectors, rather than the actual layer origins. Consider the sequence ofinterlayer vectors in the ideal 4H structure:

... A B C B A B C B ...

... + + - - + + - - ...

... h c h c h c h c ...

First neighbor pairs of vectors are + +, + −, − −, and − +. Thus thefirst neighbor correlation is effectively zero. Second neighbor pairs arealways different and thus this correlation is −1. It is actually sufficientto use just these two interactions to get a reasonably well sorted list ofinterlayer vectors of the 4H structure! Of course, by taking even longerinteractions (third neighbors: correlation = 0, fourth neighbors: cor-relation = 1, eight neighbor: correlation = 1) into account as well, theoverall long-range order of the sorted structure improves even more.The main macro for this simulation, stack.sortvec.mac, is similar to theprevious one. The main differences are that we create just one hexag-onal layer, as in the growth fault example stack.h0l.mac, and that westart from a random distribution of just two different atoms, Co andAl, which represent the two different inter layer vectors. In the sort-ing process, stack.sortvec.sort.mac we only need the first two neighbors.If longer interactions are to be taken into account, the list of interac-tion vectors would, of course, be identical to that used to sort the layerorigins. In the macro printed in the margin, the longer vectors are in-cluded, although the calculation uses the vectors ±[0, 0, 1] and ±[0, 0,2] only. For each pair of vectors, ±[0, 0, l], we only need one neighbor-hood and one target, since we are sorting Al and Co atoms, rather thanthree different atoms as before.

File: stack/stack.sortvec.create.mac

1 #stack.sort.create.mac2 #3 stack4 layer STRU/hexagonal.layer5 layer STRU/hexagonal.layer6 trans 1,1, 1./3., -1./3., 0.57 trans 1,2,-1./3., 1./3., 0.58 trans 2,1, 1./3., -1./3., 0.59 trans 2,2,-1./3., 1./3., 0.5

10 #11 distr file,"STRU/stack.sorted.%4D.stru",$112 number dimen13 #14 aver 0.00, 0.00, 1.0015 modul 1.00, 0.00, 0.00, 0.00, 1.00, 0.0016 set modulus,on

Page 119: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

108 Creating structures with stacking faults

17 set trans,fixed18 #19 create20 four21 exit22 #23 output24 outfile "INDIVIDUAL/stack.sort.%4D",$125 value inte26 run27 exit

0

Inte

nsity

(ar

b. u

nits

)

20

40

60

80

100

210.5 1.5

l (r.l.u)

Fig. 7.10 Intensity of the simulated 4Hstructure along the 10l rod. Althoughthe underlying simulation has sorted thefirst two interlayer vectors only, the peakwidth is smaller than in the previous sim-ulation. This calculation is based on theaverage of 100 calculations.

The stacking fault commands in macro stack.sortvec.create.mac are es-sentially identical to those used for the growth fault simulations. Es-pecially, the definition of the interlayer vectors is changed back to thevectors [1/3,−1/3, 1/2] and [−1/3, 1/3, 1/2]. This is necessary, since weare no longer sorting the different ABC layers but the vectors betweenthese. For the same reason, only two layer types are defined, which re-fer to the same two-dimensional layer. The horizontal shift of layers inthe different ABC positions will be the result of the interlayer vectors.The diffuse intensity distribution along the 10l rod in Fig. 7.10 revealspeaks that are narrower than those in Fig. 7.9. This holds especially forthe reflections at l = n + 1/2. Additionally, the relative intensities aremuch closer to those of the perfect 4H structure seen in Fig. 7.8.

For this example of the 4H structure, both simulation algorithmshave been included, despite the fact that the first algorithm is far less ef-ficient than the second algorithm. Although the second algorithm usesonly two energy terms compared to the four terms needed for the firstalgorithm, the sorting is more efficient. This is not immediately obvi-ous and can be explained by analyzing the sequence of layers across astacking fault. Besides the simulation of short-range order faults, themain message of this example is the advice to try a number of differentapproaches to the simulation of a disordered structure.

7.9 Bibliography

[1] M.T. Sebastian, P. Krishna, Random, Non-Random and periodic Fault-ing in Crystals, Gordon and Breach Science Publishers, 1994.

[2] L.S. Ramsdell, Studies on silicon carbide, Am. Mineralogist 32, 64(1947).

[3] G. Hägg, Some notes on MX2 layer lattices with close-packed Xatoms, Arkiv för Kemi, Mineralogi Och Geologi 16B, 1 (1943).

[4] F.C. Frank, The growth of carborundum - dislocations and poly-typism, Phil. Mag. 42, 1014 (1951).

[5] A.J.C. Wilson, Imperfections in the structure of cobalt. II. Mathe-matical treatment of proposed structure, Proc. Royal Soc. London A180, 277 (1942).

[6] S.B. Hendricks, E. Teller, X-ray interference in partially orderedlayer lattices, J. Chem. Phys. 10, 147 (1942).

[7] H. Jagodzinski, Eindimensionale Fehlordnung in Kristallenund ihr Einfluß auf die Röntgeninterferenzen. I. Berechnung des

Page 120: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

7.9 Bibliography 109

Fehlordnungsgrades aus den Röntgenintensitäten, Acta Cryst. 2,201 (1949).

[8] H. Jagodzinski, Eindimensionale Fehlordnung in Kristallen undihr Einfluß auf die Röntgeninterferenzen. II. Berechnung derfehlgeordneten dichtesten Kugelpackungen mit Wechselwirkun-gen der Reichweite, Acta Cryst. 2, 208 (1949).

[9] H. Jagodzinski, Eindimensionale Fehlordnung in Kristallen undihr Einfluß auf die Röntgeninterferenzen. III. Vergleich der Berech-nungen mit experimentellen Ergebnissen, Acta Cryst. 2, 298 (1949).

[10] M.S. Paterson, X-ray diffraction by face-centered cubic crystal withdeformation faults, J. Appl. Phys. 23, 805 (1952).

[11] J.W. Christian, A note on deformation stacking faults in hexagonalclose-packed lattices, Acta Cryst. 7, 415 (1954).

[12] C.A. Johnson, Diffraction by face-centered cubic crystals contain-ing extrinsic stacking faults, Acta Cryst. 16, 490 (1963).

[13] G. Allegra, The calculation of the intensity of X-rays diffractedby monodimensionally disordered structures, Acta Cryst. 17, 579(1964).

[14] J. Kakinoki, Y. Komura, Diffraction by a one-dimensionally disor-dered crystal. i. the intensity equation, Acta Cryst. 19, 137 (1965).

[15] D. Pandey, S. Lele, P. Krishna, X-ray diffraction from one-dimensionally disordered H-2 crystals undergoing solid-statetransformations to the 6H structure: 1. Layer displacement mech-anism, Proc. Royal. Soc. London A 369, 435 (1980).

[16] D. Pandey, S. Lele, P. Krishna, X-ray diffraction from one-dimensionally disordered H-2 crystals undergoing solid-statetransformations to the 6H structure: 2. Deformation mechanism,Proc. Royal. Soc. London A 369, 451 (1980).

[17] D. Pandey, S. Lele, P. Krishna, X-ray diffraction from one-dimensionally disordered H-2 crystals undergoing solid-statetransformations to the 6H structure: 3. Comparison with experi-mental observations on SiC, Proc. Royal. Soc. London A 369, 463(1980).

[18] D. Pandey, S. Lele, On the study of the f.c.c.-h.c.p. martensitictransformation using a diffraction approach: I. f.c.c. → h.c.p. trans-formation, Acta Metall. 34, 405 (1980).

[19] D. Pandey, S. Lele, On the study of the f.c.c.-h.c.p. martensitictransformation using a diffraction approach: II. h.c.p. → f.c.c.transformation, Acta Metall. 34, 415 (1980).

[20] M.T. Sebastian, P. Krishna, Mechanism of solid state transforma-tions in single crystals of ZNxCd1−xS, Phys. Stat. Sol. A 79, 271(1983).

[21] M.T. Sebastian, P. Krishna, The discovery of a 2H-6H solid-statetransformation in ZnxCd1−xS, Solid State Comm. 48, 879 (1983).

[22] M.T. Sebastian, P. Krishna, X-Ray diffraction from a SiC crystalundergoing the 3C-6H solid state transformation by non-randommicrotwinning.

Page 121: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

110 Creating structures with stacking faults

[23] M.T. Sebastian, P. Krishna, X-ray investigation of the mechanismof phase-transformation in single crystals of ZnS ZnxCd1−xS andZnxMn1−xS: 1. calculation of diffraction effects by a 3 parametermodel, Cryst. Res. Technol 22, 929 (1987).

[24] M.T. Sebastian, K. Narayanan, P. Krishna, X-Ray diffraction effectsfrom 2H crystals undergoing transformation to the 3C structureby the layer displacement mechanism, Phys. Stat. Solid A 102, 241(1987).

[25] M.T. Sebastian, G. Mathew, The mechanism of the 2H-4H solidstate transformation in cadmium iodide crystals, Phil. Mag. A 58,691 (1988).

[26] V.A. Drits, C. Tchoubar, X-Ray Diffraction by Disordered LamellarStructures, Springer, 1990.

[27] R. Berliner, S.A. Werner, Effect of stacking faults on diffraction:The structure of lithium metal, Phys. Rev. B 34, 3586 (1986).

[28] V. K. Kabra, D. Pandey, Monte carlo simulation of transformationsin SiC, Phase Transitions 16, 211 (1989).

[29] B.I. Nikolin, A.Y. Babkevich, The Monte Carlo simulation of ran-dom stacking faults in close-packed structures.

[30] S.P. Shresta, V. Tripathi, V.K. Kabra, D. Pandey, Monte Carlo studyof the evolution of diffuse scattering and coherent modulationduring h.c.p. to f.c.c. martensitic transition: I. infinitely strong re-pulsive interaction model, Acta Mater. 44, 4937 (1996).

[31] A.Y. Babkevich, F. Frey, V. Gramilich, W. Steurer, X-Ray investiga-tion of a Co-0.25 wt% c alloy: Stacking disorder in the martensitephase and reverse h.c.p. to f.c.c. martensitic transformation.

[32] S.P. Shrestha, D. Pandey, Kinetics of martensitic type restackingtransitions: dynamic scaling, universal growth exponent and evo-lution of diffuse scattering, Proc. Royal. Soc. London A 453, 1311(1997).

[33] J. B. Gook, Investigation of one-dimensionally disordered struc-tures of AIIBV I crystals by monte carlo technique. I. The 3C disor-dered structure and the 3C structure with different kinds of stack-ing faults.

[34] J. B. Gook, Investigation of one-dimensionally disordered struc-tures of AIIBV I crystals by monte carlo technique. II. 2H structurewith different kinds of stacking faults.

[35] T.R. Welberry, Diffuse X-ray Scattering and Models of Disorder, Ox-ford University Press, Oxford, 2004.

Page 122: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Exercises 111

Exercises(7.1) Simulate a close packed structure with growth

faults. Calculate the intensity distribution alongrods parallel to c∗ for different h and k. For whichh, k values are the rods free of diffuse scattering?

(7.2) Simulate a close packed structure with growthfaults. Modify the stacking fault parameter in therange from 0 to 1. Verify the statements on the posi-tion and width of the peaks along the h0l rods.

(7.3) Simulate a hexagonal close packed structure withdeformation faults. Modify the stacking fault pa-rameter in the range from 0 to 0.3. Verify the state-ments on the position and width of the peaks alongthe h0l rods. Run the analogous simulation for thecubic close packed structure.

(7.4) Create a structure that consists of mostly just one ofthe 4H sequences, like the ABCA segments.

Page 123: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 124: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Creating domainstructures 88.1 Introduction

In a strict sense of definition, domains in a crystal are somewhat largerregions in which the crystal structure differs from the average crystalstructure. This could be a region in which the structure is in a twinnedorientation, where the composition is different, or a region in whichthe structure is relaxed in a different way. No definite size range canbe defined, but it is generally understood as a region that comprises atleast several unit cells. Smaller regions that contain just a few atoms arereferred to as clusters. The boundary between the terms is somewhatvague and the term microdomains for very small domains/larger clus-ters has also been used. Domains are very common in materials thatundergo phase transitions, especially ferroelastic materials [1]. If thephase transition is accompanied by a loss of symmetry, the crystal willoften form domains that correspond to twinned regions. In the per-ovskite structure for example, the cubic high-temperature phase trans-forms into a tetragonal phase. Correspondingly, three different orien-tations for the tetragonal c-axis parallel to any of the former cubic [100]axis are possible and thus the crystal will contain domains representingeach of these three orientations.

Diffuse scattering by domains and domain walls has been studiedextensively, both experimentally and theoretically. Adlhart [2] has de-veloped equations for diffraction by crystals with planar domains, andBoysen [3] developed equations for scattering by domains and partic-ularly domain walls. Hashimoto [4] and Neder et al. [5] developedexpressions for scattering by very small domains, or large clusters, re-ferred to as microdomains. Experimental studies concerned many dif-ferent fields. Some examples are: domain and twin formation at thephase transition of ferroelastic materials [6], temperature dependenceof domain walls [7], long-range periodic domain formation [8], studiesof microdomain boundaries in RFeGe6 [9], short-range order in ferro-electric lead manganese niobates [10], domain size growth during an-nealing [11], microtwinning in silicon and the effect of the associateddiffuse shoulders around the Bragg reflections on the accuracy of grain-size measurements [12].

In this book we will use a very general definition of a domain. As adomain, we will term any part of the structure that is replaced by an-

113

Page 125: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

114 Creating domain structures

other structure. This could be anything from a single atom to a smallgroup of atoms to any large part of the structure. Thus, our domainspans the size range from a small cluster to that of domain intergrowthof different phases. With this general definition, a domain can be usedfor a broad variety of simulation purposes. One could, for example, re-place a single molecule by another molecule, or a small group of atomsby a different group of atoms. This replacement might be equally ap-plied to larger groups that are regularly or irregularly shaped. By sys-tematically replacing a part of the crystal one can create complex crystalstructures. You could, for example, replace a dummy atom by a largermolecule and thus change, for example, a simple close packing into azincblende structure. On a larger scale, the domains could be replacedby a different crystal structure in order to simulate coherent or incoher-ent intergrowth.

Another application of domains is their use as dummy structuresto speed up the simulation process. An an example, lets assume onewants to simulate a crystal in which the orientation of molecules is de-termined by a short-range order distribution. If a Monte Carlo simu-lation is applied to the complete crystal, whole molecules must be ro-tated, shifted or replaced, each time a slight modification to the struc-ture is tested. This will be very time consuming. It is much faster to sortdummy atoms that represent the type and position of each molecule.After the Monte Carlo process is finished, each dummy atom can thenbe interpreted to be a representation for a domain, which specifies agiven molecule. In the final step of the simulation, these dummy atomsare then replaced by the actual molecules.

8.2 Domain types

As pointed out in the introduction, domains may serve for quite a fewdifferent simulation purposes. In this section, we will classify the dif-ferent domain types. The classifications will distinguish between thepurpose of the domain, the shape of the domain, and finally the corre-lation between the host and guest structure. These classifications servejust to illustrate the different application to crystal structure simulationsthat we will explain in more detail later on.

The first classification should distinguish between the purposes ofthe domain. A classical domain is an extended region of the crystalin which the structure differs from the host. In this case, the domainconcept serves to create such a crystal. The totally different conceptused in this chapter as well, is to call a domain anything within thecrystal, which serves as place holder for another structural unit. Here,the purpose of the domain concept is to facilitate the simulation of amore complex crystal. Since the tools used are identical for both thecreation of a true domain and the operation with such a place holder,we will refer to both under the name of a domain.

The next classification concerns the host-guest interface. The first do-

Page 126: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.3 Definitions for a domain 115

main type is one which is characterized by a simple interface to thehost structure. This interface could be of many different shapes like

Fig. 8.1 Simple cube shaped domain.

Fig. 8.2 Simple cube shaped domainfilled with a different structure.

Fig. 8.3 Domain with irregular interfaceand separate subunits.

a simple cube, any section of space limited by several planes, a sphereor a general ellipsoid. Sections that are infinite along one or two di-rections in space like sheets or rods are similar domain types. In theexample of Fig. 8.1 the original structure consists of the atoms repre-sented by open circles. A cube shaped domain replaces the originalstructure, where the atom positions are retained, but replaced by an-other atom type. In the next example in Fig. 8.2, the same domain sizeand shape is now filled with a new crystal structure, whose lattice con-stant is smaller and whose lattice is rotated and shifted with respect tothe lattice of the host. Here, the domain concept can be used to cre-ate complex crystal structures, like intercalated phases, stacking faults,or regularly shaped intergrowth. With our definition of a domain, theatoms that form the domain may also be distributed irregularly with arough interface between the domain and the host structure. The atomsthat form the domain do not even have to fill a contiguous space, butmay be split into several independent subunits, as in Fig. 8.3. Here,individual atoms replace the original structure to form the letters DIS-CUS. Another example is given later in Fig. 8.9, where three irregularlyshaped domains compose the crystal.

The third classification scheme concerns the host-guest structure re-lation. This relation can be as simple as in the first and third examples,Figs. 8.1 and 8.3. Here, the host and guest lattice are identical and wehave a simple chemical distinction between the host and guest. In thesecond example, Fig. 8.2, the crystal structure of the host and guestdiffer. In this simple example, there is still a clearly defined relation-ship between the two structures, but this relationship may also be morecomplicated like in the case of incommensurate intergrowth.

8.3 Definitions for a domain

By classifying the domain types in Section 8.2, we already used severalterms to describe the relationship between the host and guest that youwill encounter in a simulation. We will now describe these definitionsmore systematically. Specifically, one has to define which part of thehost crystal structure is to be replaced, how this part of the host struc-ture is shaped and how large it is, how many domains are distributedthroughout the crystal, and what is their distribution throughout thecrystal, are all domains identical or is the size and/or shape subject to adistribution, what is the structure that is inserted and in which orienta-tion is it introduced into the original crystal structure, and what is theshape of the boundary between domain and host?

First of all, one needs to define which part of the host crystal structureshall be replaced. In the initial examples two different approaches wereused for this definition. In the first two examples (Figs. 8.1 and 8.2),a cube shaped segment of the host structure was defined, which was

Page 127: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

116 Creating domain structures

to be replaced by the guest structure. This shape could of course begeneralized to a general triclinic box, a general ellipsoid or any othereasily definable shape, each at a given size and orientation to the hoststructure. Whatever the shape is, the approach chosen is to define theshape itself and to simulate a guest structure large enough to fill thisspace. The simulation will first remove the atoms in the host structureand then fill the space with all those atoms from the guest structure thatfit inside the space. In Fig. 8.3, the domain consists of irregularly placedFile: domain/dom.cube.mac

1 # domain.cube.mac2 #3 read4 cell dom.guest.cube.cell,7,7,15 save6 outf dom.guest.cube.stru7 run8 exit9 #

10 read11 cell dom.host.cube.cell,7,7,112 #13 domain14 rese15 mode pseudo16 input dom.cube.pseudo17 assign char,si,cube18 assign fuzzy,si,0.519 assign cont, si,dom.guest.cube.stru20 assign shape ,si,1, 1. , 0. , 0. , 0.21 assign shape ,si,2, 0. , 1. , 0. , 0.22 assign shape ,si,3, 0. , 0. , 1. , 0.23 assign orient,si,1, 1. , 0. , 0. , 0.24 assign orient,si,2, 0. , 1. , 0. , 0.25 assign orient,si,3, 0. , 0. , 1. , 0.26 show27 run28 exit29 #30 @plot.two dom.cube

atoms. Here, it is better to have the atoms of the domain specify thespace of the host structure that is to be replaced. Thus, in the simulationprocess, each guest atom is placed into the structure and all host atomswithin a definable distance to the guest atom will be removed. We willrefer to all these shapes as fuzzy shapes.

In many host-guest structures, the unit cell of the host does not fitinto the size of the guest. Such a situation is encountered, for exam-ple, in Fig. 8.2. Here, the host has a square lattice with unit cell lengthaH. The guest also has a square lattice. There are, however, two atomsin the unit cell at (0, 0, 0) and at (1/2, 1/2, 0), and the guest latticeconstant aG is 1/

√5aH. Finally, the guest lattice is rotated around the

c-axis by an angle of tan−1(12 ) = 26.565◦. Thus, in the simulation pro-

cess, at some point the different unit cell sizes and orientations mustbe merged. More generally speaking, we need to define the transfor-mation matrix between the host and guest base vectors. As long as we

File: domain/dom.cube.pseudo1 title Domain list for simple domains2 spcgr P43 cell 2.50, 2.50, 2.50, 90.00, 90.00, 90.004 atom5 SI 0.00000 0.00000 0.00000 0.05

consider the host to be the main part of the structure and the guest to bean addition to this structure, it will be more convenient to describe thefinal crystal in terms of the host unit cell. It is largely a matter of tastewhether one simulates the guest first within its own metric system, thentransforms it into the host metric and stores it for the eventual insertion,or whether the transformation is carried out during the insertion.

Fig. 8.4 Simple cube shaped domain,sheared and enlarged.

As a first example, let us look at the simulation of the structure in Fig.8.1, which has been created by the commands in the macro dom.cube.mac.Both structures, the host and the guest, use a primitive tetragonal unitcell with just one atom at (0, 0, 0), as listed in the margin. For conve-nience, both unit cell dimensions are identical. In the first eight linesof the macro, the guest is expanded into a small crystal, large enoughto fill out the domain we eventually want to create. This proceduremight require more careful thought, to produce a guest large enough,since otherwise large voids may be produced within the guest. Next,the host crystal is built in lines 10 and 11. Lines 13 through 26 form thecore of this simulation. Here all definitions required for a domain place-ment are given. For such a simple structure, a simple loop to replaceindividual atoms would, of course, be much easier, yet we want to usethis example to explain the domain concept. The first line within thedomainmenu tells DISCUS how to interpret the content of the input filethat is defined in line 16. The keyword pseudo tells DISCUS to inter-pret the atoms found within the input file as place holders for domains.In our example, the input file contains just a single SI atom at position(0, 0, 0). By specifying the mode as pseudo, DISCUS will interpret the

Page 128: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.3 Definitions for a domain 117

position of the SI atom as the center of a domain, whose properties aredefined by the assign commands in the macro. Alternatively, if themode is domain, DISCUS will expect explicit domain descriptors in theinput file, which will be explained in a second example.

Next, the domain shape is defined by telling the program that SIatoms represent a cube shaped domain. The content of the domain, i.e.the guest structure, will be read from file dom.guest.cube.stru, which hadbeen created in the beginning of the macro. The fuzzy assignment inline 18 specifies a minimum distance between any guest atom and hostatoms. Any host atom that is closer to a guest atom than this minimumdistance is removed from the structure. This procedure guarantees thatno atoms are too close to each other. The next six lines define general-ized transformations for the shape and for the content. The cube shapeddomain is defined as the volume inside the six 〈100〉 planes, each inter-secting the respective base vector at its endpoint from the center of thedomain. Thus, initially the cube shaped domain is a volume of 2 x 2 x2 unit cells, centered around the midpoint of the domain, and its shapedepends on the crystal system to which the host crystal belongs. Thefirst transformation matrix modifies the base vectors of the shape ac-cording to the transformation:

(a′ b′ c′

)=

(a b c

)⎛⎝ T11 T12 T13

T21 T22 T23

T31 T32 T33

⎞⎠ +

⎛⎝ t1

t2t3

⎞⎠ (8.1)

Initially, the base vectors that define the shape are parallel and of equallength to the base vectors of the host crystal. After the transformationthe domain is limited by the six {100} planes defined with respect to thenew base system. Thus a matrix⎛

⎝ 2 0 01 1 00 0 1

⎞⎠ (8.2)

will transform the domain adomain into the new vector 2ahost + 1ahost+ 1ahost. If everything else is left unchanged, the domain will changefrom that in Fig. 8.1 to the one in Fig. 8.4.

This last transformation modifies just the outer shape of the domain.It does not affect the placement of individual atoms within the domain.To change the placement of individual atoms, another, independenttransformation is used, which transforms the atoms from the domainstructure into the host structure. In the current macro, this transforma-tion in lines 23–24 is just a simple unit matrix.⎛

⎝ T11 T12 T13

T21 T22 T23

T31 T32 T33

⎞⎠

⎛⎝ x

yz

⎞⎠ +

⎛⎝ t1

t2t3

⎞⎠ (8.3)

This transformation thus allows you to rotate, shear, and translate theatoms of the guest structure with respect to the host lattice. Since thistransformation works directly with the coordinates of the atoms, we

Page 129: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

118 Creating domain structures

also need to specify the relative orientations of the host and guest lat-tice.

Fig. 8.5 Simple periodic arrangement ofidentical domains.

File: domain/dom.lattice.mac1 # dom.lattice.mac2 #3 read4 cell dom.guest.cube.cell,7,1,15 save6 outf dom.guest.lattice.stru7 run8 exit9 #

10 read11 cell dom.cube.pseudo12 #13 do i[0]=-2,214 copy a,1, 0,i[0]*3,015 enddo16 remove 117 purge18 save19 outf dom.lattice.list20 run21 exit22 #23 read24 cell dom.host.cube.cell,15,17,125 #26 domain27 rese28 mode pseudo29 input dom.lattice.list30 assign char,si,cube31 assign fuzzy,si,0.532 assign cont, si,dom.guest.lattice.stru33 assign shape ,si,1, 3.0, 0.0, 0.0, 0.034 assign shape ,si,2, 0.0, 0.5, 0.0, 0.035 assign shape ,si,3, 0.0, 0.0, 1.0, 0.036 assign orient,si,1, 1.0, 0.0, 0.0, 0.037 assign orient,si,2, 0.0, 1.0, 0.0, 0.038 assign orient,si,3, 0.0, 0.0, 1.0, 0.039 show40 run41 exit42 #43 @plot.two dom.lattice

In the current examples, DISCUS expects that the guest base vectorshave already been transformed into a base system identical to the hoststructure. The transformation defined in these lines is an additionaloptional transformation. The domain in Fig. 8.2 was created by simu-lating a crystal in a tetragonal base identical to the host lattice. Withinthe domain macro the transformation matrix:

⎛⎝

√1/5 cos(26.565◦)

√1/5 sin(26.565◦) 0

−√

1/5 sin(26.565◦)√

1/5 cos(26.565◦) 00 0 1

⎞⎠ +

⎛⎝ 1/2

1/20

⎞⎠ (8.4)

was used to scale, rotate, and finally shift the guest structure. Equallywell, the guest structure could have been simulated with its own unitcell length, which is smaller by a factor of

√1/5 compared to the host

unit cell length. The simulated structure would then have to be rotatedby −26.565◦, then transformed into a unit cell with

√5 longer unit cell

length, and finally be shifted by (1/2, 1/2, 0). To merge this structureinto the host crystal, the transformation matrix for the atoms would, ofcourse, now have to be a unit matrix.

In the examples so far, individual domains were placed into the crys-tal, and we will now show examples of how to place many domainsinto the crystal. In the first example, dom.lattice.mac, a row of identicaldomains is placed into a host structure. Since all domains are identical,the only difference from the examples used so far is the content of thefile defined by the input command within the domainmenu. By usinga loop in lines 13 through 21 to create a row of atoms and saving theirpositions into the input file, we already create a row of domains. Noticethe small difference in the shape defining matrix, lines 33 through 35,used here to create domains that consist of a single row of atoms. Thecrystal created by this macro is shown in Fig. 8.5.

In most realistic simulations, not all domains within the crystal areidentical. Instead, the domain properties are subject to a distribution.This distribution may affect the individual shape, size, the orientationof the internal structure or any combination of these parameters. Todo so you will have to specify these parameters for each domain indi-vidually. To facilitate this step, DISCUS offers a different way to builddomains. The macro dom.domain.mac works in combination with thefile dom.domain.domain and will create a domain that is identical to thedomain depicted in Fig. 8.1. In line 14 of the macro, the mode of theinput file is changed to domain, and all domain descriptors are omit-ted. These domain descriptors are now encoded into pseudo-atomswith special names in the input file dom.domain.domain. In this file, thedomain is surrounded by pair of domain and domain end keywords,similar to the molecule keywords. With the exception of shape andorient, all commands of the domain menu have parameters that areequivalent to those of the domain keyword found in the input file.

Page 130: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.3 Definitions for a domain 119

Two pseudo-atoms with fixed names are used to encode the positionof the atoms (POSI) and the shape of the domain CENT. The shape File: domain/dom.domain.mac

1 # dom.domain.mac2 #3 read4 cell dom.guest.cube.cell,7,7,15 save6 outf dom.guest.cube.stru7 run8 exit9 #

10 read11 cell dom.host.cube.cell,7,7,112 #13 domain14 mode domain15 input dom.domain.domain16 run17 exit18 #19 @plot.two dom.domain

File: domain/dom.domain.domain1 title Domain listing with encoding2 spcgr P43 cell 2.50, 2.50, 2.50, 90.0, 90.0, 90.04 atom5 domain6 domain character,domain_cube7 domain file,dom.guest.cube.stru8 domain fuzzy,0.59 POSI 0.00000 0.00000 0.00000 0.00

10 XAXI 1.00000 0.00000 0.00000 0.0011 YAXI 0.00000 1.00000 0.00000 0.0012 ZAXI 0.00000 0.00000 1.00000 0.0013 CENT 0.00000 0.00000 0.00000 0.0014 XDIM 1.00000 0.00000 0.00000 0.0015 YDIM 0.00000 1.00000 0.00000 0.0016 ZDIM 0.00000 0.00000 1.00000 0.0017 domain end

and orientation matrices are now encoded through the pseudo-atomsXDIM, YDIM, ZDIM and XAXI, YAXI, ZAXI. The actual matrices are con-structed by subtracting the respective origins for shape and positionfrom the coordinates of these pseudo-atoms:

File: domain/dom.triangle.mac1 # dom.triangle.mac2 #3 variable integer,dimen4 dimen = 815 #6 read7 cell dom.guest.cube.cell,20,20,18 boundary hkl,1,1,0,0.29 purge

10 save11 outf dom.guest.cube.stru12 run13 exit14 #15 read16 stru dom.domain.domain17 #18 do i[0]=1,2019 @dom.triangle.symmetry20 @dom.triangle.shear21 enddo22 save23 outf dom.triangle.list24 write all25 run26 exit27 #28 read29 cell dom.host.cube.cell,dimen,dimen,130 #31 domain32 mode domain33 input dom.triangle.list34 show35 run36 exit37 @plot.two dom.triangle

⎛⎝ T11 T12 T13

T21 T22 T23

T31 T32 T33

⎞⎠ =

⎛⎝ (Xxdim − Xposi) (Yxdim − Yposi) (Zxdim − Zposi)

(Xydim − Xposi) (Yydim − Yposi) (Zydim − Zposi)

(Xzdim − Xposi) (Yzdim − Yposi) (Zzdim − Zposi)

⎞⎠ (8.5)

This encoding may seem complicated at first, yet it allows easy accessto all crystal modification tools. If, for example, a vector is added toall pseudo-atoms of a given domain, this will shift the entire domainwithout changing the size, shape or orientation of the guest structure.Thus a domain can easily be copied, moved, rotated, etc. Scaling ofan individual domain can also be done by shifting the pseudo-atomsXDIM, YDIM, ZDIM relative to the origin CENT.

The following example will create triangularly shaped domains ofdifferent size, randomly placed within a host crystal (dom.triangle.mac).In lines 6 through 13, the boundary command is used to remove allatoms outside a (110) plane that is 0.2 Å from the origin. As a result,the lower left triangle of a 20 x 20 unit cell crystal is retained and storedfor later use as guest structure. The file dom.domain.domain is identi-cal to the one used in the last example. It contains the descriptor fora single domain of default size at the origin. This domain is copiedand modified in the loop, lines 18 through 21. The symmetry opera-tion in the macro dom.triangle.symmetry.mac shifts the domain by a ran-dom vector within the host crystal. The symmetry operation is set upto always copy the first domain and to keep its domain type, in anal-ogy to keeping the molecule type. Only the first domain is included inthe symmetry operation. By applying the symmetry operation to boththe atoms and the shape of the domain, all eight pseudo-atoms of thedomain are treated identically. This means that the outer shape andthe guest structure are shifted identically, and we create an exact copyof the old domain. Alternatively one could apply the symmetry op-eration to the shape only. This would make sense only if the domainis replaced instead of being copied. Then, this application would ro-tate for example the shape of an individual domain, while leaving theorientation of the guest structure unchanged. Equivalently you couldchange the orientation of the guest structure, while leaving the shapeunchanged, in order to introduce a domain like the one in Fig. 8.2.Next, the dom.triangle.shear.mac macro modifies the individual size ofeach domain. A scale factor is calculated that is Gaussian distributedaround a mean of 3, and is at least equal to one. The operation is ap-

Page 131: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

120 Creating domain structures

plied only to domains of type 1, line 5, and to the latest domain createdby the symmetry operation, line 6. Keep in mind that n[4] is the totalnumber of molecules within a crystal. For the sake of a modificationFile: domain/dom.triangle.symmetry.mac

1 # dom.triangle.symmetry.mac2 #3 r[1] = nint(dimen*(ran(0)-0.5))4 r[2] = nint(dimen*(ran(0)-0.5))5 symm6 uvw 0,0,17 angle 0.08 orig 0,0,0,crystal9 trans r[1],r[2],0

10 type proper11 mode copy,old12 power 1,single13 domain select,all14 domain include,1,115 domain atoms,apply16 domain shape,apply17 show18 run19 exit

File: domain/dom.triangle.shear.mac1 # dom.triangle.shear.mac2 #3 r[0] = max(1,3+nint(gran( 1)))4 shear5 domain select,16 domain include,n[4],n[4]7 domain atoms,ignore8 domain shape,apply9 origin 0,0,0,molecule

10 matrix r[0],0,0, 0,r[0],0, 0,0,111 show12 run13 exit

DISCUS does not distinguish between molecules and domain. As statedin the last paragraph, the shear operation ignores the atoms, line 7, e.g.ignores the orientation matrix between host and guest structure. Theshear is applied to the shape only, and acts with respect to an originchosen within each domain at the position of the pseudo atom CENT.This will magnify each domain around its center. The shear matrix isexplicitly given as:

File: domain/dom.triangle.short1 domain2 domain character,domain_cube3 domain file ,guest.stru4 domain fuzzy , 2.00005 POSI 0.0 0.0 0.0 0.056 XAXI 1.0 0.0 0.0 0.007 YAXI 0.0 1.0 0.0 0.008 ZAXI 0.0 0.0 1.0 0.009 CENT 0.0 0.0 0.0 0.00

10 XDIM 1.0 0.0 0.0 0.0011 YDIM 0.0 1.0 0.0 0.0012 ZDIM 0.0 0.0 1.0 0.0013 domain end14 domain15 domain character,domain_cube16 domain file ,guest.stru17 domain fuzzy , 2.000018 POSI 3.0 6.0 0.0 0.0519 XAXI 4.0 6.0 0.0 0.0020 YAXI 3.0 7.0 0.0 0.0021 ZAXI 3.0 6.0 1.0 0.0022 CENT 3.0 6.0 0.0 0.0023 XDIM 6.0 6.0 0.0 0.0024 YDIM 3.0 9.0 0.0 0.0025 ZDIM 3.0 6.0 3.0 0.0026 domain end

⎛⎝ r[0] 0 0

0 r[0] 00 0 r[0]

⎞⎠

⎛⎝ a

b

c

⎞⎠ +

⎛⎝ 0

00

⎞⎠ (8.6)

where r[0] is the value of the individual scale factor. The list in themargin shows the first two domains after such an operation. The sec-ond domain is now located at 3, 6, 0, the coordinates of both, POSI andCENT. The difference vector between XDIM and CENT is 3, 0, 0, whichmeans this domain has been expanded by a factor of 3. Figure 8.6 showsthe structure that results. The resulting triangular domain does over-lap in some cases, since the origins were distributed at random withoutchecking distances to existing domains. The guest structure that wascreated at the beginning of this example is a triangle of atoms with 20atoms base width along the a- and b-axes and does not contain anyatoms in the upper left half of the square defined by the base widths.The cube, which is set up by the domain character,domain.cubeparameter in the input file and the corresponding pseudo-atoms *DIMdefine a square section in the ab-plane that varies in size. Nevertheless,while replacing the host structure by this triangular guest structure, novoids are left in the upper half of the square!

Although the domain character is that of a cube, DISCUS does not re-

Fig. 8.6 Random placement of triangularly shaped domains of random size. Two differentruns are displayed, showing two different random distributions.

Page 132: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.4 Ordering and distribution of domains 121

move any atoms from this cube shaped region, unless the guest struc-ture contains atoms within this region. This ensures that no voids areaccidentally created in the resulting structure. The Gaussian distribu-tion in line 3 of the macro dom.triangle.shear had been given a lower limitof 1 to ensure that domains are not smaller than ±1 unit cell. No up-per limit had been defined though, and in principle a huge triangularlyshaped domain may appear in the simulation, if the simulation is re-peated often enough. The largest domain that will ever show up in thissimulation, however, is one with 20 unit cells width and height, even ifthe scale factor is larger than 10. The reason behind this is that this isthe size of the initial triangle generated in lines 6 through 13 of the mainmacro dom.triangle.mac. In this example, the size limitation was intro-duced to avoid substituting too large a domain into the host. In othersimulations, this may, however, be the source of unexpected errors, ifthe initial domain structure is created smaller that needed later on.

8.4 Ordering and distribution of domains

In the previous examples, individual domains were placed into thecrystal. Except for trivial cases, it is tedious to place many individualdomains into a crystal. Instead, to create a realistic representation ofan actual crystal, and thus the resulting diffuse scattering, we will haveto place many domains into a large crystal. This section will describepossibilities to perform these tasks. Three different tasks will occur:

• strictly (almost) periodic ordering of domains;• short-range order of (regularly shaped) domains;• formation of larger domains with irregular interfaces.

Periodic domains of a few μm in thickness can be created in the ferro-electric material KTiOPO4 [8]. High-resolution diffraction images showthat these large domains can form almost perfect superlattices that ex-tend over areas up to a few millimeters in thickness. In such a situation,the goal of the simulation would be to create an ordered arrangementof the two different domains. Once this superlattice has been formed,the domains would be replaced by the individual atoms, in order tocalculate the diffraction pattern. Usually, the domains that form spon-taneously after a phase transition are more irregularly shaped. An ex-ample of this is found in the paper by Dmowski et al. [11], where an-nealed samples of PbMg1/3O3-PbZrO3 were studied by X-ray, neutronand electron diffraction. After annealing the samples at 1325 ◦C, thedomain size has increased to some 30 nm. Dark field images showirregular domain sizes and shapes. To simulate such a crystal, the do-main concept should be understood differently. It appears very com-plicated to describe the size, shape and distribution of these domainsanalytically. It is much easier to create these domains in a two-step ap-proach. In the first step atoms are sorted into domains using a MonteCarlo process. This will create irregularly shaped domains. In the sec-ond step, each of these atoms in turn is interpreted as a domain and

Page 133: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

122 Creating domain structures

replaced by an actual crystal structure. An example of this situationwill be described in Section 8.5.

Fig. 8.7 Short-range order of pseudo-atoms.

File: domain/dom.spheres.mac1 # dom.spheres.mac2 #3 variable integer, dimen4 variable integer, number5 variable integer, weiter6 variable real, xx7 variable real, yy8 dimen = 509 number = 0.08 * dimen**2

10 #11 @dom.spheres.make Si,AA12 @dom.spheres.make Be,BB13 #14 read15 free 2.5, 2.5, 2.5, 90,90,9016 #17 do i[0]=1,number18 xx = 2*dimen*(ran(0)-0.5)19 yy = 2*dimen*(ran(0)-0.5)20 insert AA, xx, yy, 0.0, 1.021 xx = 2*dimen*(ran(0)-0.5)22 yy = 2*dimen*(ran(0)-0.5)23 insert BB, xx, yy, 0.0, 1.024 enddo25 #26 @plot.d dom.sph.random27 @dom.spheres.sort28 @plot.d dom.sph.sorted29 @dom.spheres.fourier dom.sph.sorted30 @dom.spheres.togrid31 save32 outfile dom.sph.domains.list33 run34 exit35 #36 read37 cell dom.host.cube.cell,dimen,dimen,138 #39 @dom.spheres.replace40 boundary hkl, 1, 0, 0, 0.5*dimen*lat[1]41 boundary hkl, -1, 0, 0, 0.5*dimen*lat[1]42 boundary hkl, 0, 1, 0, 0.5*dimen*lat[1]43 boundary hkl, 0,-1, 0, 0.5*dimen*lat[1]44 @plot.s dom.sph.replaced45 @dom.spheres.fourier.r dom.sph.replaced

Short-range order between domains can be treated very much likeshort-range order between individual atoms and the basic steps are thesame. One first creates a random distribution of, in this case, pseudo-atoms, and then uses a Monte Carlo procedure to sort these atoms. Thisis exactly the same procedure we used earlier to create short-range or-der between atoms (Chapter 5). The only difference is that rather thanmodifying atoms, the origins of individual domains are modified. Inthe last step, the pseudo-atoms are replaced by their respective domainstructures. The main difference encountered in this simulation will bethat the distance between the domains is much larger than between in-dividual atoms. In this example, dom.spheres.mac, we will create a distri-bution of domains of two different diameters that shall not overlap. Themacro begins by creating two large spherical domains, one consistingof Si atoms, the other of Be atoms, and stored as dom.sph.AA.stru anddom.sph.BB.stru. Within an empty space dummy atoms AA and BB areplaced at random throughout a volume twice as big as the final crys-tal. This extra space ensures that any random movement of the atomsduring the sorting process will not lead to areas close to the edge thatare not evenly covered by pseudo-atoms. The number of pseudo-atomsinserted depends on the radii of the two domain types, respectively onthe volume ratio that shall be replaced in the final step by the two do-main types. Within this space, the macro dom.spheres.sort.mac sorts thepseudo atoms to create the intended short-range order.

The positions of all pseudo-atoms are stored as a list of domain po-sitions into file dom-sph.domains.list, which in turn is used in the re-placement macro dom.spheres.replace.mac. In order to create the short-range order between the pseudo-atoms, we define four neighborhoodsin macro dom.spheres.sort.mac, lines 21 through 24. These are neighbor-hoods of type environment and their radii are adjusted in lines 12through 14 to cover about 3 to 4 times the intended distance betweenthe respective pair of pseudo-atoms.

The target energy for each neighborhood is given by a Lennard-Jonespotential (see Section 5.4.2), whose potential minimum is at the in-tended distance between the domains. By choosing the neighborhoodradius sufficiently large, one prevents the initial random arrangementof pseudo-atoms from splitting into disconnected subunits. Admit-tedly, there is a jump in potential energy at the end of the neighborhoodradius, since atoms outside the neighborhood are not considered in theenergy calculation. Theoretically, such a potential jump could cause aspurious increase of atoms close to the neighborhood boundary. Here,such an increase is not to be expected. First, the potential jump is smalland secondly, at this large distance from the potential minimum, thederivative of the Lennard-Jones potential is quite small. Finally, therewill be second and even third neighbors to the central atom within theneighborhood. The neighborhood of each of these atoms in turn willinclude at least some of the atoms that are outside the initial neighbor-

Page 134: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.4 Ordering and distribution of domains 123

hood, and thus effectively extend the initial potential. The depth of allthree minima has been chosen identical in this simulation. This sort- File: domain/dom.spheres.sort.mac

1 # dom.spheres.sort.mac2 #3 chem4 set mode,quick,period,xy5 set mode,quick,normal6 exit7 #8 variable real, aa_aa9 variable real, aa_bb

10 variable real, bb_bb11 #12 r[0] =30*lat[1]13 r[1] =30*lat[1]14 r[2] =30*lat[1]15 aa_aa = lat[1]*12.016 aa_bb = lat[1]*8.517 bb_bb = lat[1]*7.018 mmc19 rese20 set neig, rese21 set env, 1, 0.5, r[0], AA, AA22 set env, 2, 0.5, r[1], AA, BB23 set env, 3, 0.5, r[1], BB, AA24 set env, 4, 0.5, r[2], BB, BB25 #26 #27 set neig, env, 128 set neig, add29 set neig, env, 230 set neig, add31 set neig, env, 332 set neig, add33 set neig, env, 434 #35 set mode, 0.7, shift, all36 set mode, 1.0, swchem,all37 #38 set move, 1, 0.100,0.100,0.039 set move, 2, 0.100,0.100,0.040 #41 set target,1,len, aa, aa, aa_aa,100.,12,642 set target,2,len, aa, bb, aa_bb,200.,12,643 set target,3,len, aa, bb, aa_bb,200.,12,644 set target,4,len, bb, bb, bb_bb,100.,12,645 #46 set temp, 147 set cycl,n[1]* 50048 set feed,n[1]* 1049 show50 run51 exit52 #

File: domain/dom.spheres.replace.mac1 # dom.spheres.replace.mac2 #3 domain4 #5 rese6 mode pseudo7 input dom.sph.domains.list8 assign char, AA, sphere9 assign fuzzy, AA, 2.0

10 assign cont, AA, dom.sph.AA.stru11 assign shape ,AA,1, 2.4, 0. , 0. , 0.12 assign shape ,AA,2, 0. , 2.4, 0. , 0.13 assign shape ,AA,3, 0. , 0. , 2.4, 0.14 assign orient,AA,1, 1. , 0. , 0. , 0.15 assign orient,AA,2, 0. , 1. , 0. , 0.16 assign orient,AA,3, 0. , 0. , 1. , 0.1718 assign char, BB, sphere19 assign fuzzy, BB, 2.020 assign cont, BB, dom.sph.BB.stru21 assign shape ,BB,1, 1.4, 0. , 0. , 0.22 assign shape ,BB,2, 0. , 1.4, 0. , 0.23 assign shape ,BB,3, 0. , 0. , 1.4, 0.24 assign orient,BB,1, 1. , 0. , 0. , 0.25 assign orient,BB,2, 0. , 1. , 0. , 0.26 assign orient,BB,3, 0. , 0. , 1. , 0.2728 show29 run30 exit

ing process uses shifting of individual atoms as well as switching ofrandomly picked pairs, lines 35 and 36. Such a sorting process does nottry to mimic the actual diffusion within a crystal, but just tries to createthe intended result efficiently.

Notice that the shifting of the pseudo-atoms allows these to assumeany fractional position within the host metric. In the final structureall atoms, the host and domain atoms, shall occupy the position (0,0, 0). To achieve this, all pseudo-atoms are shifted to the next inte-ger lattice point after the sorting has finished. After the sorting pro-cess the structure will look like in Fig. 8.7, which shows a section ofthe total crystal. Finally, the sorted arrangement of domains is usedby the macro called dom.spheres.replace.mac to replace part of the atomswithin the host crystal by the domain structures. This step is essen-tially identical to the corresponding step in previous examples. Afterdefining the input mode to pseudo (line 6) and naming the input filedom.sph.domains.list (line7), the parameters for the two domains are de-fined. Each domain character is defined as a spherical domain (lines 8and 18), yet still a minimum distance to the atoms in the original crystalis defined via assign fuzzy, AA, 2.0 (lines 9 and 19) . The radiusof the two domain types is given by expanding the shape matrix bya factor of 2.4 and 1.4, respectively. After the replacement, the struc-ture looks like Fig. 8.8. The spherical domains are placed at averagedistances throughout the original structure. Remember that no angularcorrelation was introduced. The Fourier transform of the final structureshows intense ring shaped diffuse scattering around each Bragg reflec-tion. This diffuse scattering is due to the fact that the difference betweenthe host and the domains is just the ordering of equal atoms into respec-tive domains. Such a short range order between atoms of equal type

0

–1

[0 k

0]

0

0

[h 0 0 ]

5×10

51.

5×10

6

Inte

nsity

106

Fig. 8.8 Left: final crystal structure. The short-range order domain distribution has beenreplaced by the corresponding spherical guest structures. Right: Fourier transform of thecrystal with ordered domain distribution.

Page 135: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

124 Creating domain structures

will give diffuse scattering in the vicinity around each Bragg reflection.The Fourier transform of the domain distribution is multiplied with theFourier transformation of the domains. As a consequence, the diffuseintensity close to the Bragg reflections is almost zero.File: domain/dom.perov.mac

1 # dom.perov.mac2 #3 variable integer,dimen4 variable real,ratio5 #6 ratio = 1.00257 dimen = 508 #9 @dom.perov.make

10 #11 read12 cell dummy.perov.cell,dimen,dimen,dimen13 #14 replace d100,d010,all,1./3.15 replace d100,d001,all,1./2.16 chem17 elem18 set mode,period,quick19 exit20 #21 @plot.dummy.sphere dom.perov.random22 #23 @dom.perov.sort24 @plot.dummy.sphere dom.perov.sorted25 @dom.perov.relax26 @plot.dummy.sphere dom.perov.relaxed27 @dom.perov.fourier dom.perov.relaxed28 save29 outf dom.perov.relaxed.list30 write ncell31 run32 exit33 @dom.perov.replace dom.perov.relaxed34 @dom.perov.fourier dom.perov.final

File: domain/dom.perov.sort.mac1 # dom.perov.sort.mac2 #3 mmc4 rese5 set neig, rese6 set vec, 1, 1,1, 1, 0, 07 set vec, 2, 1,1, -1, 0, 08 set vec, 3, 1,1, 0, 1, 09 set vec, 4, 1,1, 0,-1, 0

10 set vec, 5, 1,1, 0, 0, 111 set vec, 6, 1,1, 0, 0,-112 #13 set neig, vec, 1, 2, 3, 4, 5, 614 set neig, add15 set neig, vec, 1, 2, 3, 4, 5, 616 set neig, add17 set neig, vec, 1, 2, 3, 4, 5, 618 #19 set mode, 1.0, swchem,local20 #21 set target,1,corr,d100,d010,0.8,-1.,ENER22 set target,2,corr,d100,d001,0.8,-1.,ENER23 set target,3,corr,d010,d001,0.8,-1.,ENER24 #25 set temp, 126 set cycl, n[1]*10027 set feed, n[1]* 128 show29 run30 exit31 #

8.5 Domain formation in Perovskites

In this example we will create a crystal that will ultimately consist ofthree different domain orientations. Each domain shall be a tetragonalcrystal with c : a ratio close to unity. This would, for example, be thecase in a perovskite slightly below the tetragonal/cubic phase transi-tion. As base structure we will use the cubic perovskite structure. Thissimulation involves three main steps, which will utilize our domainconcept in a slightly different sense. In the first step we will create ashort-range ordered crystal of three dummy atom types. Each of theseatom types represents a single unit cell of the distorted crystal struc-ture. Thus, to create domains of the distorted structure larger than asingle unit cell, these dummy atoms shall have a tendency to be nextto each other. Thus a final domain of the distorted structure is createdby sorting the dummy atoms, which could be called meta-domains. Inthe second step, the distances between the dummy atoms are adjustedto create the tetragonal distortion. In the third, final step, each of thedummy atoms is replaced by the actual atoms read from a correspond-ing unit cell. While reading these unit cells, the corresponding tetrag-onal distortion is carried out within each unit cell. The correspondingmacro dom.perov.mac begins by defining the c : a ratio as 1.0025 and thecrystal dimension (lines 6 and 7). The macro dom.perov.make.mac (line9) simply reads the asymmetric unit of perovskite, expands it to a sin-gle unit cell and save this for later use. No distortion is carried out atthis step. The actual distortion of the cubic structure into the tetragonalunit cell is done later during the replacement of the dummy atoms bythe domain which they represent.

Alternatively, one could equally well create three different unit cellsright now, which are distorted by the desired c : a ratio along one of the[100] directions. In this case, no further distortion would be performedduring the replacement process. Next, the unit cell dummy.perov.cellis expanded to the required crystal size (lines 11 and 12). This unitcell contains a single pseudo atom d100 in a primitive cubic cell. Thename d100 serves as a reminder that this pseudo atom shall representa unit cell of the distorted structure, whose c-axis is along the cubic[100] direction. Next, in lines 14 and 15, one-third of the dummy atomsare replaced by d010 and half of the remaining two-thirds by d001,which ensures that each of the three dummy atom types is presentwith approximately the same number of atoms. After plotting this ran-domly distributed structure, the dummy atoms are sorted by the macrodom.perov.sort.mac and we will now have a closer look at this macro.We use the Monte Carlo algorithm as described in Chapter 5 to sort

Page 136: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.5 Domain formation in Perovskites 125

the dummy atoms. Refer to this chapter for additional details of theMonte Carlo algorithm. The goal is to switch the atoms until domainsare created that mostly consist of one atom type. This means that each File: domain/dom.perov.relax.mac

1 # dom.perov.relax.mac2 #3 variable real,t_a4 variable real,t_l5 variable real,t_s67 t_a = lat[1]8 t_l = lat[1]*1.00259 t_s = lat[1]/sqrt(1.0025)

10 #11 mmc12 rese13 set neig, rese14 set vec, 1, 1,1, 1, 0, 015 set vec, 2, 1,1, -1, 0, 016 set vec, 3, 1,1, 0, 1, 017 set vec, 4, 1,1, 0,-1, 018 set vec, 5, 1,1, 0, 0, 119 set vec, 6, 1,1, 0, 0,-120 #21 #22 set neig, vec, 1, 223 set neig, add24 set neig, vec, 3, 425 set neig, add26 set neig, vec, 5, 627 #28 set neig, add29 set neig, vec, 1, 2, 3, 4, 5, 630 #31 #32 set mode, 1.0, shift33 set move, d100, 0.001, 0.001, 0.00134 set move, d010, 0.001, 0.001, 0.00135 set move, d001, 0.001, 0.001, 0.00136 #37 set target,1,len,d100,d100,t_l,200,12,638 set target,1,len,d010,d010,t_s,200,12,639 set target,1,len,d001,d001,t_s,200,12,640 set target,1,len,d100,d010,t_a,200,12,641 set target,1,len,d100,d001,t_a,200,12,642 set target,1,len,d010,d001,t_a,200,12,643 set target,2,len,d100,d100,t_s,200,12,644 set target,2,len,d010,d010,t_l,200,12,645 set target,2,len,d001,d001,t_s,200,12,646 set target,2,len,d100,d010,t_a,200,12,647 set target,2,len,d100,d001,t_a,200,12,648 set target,2,len,d010,d001,t_a,200,12,649 set target,3,len,d100,d100,t_s,200,12,650 set target,3,len,d010,d010,t_s,200,12,651 set target,3,len,d001,d001,t_l,200,12,652 set target,3,len,d100,d010,t_a,200,12,653 set target,3,len,d100,d001,t_a,200,12,654 set target,3,len,d010,d001,t_a,200,12,655 set target,4,ang,d001,d001,d001,90,0.00156 set target,4,ang,d010,d010,d010,90,0.00157 set target,4,ang,d100,d100,d100,90,0.00158 #59 set temp, 160 set cycl, n[1]*100061 set feed, n[1]* 10062 show63 run64 exit65 #

atom shall preferentially be surrounded by equal atoms. Since the ini-tial crystal consists of a primitive cubic structure with a single atom at(0, 0, 0), the fastest way to define the neighborhood of an individualatom is to specify the neighbors by vectors that point into the next unitcells. The six symmetrically equivalent vectors are specified in lines6 through 11 of the macro. Next we specify three different neighbor-hoods that each consist of all six [100] vectors (line 13–17). For each ofthese neighborhoods a positive correlation is defined for a pair of thepseudo-atoms. This will force the Monte Carlo simulation to sort theatoms into regions in which each atom is preferentially surrounded byatoms of the same type.

Since we have to sort three different atom types, it would actuallybe sufficient to specify positive correlations between two pairs, ratherthan all three pairs. The modification of the structure is performedby switching a randomly selected pair of atoms, while keeping theiratomic positions constant, line 19. This process does not attempt tomimic the actual process in the real crystal, where the growth of a do-main happens by shifting/diffusion of neighboring atoms. After thesorting process, the initially random arrangement of pseudo-atoms inFig. 8.9 (left) is replaced by a structure that consists of domains of equalatom types (Fig. 8.9 right). As in the previous Monte Carlo examples,the number of wrong atoms and the size of the resulting domains de-pends on the SRO parameter, the number of Monte Carlo cycles, andthe pseudo temperature used in the Monte Carlo run.

The next major step in the simulation is the relaxation of the struc-ture in order to achieve the desired tetragonal distortion, see macrodom.perov.relax.mac. Again, a Monte Carlo process is used for this part

Fig. 8.9 Left: randomly arranged pseudo-atoms. Only a small fraction of the total crystalis shown. Right: the pseudo-atoms have been sorted into domains. Only a small fractionof the total crystal is shown.

Page 137: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

126 Creating domain structures

0[h 0 0]

2–2 0[h 0 0]

2–20

[0 k

0]

2

4

6

5×10

61.

5×10

7

Inte

nsity

107

Fig. 8.10 Diffraction patterns. Left: structure with relaxed domain positions. Right: finalstructure.

of the simulation. Here, the atoms are shifted to achieve an elonga-tion along the corresponding domain axis and a contraction along thetwo other axes. Three neighborhoods that consist of nearest neighborsalong each of the respective [100] axes are used to define the distancesbetween the atoms, while one neighborhood that consists of all six [100]directions is used to define the bond angles. Each of the three pseudo-atoms is allowed to move in a general direction.

For each of the pseudo-atoms, the desired distance along the axisthat represents the unique c-axis of the domain is is set to the extendeddistance t_l. The interatomic distances along the other two [100] di-File: domain/dom.perov.replace.mac

1 # dom.perov.replace.mac2 #3 domain4 rese5 mode pseudo6 input $1.list7 assign char, d100, fuzzy8 assign fuzzy, d100, 0.59 assign cont, d100, perovskite.stru

10 assign shape ,d100,1,1., 0., 0., 0.11 assign shape ,d100,2,0., 1., 0., 0.12 assign shape ,d100,3,0., 0., 1., 0.13 assign orient,d100,1,ratio, 0., 0., 0.14 assign orient,d100,2,0.,1./sqrt(ratio),0.,0.15 assign orient,d100,3,0.,0.,1./sqrt(ratio),0.16 #17 assign char, d010, fuzzy18 assign fuzzy, d010, 0.519 assign cont, d010, perovskite.stru20 assign shape ,d010,1,1., 0., 0., 0.21 assign shape ,d010,2,0., 1., 0., 0.22 assign shape ,d010,3,0., 0., 1., 0.23 assign orient,d010,1,1./sqrt(ratio),0.,0.,0.24 assign orient,d010,2,0., ratio, 0., 0.25 assign orient,d010,3,0.,0.,1./sqrt(ratio),0.26 #27 assign char, d001, fuzzy28 assign fuzzy, d001, 0.529 assign cont, d001, perovskite.stru30 assign shape ,d001,1,1., 0., 0., 0.31 assign shape ,d001,2,0., 1., 0., 0.32 assign shape ,d001,3,0., 0., 1., 0.33 assign orient,d001,1,1./sqrt(ratio),0.,0.,0.34 assign orient,d001,2,0.,1./sqrt(ratio),0.,0.35 assign orient,d001,3,0., 0., ratio, 0.36 #37 show38 run39 exit

rections is set to the shortened distance t_s. By setting the factor thatshortens the distance proportional to 1/

√tl, the overall volume is kept

constant. A Lennard-Jones potential is used to achieve the shift to thedesired distances. As can be seen in the left panel of Fig. 8.9, the do-mains have an irregular shape and are randomly placed throughout thecrystal. Thus, in order to achieve the desired distances, the atoms mustbe moved in general directions. In order to ensure, however that the in-ternal structure of each domain remains as perfectly crystalline as pos-sible, bond angles must be specified in addition to the bond distances.In lines 37–39 the target values for the interatomic distances betweenatom pairs of equal type are specified. Since this is the [100] direction,the d100-d100 target distance is set to the long value, while the othertwo distances are set to the short distance. In the next three lines inter-atomic distances between pseudo-atoms of different types are specified.This is necessary to prevent cracks from forming within the crystal. If,for example, a d100 and a d010 domain are next to each other witha (001) plane as boundary, both will shrink along the [001] direction,i.e. the normal to the interface. If the domains are large and/or thenew c : a ratio deviates much from unity, this may lead to unphysicalinteratomic distances on this border between the two domains. Essen-tially the two domains would become smaller and leave a crack along

Page 138: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.5 Domain formation in Perovskites 127

the border region. Similarly, at a (100) interface between a small d010domain and a large d100 domain, the expansion of the d100 domainwould cause too short interatomic distances. To prevent this, the twodomains must be shifted with respect to each other. Finally consideragain, a d100 domain adjacent to a d010 domain with (001) as domainboundary. The atoms will shift parallel to the interface in different di-rections, [100] and [010], respectively. For a large domain interface, adislocation may actually form. In the present example the shift fromthe average position is small, and the overall shifts are small. Never-theless to be thorough, we define the bond distances across the domainboundaries. Finally the targets for the bond angles are all set to 90◦ inlines 55–57. To ensure thorough relaxation, quite a few Monte Carlocycles must be performed. In this example each atom is shifted on av-erage 1 000 times.

The Fourier transform of the crystal that consists of these pseudoatoms can be carried out just as any Fourier transform, provided scat-tering factors for the pseudo-atoms are defined. The Fourier transformin Fig. 8.10 on the left has been calculated by setting the scattering ofthe dummy atoms to that of Zr. Although all atoms in this structureare chemically identical, diffuse scattering is observed, due to the dis-placement of the atoms. The main diffuse features are broad maximacentered around each Bragg reflection. The width of the diffuse scat-tering corresponds to the average domain diameter. As the last step ofthe simulation, each of the pseudo-atoms must be replaced by a unitcell of the distorted structure. The domain content is the ideal cubicperovskite unit cell stored by the initial macro dom.perov.make.mac asfile perovskite.stru. The distance between each unit cell origin is nowdetermined by the positions of the pseudo-atoms after the relaxationprocess. We still have to distort each individual unit cell. This is doneby specifying the orientation matrix of the d100 domains as:

⎛⎝ ratio 0 0

0 1/√

ratio 0

0 0 1/√

ratio

⎞⎠ (8.7)

where ratio is the c : a ratio of the tetragonal structure. This transformsthe atom positions from the cubic unit cell into the desired tetragonalunit cell. The d010 and d001 transformation matrices are defined ac-cordingly.

After replacing the pseudo-atoms by the perovskite structure, theFourier transform is calculated as in Fig. 8.10 on the right. The essentialfeatures of the Fourier transform remain unchanged. The intensity dis-tribution reflects the structure factor of the perovskite structure. Sincethis is a fairly simple cubic structure with metal atoms at (0, 0, 0) and(1/2, 1/2, 1/2), the structure factor is close to that of a cubic body cen-tered structure and is weaker at h, k, l with h + k + l = 2n + 1.

Page 139: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

128 Creating domain structures

Max

0

c*

b*

b*

a*

Fig. 8.11 Observed X-ray diffraction patterns of HD-urea collected at room temperature.The left image shows the 0kl layer; the right image shows the hk0 layer. The data arereproduced with kind permission of Richard Welberry, Australian National University.

8.6 Example: Urea inclusion compounds

Host-guest structures occur for a variety of compounds, especially com-binations of organic and inorganic molecules. In a very general def-inition, one of the molecules can be considered the host that forms acrystal structure with voids. These voids are in turn filled by the guestmolecules. Diffuse scattering, reflecting disorder, is common in thesecompounds. Often, the voids are well separated by the host crystalstructure and as a consequence the interaction between guest moleculesis weak. This may for example lead to random placement of the guestmolecules in different voids. In many host-guest structures, the unitcell of the host does not fit the size of the guest. Such a situation isencountered, for example, if the host forms channels that are filled bythe guest molecules. As a consequence of the interaction between hostand guest complex disorder occurs, which will strongly depend on therelative size of the host structure and the guest molecules.

Such a situation is encountered, for example, in urea inclusion com-pounds. The urea host structure consists of hydrogen bonded ureamolecules with a honeycomb like structure that forms channels parallelto c, which can be filled with a wide variety of chain-like molecules. Inour example, we will use alkane chains to fill the channels within theurea host crystal. These crystals show complex disorder phenomena[13, 14]. Two sections of diffuse X-ray scattering of heptadecane-urea(HD-urea) are shown in Fig. 8.11. The following diffuse scattering fea-tures can be observed:

• Sharp layers of diffuse scattering normal to c*. The distance be-tween these layers corresponds to the inverse of the repeat dis-tance between the corresponding alkane molecules. The sharplayer at l = 0 is much weaker than the layers at l �= 0. This diffuse

Page 140: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.6 Example: Urea inclusion compounds 129

scattering can be attributed to the independent placement of thealkanes in different channels.

• Broad diffuse bands normal to c* at positions that correspond to areal-space distance of 2.56 Å and can be attributed to the structurefactor of a single alkane chain.

• Broad diffuse scattering in planes normal to c* around Bragg po-sitions of the urea host.

• Diffuse maxima and streaks within the sharp diffuse layers. Thisdiffuse scattering shows that the alkane positions in neighboringchannels are not completely independent.

• General continuous diffuse background scattering. This has beenattributed as monotonic Laue scattering due to uncorrelated fluc-tuations in atomic positions.

Depending on the alkane chosen, its length is not a rational multiple ofthe host c-axis length. Accordingly, the positions of the sharp diffuselayers are at positions incommensurate with the reciprocal lattice of theurea host. To simulate the urea host, one will naturally choose its unitcell size and shape. A single alkane chain is a zig-zag sequence of CH2

groups, with a periodicity of two groups. Thus its simulation is proba-bly more easily done in a rectangular unit cell, whose c-axis is equal tothe length of next neighbor carbon distances.

Fig. 8.12 Schematic structure of an alkanechain.

We will begin the development by creating the alkane molecule. Thepositions of the alkane molecule were determined by [15]. Instead oftaking the atom coordinates as given in this paper, we will use thebond length and bond angles to create a chain of variable length. Inthe paper the position of the carbon atoms are with respect to a hexag-onal unit cell that reflects the unit cell size of the urea host in the abplane and the periodicity of the alkane chain stacking (a = 8.218 Å,c = 23.713 Å). The central atom of the C17H34 chain in this paper wasgiven as (0.0525, 0.0, 0.5), the next carbon is at (−0.0525, 0.0, 0.5540), i.e.the height difference of nearest neighbors is 0.0540 c. From these data ofall carbon atoms one can calculate the average bond distance betweencarbon atoms in the alkane chain as 1.5368 Å, and the vertical angle as111.68◦. The average vertical periodicity of the alkane chain is 2.5432 Å,and the bond distance between the two carbon atoms is 1.2716 Å. Inprojection onto a plane normal to the chain axis the distance betweencarbon atoms is 0.8629 Å. Thus, in a cartesian coordinate system we canplace the first carbon atom at a position 0.4314, 0, 0 and use a 21 screwaxis with vertical translation of 1.2716 Å to create an alkane chain. Theexact position of the hydrogen atoms is unknown, we can assume thatthese are in the plane normal to the chain axis at a height of the carbonatoms at distance 1.092 Å and a H-C-H bond angle of 109.47◦. Thus theC-H vector is 1.092 cos(109.47/2), 1.092 sin(109.47/2), 0.0. and its mirrorimage with negative b-component. Finally, we add the last hydrogen ofthe terminal CH3 group. Do do this, the bond vector between the firsttwo (last two) carbons is reflected on the (001) plane, adjusted to a bondlength of 1.092 Å and added to the first (last) carbon atom. Figure 8.12shows a schematic sketch of the resulting chain for C7H16. To use the

Page 141: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

130 Creating domain structures

0

[h 0 0]

3–3

–10

–5

0

5

10

[0 0

l]

5×10

41.

5×10

52×

105

3×10

54×

105

5×10

52.

5×10

53.

5×10

54.

5×10

5

Inte

nsity

105

Fig. 8.13 Fourier transform of a single heptadecane molecule.

molecule in the urea inclusion compounds, one should transform thecartesian coordinates into the hexagonal base of the urea host. Sincethe zig-zag chain of the alkane is in the cartesian ac-plane, the hexag-onal a-axis should be parallel to the cartesian a-axis, the hexagonal b-axis in the cartesian ab-plane at 120◦ angle to the a-axis and the c-axisparallel to the cartesian c-axis. With the hexagonal lattice constants ofah = 8.218 Å, ch = 11.017 Å, the transformation matrix is:

Fig. 8.14 Schematic drawing of the ureahost. Left: randomly placed alkanemolecules. Right: ordered alkanemolecules.

⎛⎝ ah

bh

ch

⎞⎠ =

⎛⎝ ah 0 0

ah cos(120) ah sin(120) 00 0 ch

⎞⎠

⎛⎝ ac

bc

cc

⎞⎠ (8.8)

Figure 8.13 shows the h0l layer of the Fourier transform of a single hep-tadecane (C17H36) molecule. Reciprocal units are those of the urea host.The intensity distribution corresponds very well to that of the broaddiffuse bands labeled d-band in Forst et al. [13], Weber et al. [16] and B-bands in Welberry and Mayo [14]. Consequently, these broad bands canbe explained by longitudinal and lateral disorder of the heptadecaneguest molecules [16]. According to Forst et al. [17], the projection of thealkane carbon-carbon bond into the ab-plane points towards the cornersof the urea channels and thus is oriented along the [210] direction andits symmetrically equivalent directions. At higher temperatures, theorientation of the alkane molecules in different channels and along a

Page 142: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.6 Example: Urea inclusion compounds 131

given channel is randomly distributed over these three orientations, asschematically shown in Fig. 8.14 on the left. The hexagons in this figurerepresent the urea framework, while the short lines represent the orien-tation of the alkane chains. At lower temperature, the alkane moleculesstart to order into a herringbone-like pattern, as shown in Fig. 8.14 onthe right. Along the [100] directions equally oriented alkane moleculesare next to each other, while along the [010] directions alkane moleculesin [210] and [110] direction alternate. Equivalent herringbone patternsexist by rotating this pattern around the c-axis by 120◦. Domains formthat consist of the three symmetrically equivalent herringbone patterns.

In the following part, we will explain how to simulate such a crystalthat consists of the urea framework with domains in which the alkanemolecules locally form a herringbone arrangement. The main steps ofthe simulation are very similar to that of the domain structure in theperovskite crystal. We will first generate three copies of the alkane File: domain/dom.urea.mac

1 # dom.urea.mac2 #3 variable integer,dimen4 #5 dimen= 1006 #7 read8 cell urea.dummy.cell,dimen,dimen,19 #

10 replace a10,a11,all,1./2.11 replace a10,b10,all,1./3.12 replace a10,b01,all,1./2.13 replace a11,c01,all,1./3.14 replace a11,c11,all,1./2.15 #16 save17 outfile dom.urea.random.list18 write ncell19 write scat20 write adp21 run22 exit23 #24 read25 stru dom.urea.random.list26 #27 @dom.urea.order dom.urea.final28 #29 @plot.urea.sphere dom.urea.ordered30 #31 read32 cell urea.host.cell,dimen,dimen,333 @dom.urea.shift34 @dom.urea.replace dom.urea.final35 #36 @plot.urea.kuplot dom.urea.final37 #38 @dom.urea.f.domain dom.urea.final

molecule oriented along the [210], [110], and [120] direction. Thesealkane molecules will eventually be placed into the urea host struc-ture. The second step consists of setting up a crystal with randomlydistributed pseudo-atoms, each of which represents one of the threepossible alkane orientations. In the third step, these pseudo-atoms aresorted into three different domains. In the first domain type, equalpseudo-atoms are arranged along the [100] directions and alternatingpseudo-atoms along the [010] directions. The pseudo atom type inthis domain represents the [210] and [110] orientations of the alkanemolecule, as shown on the right in Fig. 8.14. The other two domaintypes can be generated from this domain type by 120◦ rotations aroundthe c-axis. In the final step, a large urea crystal is generated and the listof ordered pseudo-atoms is used to determine which alkane orientation

Fig. 8.15 Ordered distribution of the pseudo-atoms. The symbols x and - represent a10and b10 pseudo-atoms, the open and closed circles a11 and c11, and the open andclosed squares b01 and c01.

Page 143: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

132 Creating domain structures

is to be placed into which channel. The file urea.dummy.cell contains inthe urea host metric a single pseudo atom of type a10. This atom isreplaced by equal amounts of six different pseudo-atoms in lines 10–14of the macro. Pseudo atoms of type a represent alkane molecules in[210] orientation, those of type b [110], orientations and type c [120] ori-entations. Pseudo atoms with the string 10 in their name will be sortedin domains with equal atoms along [100], those with 01 will be sortedinto domains with equal atoms along [010], and finally the 11 pseudo-atoms will be sorted into domains with equal atoms along [110]. Al-though pseudo-atoms a10 and a11 represent alkane molecules in iden-tical orientation, they are distinguished at this step to facilitate the or-dering process. Next, the macro dom.urea.order.mac sorts the pseudo-atoms into the intended domains, which are representations of the localherringbone structure. The six symmetrically equivalent [100] vectorsFile: domain/dom.urea.order.mac

1 # dom.urea.order.mac2 #3 mmc4 rese5 set neig, rese6 set vec, 1, 1,1, 1, 0, 07 set vec, 2, 1,1, -1, 0, 08 set vec, 3, 1,1, 0, 1, 09 set vec, 4, 1,1, 0,-1, 0

10 set vec, 5, 1,1, -1,-1, 011 set vec, 6, 1,1, 1, 1, 012 #13 set neig, vec, 1, 214 set neig, add15 set neig, vec, 3, 416 set neig, add17 set neig, vec, 5, 618 #19 set neig, add20 set neig, vec, 3, 421 set neig, add22 set neig, vec, 1, 223 set neig, add24 set neig, vec, 5, 625 #26 set neig, add27 set neig, vec, 5, 628 set neig, add29 set neig, vec, 1, 230 set neig, add31 set neig, vec, 3, 432 #33 set mode, 1.0, swchem,all34 #35 set target,1,corr,a10,b10, 0.999,-10.,CORR36 set target,2,corr,a10,b10,-0.999, 10.,CORR37 set target,3,corr,a10,b10,-0.999, 10.,CORR38 #39 set target,4,corr,b01,c01, 0.999,-10.,CORR40 set target,5,corr,b01,c01,-0.999, 10.,CORR41 set target,6,corr,b01,c01,-0.999, 10.,CORR42 #43 set target,7,corr,c11,a11, 0.999,-10.,CORR44 set target,8,corr,c11,a11,-0.999, 10.,CORR45 set target,9,corr,c11,a11,-0.999, 10.,CORR46 #47 set temp, 248 set cycl,n[1]* 50049 set feed,n[1]* 5050 run51 exit52 #53 save54 outf $1.list55 omit all56 run57 exit

(lines 5 through 11) are used to define the next neighbors around eachpseudo atom These vectors are grouped into nine neighborhoods (lines13 through 31). The first neighborhood serves to sort identical a10 andb10 pseudo-atoms along 〈100〉, while the next two serve to create al-ternating patterns of these two pseudo-atoms along 〈010〉 and 〈110〉.Here, it would be sufficient to create the alternation along just the [010]direction. This would create, however, a slight bias towards the [010]direction and make alternating pairs in the [110] directions a tiny bitless likely. If you analyze the right side of Fig. 8.14, you will see thatwith respect to the alternation, the directions [010] and [110] are sym-metrically equivalent within this domain, and thus should be treatedequivalently in the sorting process. This symmetry does not, of course,hold for the final structure, once the pseudo-atoms are replaced by ac-tual alkane molecules. The next two groups of three neighborhoodsdefine analogous directions for the domains with equal pseudo-atomsalong [010] and [110], respectively. The modification of the crystal dur-ing the Monte Carlo run is carried out by switching the type of ran-domly picked pseudo atom pairs, line 33 of the macro. The first target,line 35, specifies a positive target correlation of 0.999 for the neighbor-hood number 1 between a10 and b10 pseudo-atoms, while the next twotarget lines specify negative correlations between these pseudo-atomsalong the directions specified by neighborhoods 2 and 3. The targetlines for neighborhoods 4 through 6 and 7 through 9 define analogousvalues for the domains with equal atom type along [100] and [110]. Fur-ther control parameters of the Monte Carlo run are the temperatureand the number of cycles. The latter was set to 500 times the number ofpseudo-atoms in the crystal, which means that on average each pseudoatom is switched with another one 500 times. In such a hexagonal struc-ture, where three different domains are to be generated, it takes manycycles to grow the domains to a reasonably large size.

As result of this simulation the structure in Fig. 8.15 is created. Threedifferent domains that can be distinguished by alternating lines of equalsymbols along [100], [010] and [110] have formed. Alternating rowsof "x" and "-" symbols represent the a10 and b10 pseudo-atoms, i.e.

Page 144: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.6 Example: Urea inclusion compounds 133

pseudo-atoms, which will eventually be replaced to create the herring-bone structure of Fig. 8.14 on the right. At this stage of the simulation,though, the structure still consists of pseudo-atoms only. This orderedstructure is stored and serves as the list of the pseudo atom positions. File: domain/dom.urea.replace.mac

1 # dom.urea.replace.mac2 #3 domain4 #5 rese6 mode pseudo7 input $1.list8 assign char, a10, fuzzy9 assign fuzzy, a10, 3.0

10 assign cont, a10, dom.alk.a.stru11 assign shape ,a10,1, 1., 0., 0., 0.12 assign shape ,a10,2, 0., 1., 0., 0.13 assign shape ,a10,3, 0., 0., 1., 0.14 assign orient,a10,1, 1., 0., 0., 0.15 assign orient,a10,2, 0., 1., 0., 0.16 assign orient,a10,3, 0., 0., 1., 0.1718 assign char, a11, fuzzy19 assign fuzzy, a11, 3.020 assign cont, a11, dom.alk.a.stru21 assign shape ,a11,1, 1., 0., 0., 0.22 assign shape ,a11,2, 0., 1., 0., 0.23 assign shape ,a11,3, 0., 0., 1., 0.24 assign orient,a11,1, 1., 0., 0., 0.25 assign orient,a11,2, 0., 1., 0., 0.26 assign orient,a11,3, 0., 0., 1., 0.2728 assign char, b10, fuzzy29 assign fuzzy, b10, 3.030 assign cont, b10, dom.alk.b.stru31 assign shape ,b10,1, 1., 0., 0., 0.32 assign shape ,b10,2, 0., 1., 0., 0.33 assign shape ,b10,3, 0., 0., 1., 0.34 assign orient,b10,1, 1., 0., 0., 0.35 assign orient,b10,2, 0., 1., 0., 0.36 assign orient,b10,3, 0., 0., 1., 0.3738 assign char, b01, fuzzy39 assign fuzzy, b01, 3.040 assign cont, b01, dom.alk.b.stru41 assign shape ,b01,1, 1., 0., 0., 0.42 assign shape ,b01,2, 0., 1., 0., 0.43 assign shape ,b01,3, 0., 0., 1., 0.44 assign orient,b01,1, 1., 0., 0., 0.45 assign orient,b01,2, 0., 1., 0., 0.46 assign orient,b01,3, 0., 0., 1., 0.4748 assign char, c11, fuzzy49 assign fuzzy, c11, 3.050 assign cont, c11, dom.alk.c.stru51 assign shape ,c11,1, 1., 0., 0., 0.52 assign shape ,c11,2, 0., 1., 0., 0.53 assign shape ,c11,3, 0., 0., 1., 0.54 assign orient,c11,1, 1., 0., 0., 0.55 assign orient,c11,2, 0., 1., 0., 0.56 assign orient,c11,3, 0., 0., 1., 0.5758 assign char, c01, fuzzy59 assign fuzzy, c01, 3.060 assign cont, c01, dom.alk.c.stru61 assign shape ,c01,1, 1., 0., 0., 0.62 assign shape ,c01,2, 0., 1., 0., 0.63 assign shape ,c01,3, 0., 0., 1., 0.64 assign orient,c01,1, 1., 0., 0., 0.65 assign orient,c01,2, 0., 1., 0., 0.66 assign orient,c01,3, 0., 0., 1., 0.6768 show69 run70 exit

The next step is to create the urea frame work and to insert the actualalkane molecules at the positions of the pseudo-atoms. To do so, weread the host unit cell and expand it to a large crystal. In this presentsimulation, we aim to simulate the diffuse scattering in the hk0 layer.This layer corresponds to the Fourier transform of the projection of allatoms into the ab-plane of the crystal. Consequently, this Fourier trans-form cannot give any information about the relative height of the indi-vidual alkane molecules in the different channels and we are basicallydealing with a two-dimensional crystal structure. In order to comparethe diffraction pattern with the experimental one, the relative ratio ofurea and alkane molecules should be approximately correct. This isachieved in this simulation by expanding the host crystal to three unitcells along the c-axis, since the periodicity of the heptadecane moleculesin the channels is approximately three times the urea c-lattice constant.In the macro dom.urea.shift.mac, the host structure is shifted up alongthe c-axis to extend from z = 0 to z = 3, since the alkane molecules areplaced in this range. This shift has no influence on the Fourier trans-form, and serves just to allow better plotting of the final structure.

The replacement of the pseudo-atoms is carried out very similarlyto the replacement done in the perovskite simulation. In the macrodom.urea.replace.mac the parameters for each of the pseudo atom typesare defined. Each pseudo atom represents a fuzzy domain, i.e. no ex-

–4 –3 –2 –1 0 1 2 3 4[h 0 0]

[0 k

0]

–3

–2

–1

0

1

2

3

Fig. 8.16 hk0 diffraction pattern calculated for the ordered urea-alkane inclusion com-pound.

Page 145: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

134 Creating domain structures

plicit domain shape is defined. Since the alkane chain fits nicely into thechannel of the urea structure, without replacing any other atoms, sucha domain character is appropriate. The content of the two a-type do-

Fig. 8.17 Projection of the urea n-alkanestructure onto the ab-plane.

File: domain/dom.urea.stack.mac1 # dom.urea.stack.mac2 #3 variable integer,dimen4 variable real,height5 variable real,sigma6 variable real,delta7 #8 sigma = 0.0069 dimen = 1

10 #11 read12 free 8.218, 8.218, 23.713, 90.,90.,120.13 #14 do i[0]=0,dimen-115 do i[1]=0,dimen-116 @dom.urea.stack.make i[0],i[1], 8017 enddo18 enddo19 #20 @dom.urea.stack.trans21 #22 save23 outfile dom.urea.stack.list24 omit ncell25 run26 exit27 #28 read29 free 8.218, 8.218, 11.017, 90.,90.,120.30 #31 @dom.urea.stack.replace32 @dom.urea.stack.fourier stack

File: domain/dom.urea.stack.make.mac1 # dom.urea.stack.make.mac2 #3 height = -1. + ran(0)4 #5 do i[2]=1,$36 delta = gran(sigma)7 delta = max(-3.*sigma,sigma)8 delta = min( 3.*sigma,sigma)9 height = height + 1.0 + delta

10 r[0]= ran(0)11 if(r[0].lt.2./6.) then12 insert C1,$1,$2,height, 2.513 elseif(r[0].lt.4./6.) then14 insert C2,$1,$2,height, 2.515 else16 insert C3,$1,$2,height, 2.517 endif18 enddo

mains a10 and a11 is defined as the atoms in file dom.alk.a.stru. This filecontains a single heptadecane molecule oriented such that the projec-tion of the C-C bond onto the ab-plane points in the [210] direction. Themolecules created at the beginning of this section were oriented alongthe [100] direction, and consequently have to be rotated around the c-axis by 30◦. The other two orientations follow simply from one, respec-tively two, rotations by 120◦ around the c-axis. In the approach, cho-sen for this example, the three different domains that replace a pseudoatom of given type have been completely oriented and scaled with re-spect to the urea host lattice prior to this simulation. Thus, the shapeand orientation matrix is a unit matrix for all domain types. After thereplacement, the final structure consists of the urea host framework,which extends three unit cells along the c-axis and a single heptade-cane molecule within each channel. Locally the heptadecane moleculesform domains with herringbone structure. A small section of the crys-tal is plotted in projection onto the ab-plane in Fig. 8.17. The hk0 sectionof the Fourier transform of the structure, Fig. 8.16, shows broad diffusemaxima close to the Bragg reflections as well as weaker diffuse scatter-ing in bands.

The final example in this section will use the domain concept to cre-ate a stack of alkane molecule, as is found within a single channel in theurea host structure. The independent placement of linear molecules inthe channels causes the sharp layers of diffuse intensity normal to c*.As pointed out earlier, the orientation of alkane molecules in neighbor-ing channels is not completely independent, and the previous exampleworked out the short-range order within adjacent channels. Since theorder in adjacent channels is not perfect, and additionally, the orienta-tion of nearest neighbor alkane molecules within a single given channelis also only weakly correlated, this example will create just the alkanemolecules within a single channel. The order within a single channelis dominated by random orientation and a para-crystalline order [16],and this example will simulate a channel accordingly. The simulationbegins by defining an empty hexagonal base, whose c-axis has beenchosen to match the average periodicity of the n-heptadecane chains inthe urea channels. Accordingly, the average separation between twoadjacent molecules will be, in fractional coordinates, equal to one. Theloops allow us to create not just one channel but many parallel chan-nels, subject to the value of the variable dimen. Within this loop, a se-quence of pseudo-atoms is aligned within each channel by the macrodom.urea.stack.make.mac. The orientation, as well as the relative heightof alkane molecules in neighboring channels is, to a first approxima-tion, independent. Accordingly, this macro sets the initial height toa uniform random value between −1 and 0. The following loop in-serts pseudo-atoms within one channel. The z-position of each pseudoatom is calculated relative to the previous pseudo atom, by adding a

Page 146: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

8.7 Bibliography 135

value of 1 + delta to the previous height, where delta is a Gaus-sian distributed value. The variance of this Gaussian distribution isan adjustable parameter and reflects the amount of longitudinal dis-placement disorder along a channel. Since a Gaussian distribution willeventually produce extreme values, the value of delta is limited to ±3sigma, to prevent huge gaps or overlaps between adjacent molecules.The pseudo atom type, and thus the orientation of the alkane chain, isdecided by uniform random choice. Alternatively, SRO along the chaincould be introduced at this point. Once all pseudo-atoms have been

0

[h 0 0]

2 4–2–4

–10

–5

0

5

10

[0 0

l]

2×10

53×

105

4×10

55×

105

6×10

57×

105

8×10

59×

105

106

Inte

nsity

105

Fig. 8.18 Fourier transform of a singlechannel of alkane molecules

distributed, the metric of the pseudo atom distribution is adjusted tothat of the urea host crystal. This is achieved by a unit cell transfor-mation, dom.urea.stack.trans.mac, in which the new c-axis is of length11.017 Å. This list is saved as file dom.urea.stack.list and will be usedas input in the replacement stage. This last stage begins by creatingan empty crystal with host metric. The replacement macro is basicallyidentical to previous replacement macros.

Figure 8.18 shows the scattering intensity of a small stack of alkanemolecules with a single channel. The stack had been created using asigma of 0.008 × 23.713 Å and a total number of 40 alkane molecules.This simple simulation reproduced the sharp layers normal to c∗. Sinceonly one channel had been simulated, the layer at l = 0 does not van-ish. This would vanish if a large number of independent channels weresimulated. Since the hk0-layer of reciprocal space corresponds to theFourier transform of a projection of the structure in real space, a simu-lation of many channels would give a projection into the ab-plane thatwould be periodic, which in turn would give a vanishing hk0 layer.Since the simulation contains independently oriented alkane moleculesalong the channel, the second characteristic diffuse feature of urea in-clusion compounds, the broad d-bands is reproduced as well.

8.7 Bibliography

[1] E. Salje, Ferroelastic and Co-elastic Phase transitions in Crystals, Cam-bridge University Press, Cambridge, 1990.

[2] A. Adlhart, Diffraction by crystals with planar domains, ActaCryst. 37, 794 (1981).

[3] H. Boysen, Diffuse scattering by domains and domain walls, PhaseTransitions 55, 1 (1995).

[4] S. Hashimoto, Correlative microdomain model for short-range or-dered alloy structures. I. Diffraction theory, Acta Cryst. A30, 792(1974).

[5] R.B. Neder, F. Frey, H. Schulz, Diffraction theory for diffuse scat-tering by correlated microdomains in materials with several atomsper unit cell, Acta Cryst. A46, 792 (1992).

[6] R.W. Röwer and U. Bismayer and W. Morgenroth and B. Güttler,Ferroelastic phase transition, domain pattern and metastability indiluted lead phosphate-type crystals, Solid State Ionics 101-103, 585(1997).

Page 147: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

136 Creating domain structures

[7] J. Chrosch, E. Salje, Temperature dependence of the domain wallwidth in LaAlO3, J. Appl. Phys. 85, 722 (1999).

[8] Z.W. Hu, P.A. Thomas, W.P. Risk, Studies of periodic ferroelectricdomains in KTiOP04 using high-resolution X-ray scattering anddiffraction imaging.

[9] O. Zaharko, A. Cervellino, M. Estermann, P. Schobinger-Papamantellos, Structure of the microdomain boundaries inRFe6Ge6 (R= Tb, Ho or Er) crystals from diffuse X-ray scattering,Phil. Mag. A 80, 27 (2000).

[10] B. Dkhil, J.M. Kiat, G. Calvarin, G. Baldinozzi, S. B. Vakhru-shev, E. Suard, Local and long range polar order inthe relaxor-ferroelectric compounds PbMg1/3Nb2/3O3 andPbMG0.3Nb0.6Ti0.1O3, Phys. Rev. B65, 024104 (2001).

[11] W. Dmowski, M.K. Akbas, T. Egami, P.K: Davies, Structure refine-ment of large domain relaxors in the Pb(Mg1/3O3-PbZrO3 system,J. Phys. Chem. Solids 63, 15 (2002).

[12] L. Houben, M. Luysberg, R. Carius, Microtwinning in microcrys-talline silicon and its effect on grain-size measuremnts, Phys. Rev.B67, 045312 (2003).

[13] R. Forst, H. Jagodzinski, H. Boysen, F. Frey, Diffuse scattering anddisorder in urea includsion compounds OC(NH2)2 + CnH2n+2,Acta Cryst. B43, 187 (1987).

[14] T.R. Welberry, S.C. Mayo, Diffuse X-Ray scattering and Monte-Carlo study of guest-host interaction in urea inclusion com-pounds, J. Appl. Cryst. 29, 353 (1996).

[15] Th. Weber, H. Boysen, F. Frey, R.B. Neder, Modulated structureof the composite crystal urea/n-heptadecane, Acta Cryst. B53, 544(1997).

[16] Th. Weber, H. Boysen, F. Frey, Longitudinal positional ordering ofn-alkane molekules in urea inclusion compounds, Acta Cryst. B56,132 (2000).

[17] R. Forst, H. Boysen, F. Frey, H. Jagodzinski, Phase transitions andordering in urea includsion compounds with n-paraffins, ActaCryst. B43, 187 (1987).

Page 148: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Exercises 137

Exercises(8.1) Simulate a primitive cubic structure with a single

atom at 0, 0, 0. Replace the atoms around 3, 4, 0 bya spherical domain with a radius of five unit cells.

(8.2) Simulate a primitive cubic structure with a singleatom at 0, 0, 0. Replace the atoms around 3, 4, 0 byan elliptical domain whose half-axes are 4, 8, and 10unit cells long. The first two half-axes shall be in theab-plane at 45◦angle to the a- and b-axes.

(8.3) Simulate a primitive cubic structure with a singleatom at 0, 0, 0. Replace the atoms by a row of do-mains spaced by 10 unit cells along the a-axis. Thedomains shall be elliptical, with half-axes parallelto the base vectors. The half-length along the b-axisshall increase from 2 to 20 unit cells, the other twohalf axes shall be constant at 4 unit cells.

Page 149: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 150: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Creating nanoparticles 99.1 Overview

In this chapter we will describe algorithms to simulate the structure ofnanoparticles. The literature on nanoparticles is growing rapidly andwe will not attempt to give an overview on all aspects of nanoparticles.Instead, this chapter will focus on a few examples. These are investi-gated in detail to show what techniques are required to simulate theirstructure and to compute the corresponding powder diffraction patternand pair distribution function (PDF) that was introduced earlier in Sec-tion 4.3.

Creating nanoparticles is actually a fairly simple task! Under the eas-iest condition, they can be considered very small but otherwise perfectlittle crystals. Thus the task is reduced to expanding the initial unitcell to a properly sized block of l x m x n unit cells. This will alreadyconstitute a block shaped nanoparticle. Most Transmission Electron Mi-croscope (TEM) observations of nanoparticles indicate that they have amore rounded shape. This is achieved by optionally cutting this smallcrystal by a suitable shape function like a sphere, an ellipsoid or a groupof hkl planes. Since the number of atoms will be small, a few hundredsto a few thousands, the powder diffraction pattern or the pair distribu-tion function of such a nanoparticle requires a fairly small amount ofcomputing time.

A quite different approach simulates a larger crystal, with or withoutdefects and introduces a shape function while calculating the powderdiffraction pattern or the PDF. Both the calculation of the powder pat-tern by use of the Debye equation or the calculation of the PDF areessentially based on a histogram of interatomic distances. Consider aspherical volume placed into a crystal structure. The histogram of in-teratomic distances for the infinite structure and for this finite sphericalvolume will differ only in the number of interatomic distances. For theinfinite crystal the average number of neighbors is proportional to r2.At short distances, the number of neighbors within the finite volume isessentially identical. At longer distances, the number of neighbors doesnot increase any longer and eventually drops to zero as the diameter ofthe spherical volume is reached. An appropriate shape function can bederived for a number of basic geometrical shapes [1, 2, 3]. By multi-plying the histogram of interatomic distances for the initial crystal bythis shape function, the histogram for a nanoparticle with this shape isachieved, which can be used to calculate the powder pattern or the PDF.

139

Page 151: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

140 Creating nanoparticles

The structure of other nanoparticles, like multiply twinned noble met-als, core–shell nanoparticles or carbon nanotubes differs much morefrom the corresponding bulk structure. The histograms of these nano-particles cannot be simulated by simple multiplication with a shapefunction. Here, an appropriate algorithm has to be developed to di-rectly simulate their structure.

Another level of complexity involves defects in the nanoparticle struc-ture. These are actually quite common. Typical defects to consider arestacking faults and surface relaxations. Since nanoparticle are by theirown nature very small objects, the number of atoms within an individ-ual simulated nanoparticle is very small. As a consequence, very fewdefects will be present within such a single nanoparticle. This nanopar-ticle will be only one of many possible configurations that all obey thesame building principle. As an example, take a nanoparticle of some 4nm in diameter. If considered as a layered structure, this nanoparticlewill consist of some 20 layers. If we assume a stacking fault probabilityof 10%, the nanoparticles will on average contain two stacking faults.Close to 2 000 different locations for the two stacking faults exist, andeven if all other structural parameters are identical, the powder patternand the PDF will all be slightly different, depending on the locations ofthese stacking faults. Additionally, only on average will the individualnanoparticle contain two stacking faults. Some particles may containnone, others several stacking faults. The actual physical sample, whosestructure and building principle we wish to understand, will be a mix-ture of basically all possible combinations. In the simulations of thedefect structure of regular crystals, the large crystal size allows us toaverage the many different local structures within one crystal. In thecase of small nanoparticles this averaging should be done by simulat-ing many slightly different nanoparticles, which form a representativesample of all possible structures and to average their correspondingpowder pattern or PDF.

20 40 60 80 100 120

0

1000

2000

Inte

nsity

Fig. 9.1 Powder diffraction pattern ofnanocrystalline ZnSe. The marker at neg-ative intensity values indicates the posi-tion of the Bragg reflections of crystallineZnSe. The moderate quality of a Rietveldfit (thin line) is obvious from the largedifference curve.

Similarly, as shown by several TEM studies, the size and shape ofnanoparticles in one sample are distributed over a range of diametersand individual shapes. Accordingly, one might have to consider thisdistribution as well. Quite a few nanoparticles have been investigatedby diffraction methods, and this number is growing rapidly.

9.2 Creating simple particles

In this first example we will create a nanoparticle of ZnSe. The actualparticles on which this study is based [4] were synthesized to yieldcomparatively monodisperse ZnSe nanoparticles stabilized by an or-ganic shell of trioctylphosphineoxide (TOPO) molecules. Figure 9.1shows the powder pattern of these ZnSe nanoparticles collected withcopper radiation on a laboratory source. The pattern is basically that ofa zincblende type structure with very broad peaks. The reflection po-sitions for crystalline ZnSe have been added as markers to indicate the

Page 152: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.2 Creating simple particles 141

good agreement. By fitting individual lines to the diffraction maximawe obtain a full width at half maximum (FWHM) of 3.4◦ for the re-flection at 27.25◦, which corresponds to the 111 reflection of bulk ZnSe.Using the Scherrer equation

D = 0.94λ/(β cosΘ) (9.1)

5 10 15 20r (Å)

25 30

–5

0

5

10

15

20

G(r

)

Fig. 9.2 Pair distribution function ofnanocrystalline ZnSe. The PDF showsmaxima up to some 26 Å, which corre-sponds to the diameter of the ZnSe core.

2 3 4 5

r (Å)

G(r

)

–5

0

5

10

15

20

Fig. 9.3 Pair distribution function ofnanocrystalline ZnSe and crystallineZnSe (broken line). The width of theshortest interatomic distance distribu-tion at 2.44 Å is almost identical for bothsamples.

one obtains a size estimate of about 26 Å in diameter for the ZnSe par-ticles. Here β is the FWHM in radians. The scattering power of Zn andSe is much higher that that of the atoms in TOPO. Additionally, we canexpect that the TOPO molecules will be placed randomly on the ZnSesurface and will be subject to conformational disorder. Thus the Braggpeaks will be dominated by the inorganic core and the size estimatewill give the diameter of the inorganic core.

The Rietveld refinement of the diffraction pattern shown in Fig. 9.1can be considered reasonably for such a small particle. There are, how-ever, several aspects of the diffraction pattern that are not describedwell. The peak shape of the 113 reflection at 2Θ = 52◦and that of all re-flections at higher diffraction angles are not reproduced well at all. It isa reasonable assumption that defects like stacking faults and/or strainmay have to be considered. Different models could be tested to deter-mine the type of defects present in these nanoparticles. Rather that test-ing a large number of possible defect structures, we will attempt to de-rive as much information as possible from the powder pattern and thePDF. Let us first have a look at the PDF of the ZnSe nanoparticles, Figs.9.2 and 9.3. The PDF was determined from high-energy X-ray diffrac-tion data collected at beamline BW5 at the synchrotron source HASY-LAB, Hamburg, Germany [4]. The PDF shows maxima up to r = 26 Å,which corresponds nicely to the size estimate, based on the Scherrerequation. Figure 9.3 shows the PDF of the nanocrystalline ZnSe (solidline) and the crystalline ZnSe (broken line) for short distances r. ThePDFs from both samples were obtained under identical conditions. Thepeak positions in both PDFs are almost alike, r = 2.437 Å for nanocrys-talline ZnSe and r = 2.449 Å for bulk ZnSe. Thus, we can concludethat a strain relaxation of interatomic distances at the nanoparticle sur-face plays a minimal role in ZnSe. A comparison of the intermediatedistances, Fig. 9.4, shows a seemingly peculiar behavior. The peaks at20 and 22 Å are of similar width for nanocrystalline and normal ZnSe.At 21 and 23 Å, however, the nanocrystalline peaks are much widerthan the corresponding peaks of crystalline ZnSe. Thus we find for thenanocrystals on the one hand very narrow interatomic distance distri-butions and on the other hand very broad distributions at almost iden-tical distances. This apparent contradiction helps to determine a defectmodel. If the nanocrystal is made up of a predominantly zincblendetype ZnSe structure with a few wurtzite type stacking faults, all inter-atomic distances within each layer remain well defined and thus cor-respond to the narrow PDF peaks. The additional shift parallel to thelayers destroys the perfect order of interatomic vectors from one layer

Page 153: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

142 Creating nanoparticles

to the next. As a consequence, these distances are distributed over awider interval.

With this analysis of the powder diffraction pattern and the PDF weare ready to start the simulation. The ZnSe nanoparticle will be smallellipsoidally shaped object. To allow stacking faults, it is easiest to de-scribe the cubic ZnSe structure in terms of the hexagonal metric. Thisallows us to stack wurtzite type layers to build any random structurebetween the perfect wurtzite and the perfect zincblende structure, asillustrated in Chapter 7. The hexagonal symmetry of an individuallayer, respectively the three-fold symmetry along the corresponding cu-bic [111] direction, suggests that the ellipsoid has rotational symmetryaround this axis. The essential steps of the simulation therefore are:

18 20 20 24 26

r (Å)

–1

–0.5

0

0.5

1

G(r

)

Fig. 9.4 Pair distribution function ofnanocrystalline ZnSe and crystallineZnSe (broken line, scaled to match theheight). The width of the maxima atdistances 18.2, 20.0 and 22.2 Å is almostthe same for both sample, while themaxima of the nanocrystalline sampleat 19, 21 and 23 Å are much wider thanthose of the crystalline sample at theseinteratomic distances.

File: nano/discus.znse.mac1 @variables.znse2 #3 # Read the parameters from DIFFEV/Trials4 fget 25 do i[3] = 1,parameters6 fget 2,r[200+i[3]]7 enddo8 #9 read

10 stru CELL/znse_wurtzite.cell11 lat[1] = r[201]12 lat[2] = r[201]13 lat[3] = r[202]14 z[1] = r[203]15 b[1] = r[204]16 b[2] = r[204]17 p_stack = r[205]18 p_ab = r[206]19 p_cc = r[207]20 save21 outfile STRU/znse_wurtzite.cell22 run23 exit24 @makelayers.znse znse_wurtzite25 #26 do indiv=1,nindiv27 @shape.ellipsoid znse_wurtzite28 @powder29 @output $1,indiv30 enddo

• creation of the zincblende/wurtzite-type layers;• stacking of these layers;• creating the nanoparticle shape;• calculation of the powder pattern or PDF.

The main macro in the margin contains these steps. This macro is laterused in Section 11.3 as part of a refinement process. Initially, in lines1 through 7, a few variable names are defined and the structural pa-rameters are read from a file called DIFFEV/Trials. These structural pa-rameters are the hexagonal lattice constants a and c, the z-position ofoxygen, an overall isotropic displacement parameter, the stacking faultparameter, and the radius of the particle in the ab-plane and along thec-axis. These seven parameters are sufficient to describe the powderdiffraction pattern. For the PDF calculation, additional parameters likethe instrumental PDF parameters and the number density are needed.Next the default asymmetric unit is read in lines 9 and 10 and thenmodified by the current parameters read from DIFFEV/Trials, lines 11–16. The new asymmetric unit is then stored under a temporary nameit STRU/znse_wurtzite.cell. The first two steps of the simulation, cre-ation of the layers and their stacking, are basically identical to the cor-responding steps described in Chapter 7. Refer to the macros describedthere for a detailed description. Here we will focus on a few specificdetails and parts that make the nanoparticle simulation as efficient aspossible.

In contrast to the examples in the stacking fault chapter, the shapeand finite size of the nanoparticle is an important part of the simula-tion. Even if we assume a simple shape, like a sphere, each layer in thenanoparticle is different and thus the steps undertaken earlier to speedup the Fourier transform cannot be used for nanoparticles. Instead, thefull atom list of the nanoparticle has to be generated. Thus we willstart out by creating wurtzite layers that are large enough to includethe final nanoparticle. In order to minimize the computational effort,the required size of the layer is calculated from the ab-plane radius ofthe final nanoparticle. For the ellipsoidal particle, the require numberof unit cells can be calculated as the integer part of 4.5*radius/a,where a is the lattice constant. The other steps of the macro makelay-ers.znse.mac are identical to the macro makelayers.mac used in Section

Page 154: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.2 Creating simple particles 143

7.7. Likewise, the number of layers required is calculated from the finalheight of the nanoparticle. Since there are two wurtzite layers per unitcell, the total number of layers in the final nanoparticle is 2*height/ lat[3], where lat[3] is the unit cell constant c. As a precautionagainst rounding effects, two extra layers are added at this stage. The File: nano/shape.ellipsoid.mac

1 read2 cell STRU/$1.cell3 @stack $1,p_stack4 @shift p_cc5 #6 @trans2cart7 @shear p_ab,p_cc8 boundary sphere,p_ab9 @shear p_cc,p_ab

10 #11 purge12 #13 save14 outf "STRU/$1.%4D.%4D.particle",kid,indiv15 omit ncell16 omit gene17 omit scat18 omit adp19 run20 exit21 #22 @plot.xbs single_particle.bs

actual creation of the stacked layers closely follows the examples in Sec-tion 7.7. This step is carried out within macro shape.ellipsoid.mac in thecommands in macro stack.mac, line 4.

Now the crystal consists of a stack of layers, each of size n x n unitcells in the ab-plane. In the next step we will shape this block into thefinal nanoparticle, illustrated by two different forms, a combination ofthe 110 faces with the 001 faces, and an ellipsoid. Both these formstake the hexagonal symmetry into account and allow for different di-ameters in the hexagonal ab plane and along the [001] axis. Since the

File: nano/trans2cart.mac1 r[1] = 1.00/blen(2,1,0)2 r[2] = 1.00/lat[2]3 r[3] = 1.00/lat[3]4 trans5 anew 2.*r[1], 1.0*r[1], 0.06 bnew 0.0 , r[2], 0.07 cnew 0.0 , 0.0 , r[3]8 onew 0.0, 0.0, 0.09 sel all

10 incl all11 run12 exit

stacking process in DISCUS creates layers that start at z = 0, the macroshift.mac (line 4) moves all atoms down by half the height of the stack.At this point the metric is transformed into cartesian space by the macrotrans2cart.mac. The transformation is defined by setting the cartesianaxes parallel to [2, 1, 0], [0, 1, 0], and [0, 0, 1]. Usually, we prefer to op-erate in the metric of the unit cell, but here this transformation speedsup the final calculation of the powder diffraction pattern by about anorder of magnitude! Next comes the step to shape the particle. DISCUS

File: nano/shear.mac1 shear2 matrix 1,0,0, 0,1,0, 0,0,$1/$23 origin 0,0,0, crystal4 sel all5 incl all6 show7 run8 exit

provides a shape tool with the boundary command. This command al-lows one to remove all atoms outside a sphere or outside a lattice planehkl. In order to create an ellipsoid, three steps are used:

• Shear the crystal by contracting it along the c-axis with ratio p_ab/p_cc, where p_ab and p_cc are the radii of the ellipsoid in theab-plane and along the c-axis.

• All atoms outside a sphere of the required radius are removed.• The shear process is inverted by shearing with ratio p_cc/p_ab.

Here the shear operation is along just one of the cartesian base vectors,thus a uniaxial ellipsoid is created. By rotating the crystal prior to theshear operation and/or applying a shear along the other axes as well, ageneral ellipsoid in arbitrary orientation could be generated.

As an alternative shape, the ZnSe nanoparticles were refined in theshape of a hexagonal prism terminated by the 110 and the 001 faces.The required set of commands is a series of commands shown in themargin. These would replace the shear and the boundary sphere lines in

boundary hkl, 1, 1, 0, p_abboundary hkl,-1, 2, 0, p_abboundary hkl,-2, 1, 0, p_abboundary hkl,-1,-1, 0, p_abboundary hkl, 1,-2, 0, p_abboundary hkl, 2,-1, 0, p_ab

#boundary hkl, 0, 0, 1, p_ccboundary hkl, 0, 0,-1, p_cc

the macro shape.ellipsoid.mac. These commands would, of course, haveto be executed prior to the transformation into cartesian space. The ac-tual set of planes will be adjusted to the expected nanoparticle shape.After purging all voids that have been created by the boundary com-mands (line 11 in shape.ellipsoid.mac), the nanoparticle structure can besaved for later use and plotted for display. Figures 9.5 and 9.6 show thefinal nanoparticle from the side and approximately along the c-axis. Inthe side view a growth fault can be seen between the third and fourthlayer from the bottom. This particle was generated with a stacking fault

Page 155: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

144 Creating nanoparticles

parameter of 0.70, i.e. a 30% probability for stacking faults that deviatefrom the perfect cubic growth sequence. The particle contains 11 lay-ers. The sequence of the first two layers just defines the handedness

Fig. 9.5 Structure of a simulated ZnSenanoparticle. Between the third andfourth layer from the bottom, a growthfault is present. The diameters in the abplane and along the c-axis are 2.6 and 3.8nm.

Fig. 9.6 Structure of a simulated ZnSenanoparticle viewed approximatelyalong the [001] direction. Due to thesmall radius, the ellipsoidal particle is infact terminated by a set of {100} planes.

of the zincblende structure. Starting with the third layer true growthfaults may occur and thus we would expect an average value of aboutthree changes in the growth sequence. This particular particle happensto have just one growth fault after the third layer and is just one ofthe many possible configurations. Since the nanoparticle is very smallwith diameters of 2.6 and 3.8 nm, the ellipsoidal shape function effec-tively produces small planes on the surface, as can be seen quite wellin Fig. 9.6. The overall nanoparticle shape corresponds well with thatobserved in TEM images [4].

The main macro discus.znse.mac continues with the calculation of thepowder pattern and finally saves the calculated pattern to a file. Toensure a fast calculation, the powder diffraction is calculated along anevenly spaced Q-grid with very fine Q steps. Later on, to compare withthe experimental data this Q-scale is converted to an evenly spaced 2Θscale. The final powder pattern (Fig. 9.7 left) is calculated for wave-length CuKα1 and Bragg-Brentano geometry with a secondary C(002)monochromator, i.e. a monochromator angle of Θ = 26.58◦. Anoma-lous dispersion is ignored, while the effects of thermal vibrations aretaken into account analytically. The powder pattern is calculated byusing the Debye equation 4.9; see Chapter 4 for details.

|I(h)| =∑

i

f2i +

∑i

∑j,j �=i

fifjsin(2πhrij)

2πhrij(9.2)

Since the summation involves the computation of interatomic distances,it is much faster if the crystal is transformed into cartesian space priorto the calculation of the powder pattern. As a result of the small particlesize and the fairly high growth fault probability, each of the simulatednanoparticles is actually a bit different. Accordingly, the diffraction pat-tern will be slightly different as well, as illustrated in Fig. 9.7 in theright panel. This figure shows the calculated powder pattern for twoZnSe nanoparticles that were simulated with identical parameters forlattice constants, atomic positions, atomic displacement parameter andparticle size. The stacking fault probability was identical for both parti-cles as well. The two particles contain, however, five, respectively four,growth faults at different positions within the particle.

This illustrates the need to average the powder diffraction patternof several nanoparticles, if any part of the structure simulation processinvolves random choices. It is impossible to generalize how many pat-tern will have to be averaged, since this depends too much on the actualproblem at hand. Refer to Chapter 11 for a more detailed discussion.For the nanoparticles in this section, the number of patterns that haveto be averaged depends, for example, on the stacking fault parameter.If this parameter is close to zero or one, almost perfect crystals willbe simulated each time. Few different configurations exist and theirdiffraction patterns are all very similar. As the stacking fault parameter

Page 156: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.3 PDF of nanoparticles 145

100806040 10080604020 20

0

1000

2000

Inte

nsity

2Θ 2Θ

Fig. 9.7 Left: powder diffraction pattern of a simulated ZnSe nanoparticle. The differencecurve in the lower part shows the good agreement with the experimental data. Right:powder diffraction pattern of two simulated ZnSe nanoparticle. The difference betweenthe two powder patterns is caused by the random placement of the growth faults. Thepatterns are offset for clarity.

approaches 0.5, i.e. complete random stacking of individual layers, thenumber of faults within each particle is much higher, and the numberof possible configurations increases dramatically. For the simulation ofnanoparticles with stacking faults as in this section, you need to aver-age about at least some 20 powder patterns to get a significant average.

9.3 PDF of nanoparticles

In this section, we will illustrate aspects required to calculate the PDFof nanoparticles. The overall aspects of PDF calculations are describedin [5] and an introduction is found in Chapter 4 of this book. The main We are using the PDF definition G(r) =

4πr(ρ(r) − ρ0) in this book. This defi-nition is most convenient for crystallinematerials [6].

difference for the calculation of the PDF of a nanoparticle is the finitesize of the particle. For a crystal, suitable periodic boundary condi-tions can be applied to calculate the PDF out to long interatomic dis-tances. For a simulated nanoparticle, however, no interatomic distancesexist beyond the diameter of the particle. Thus, at distances beyondthe nanoparticle diameter, the calculated G(r) will be equal to the line−4πρ0r, the background-like line that corresponds to the average num-ber density ρ0. For a finite nanoparticle, the average number of in-teratomic distances will initially increase with increasing interatomicdistance. As this distance approaches the diameter of the particle, thenumber of atom pairs will decrease again and reach zero as the diame-ter of the particle is reached. Thus, in terms of G(r), the average num-ber of interatomic distances for a finite nanoparticle does not increaselinearly with r, but forms a bell shaped function that is zero beyond thenanoparticle diameter. The exact form of this function depends on thenanoparticle form. Analytical forms have been derived for a number

Page 157: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

146 Creating nanoparticles

of basic shapes, like a sphere [2, 1], platelets, belts, rods and tubes [1],and for special cases like spherical core–shell particles [3]. To use theseanalytical functions, the PDF of an infinite object is multiplied by thisfactor. Accordingly, the simulation creates a large crystal, whose PDF iscalculated using appropriate boundary conditions. The envelope func-tion for a sphere is:

5

–20

0

20

40

60

–20

0

20

40

60

10 15 20 25r (Å)

30

G(r

)G

(r)

Fig. 9.8 Calculated PDF of ZnSe in thewurtzite modification. In the upper im-age the PDF has been calculated for a pe-riodic crystal, free of defects. In the lowerimage, the same PDF has been multipliedby the envelope function for a sphere.

fe(r, d) =

[1 − 3

2

r

d+

1

2

( r

d

)3]

Θ(d − r), (9.3)

where d is the diameter of the nanoparticle, and Θ(d− r) is a step func-tion that is one for r < d and zero otherwise. This envelope function ismultiplied by Gc(r), the PDF for an infinite crystal:

G(r, d) = 4πr [ρ(r) − ρ0] = fe(r, d)Gc(r) (9.4)

Figure 9.8 shows the effect of this envelope function for a sphericalZnSe nanoparticle. The calculation is based on a perfect ZnSe crystalin the wurtzite modification and used the parameters listed in Table9.1. Since the isotropic atomic displacement parameter B and qσ areboth equal to zero, the PDF contains sharp maxima, as expected fora perfect crystal. The maxima in the G(r, d) curve, i.e. the modifiedPDF, are as sharp as those of the infinite crystal, but their height de-creases with r. This reflects the lower number of longer interatomicvectors within a finite nanoparticle. The gradual increase of the peakwidth with interatomic distance r is the same in both figures and iscaused by the value for the instrumental resolution parameter qα. Inthose cases, where the finite character of the nanoparticle is essential,like carbon nanotubes or core/shell particles, one cannot simulate thePDF by multiplying the PDF of a corresponding infinite object. If a fi-nite nanoparticle is simulated and the PDF is calculated directly fromthe list of atom coordinates, the need for the envelope function becomesobsolete. Figure 9.9 illustrates the result for the PDF calculation of such

5 10 15 20 25 30

–40

–30

–20

–10

0

10

20

G(r

)

r (Å)

Fig. 9.9 Calculated PDF based on thesimulation of a single spherical ZnSenanoparticle in the wurtzite modifica-tion. The simulation used the same pa-rameters as for Fig. 9.8.

a finite object. A single finite spherical ZnSe nanoparticle of 30 Å diam-eter and otherwise identical parameters as in Table 9.1 and Fig. 9.8 wasused to calculate the PDF. It is immediately obvious that this PDF dif-fers dramatically from that shown in the bottom panel of Fig. 9.8. Here,

Table 9.1 Parameters used to calculate PDF shown in Fig. 9.8.

Parameter Value Parameter Value

a 3.986 Å c 6.490 Åz(O) 0.37726 B 0 Å2

d 30 Å δ 0.000011γ 0.0147 qσ 0.qα 0.00357 ρ0 0.1056

Page 158: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.3 PDF of nanoparticles 147

the calculated PDF roughly follows the line −4πρ0r, instead of the line

5 10 15 20 25 30r (Å)

–40

–30

–20

–10

0

10

20

G(r

)

Fig. 9.10 Calculated PDF based on theaverage of 20 finite sized ZnSe nanopar-ticles with stacking faults. Peaks between7 and 26Å are broader due to the stackingfault disorder.

–40

–30

–20

–10

0

G(r

)5 10 15 20 25 30

r (Å)

Fig. 9.11 Difference between the calcu-lated PDF shown in Fig. 9.10 and the ex-perimental PDF from Fig. 9.2.

Fig. 9.12 Schematic illustration of dif-ferent interatomic vector types in ananoparticle sample. Only those vectors(solid arrow head) between atoms withinthe single simulated nanoparticle, shownin gray, have been taken into account forthe calculation for Fig. 9.10.

G(r) = 0. At distances beyond the particle diameter, the calculated PDFis identical to this line. Note that the height of the individual PDF max-ima above this line decreases, as r approaches the nanoparticle diam-eter. This decrease is the direct consequence of the finite nanoparticlesize, since the number of interatomic vectors decreases as the nanopar-ticle diameter is reached. The fact that this PDF becomes more negativewith increasing r, instead of oscillating around G(r) = 0, shows, how-ever, the need for a different correction. Calculating the PDF from theatom coordinates of the finite object means that the height of the PDFmaxima is automatically correct. The subtraction of the simple straightline −4πρ0r, however, is incorrect, since this simulation corresponds toa single nanoparticle suspended in vacuum, yet with overall numberdensity ρ0. Under such conditions, no interatomic vectors would existother than those within the single finite nanoparticle. Clearly, this doesnot reflect the experimental situation.

The experimental PDF in Fig. 9.2 does indeed oscillate around G(r) =0, and Fig. 9.11 shows the difference between the calculated PDF of Fig.9.10 and the experimental PDF. This difference is an almost smooth line.For short distances less than some 3 Å, the difference is almost zero. Itthen increases slowly at first, and then at a faster rate, until it becomesidentical with +4πρ0r for distances larger than that of the simulatednanoparticle. The calculated PDF is based only on those interatomicdistances within the simulated nanoparticle, all other distances that arepresent in the physical sample are neglected. Several interatomic dis-tance distributions are responsible for this difference between the ex-perimental and calculated PDF as listed here and illustrated schemati-cally in Fig. 9.12:

• Distances between atoms in the ZnSe core of the nanoparticle andthe atoms in the organic shell.

• Distances between atoms in different nanoparticles, both withinthe inorganic core and the organic shell.

• Distances between atoms in molecules that are not an immediatepart of the nanoparticle and any other atom within the sample.These will occur if the sample contains any additional molecules,such as excess ligand molecules.

One can expect that the organic molecules in the shell of ligands are notwell ordered and are subject to conformational flexibility. Additionally,the orientation and relative distance of neighboring nanoparticles canbe expected to be at random. Thus all the distances in the list will be dis-tributed essentially at random and their contribution to the PDF will bea smooth background-like function. That this assumption is true is ac-tually evident from the difference curve in Fig. 9.11, which is a smoothfunction. To calculate the total PDF of a nanoparticle, such a smoothfunction is added to the PDF calculated from the structural model. Ineffect, the smooth background-like function is added to the differencecurve in Fig. 9.11 as a third-order polynomial.

Page 159: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

148 Creating nanoparticles

Note that the schematic drawing in Fig. 9.12 contains free moleculesthat are not immediately attached to the nanoparticles. This is a sit-uation that can be encountered, if the synthesis route relies on excessorganic molecules compared to the actual number of molecules thatform the nanoparticle shell. If these molecules and those of the organicshell are not included in the structural model, the normalization of thePDF peaks will be based on the composition of the inorganic core only.In this case, the height of the PDF peaks calculated from the inorganiccore will be too large, and they should be scaled down. By adding

5

–5

0

5

10

15

20

G(r

)

10 15 20 25 30

r (Å)

Fig. 9.13 Final PDF for spherical nanopar-ticles of ZnSe with stacking faults.

50 10 15 20 25 30

r (Å)

spherepolynomial

–8

–6

–4

–2

0

G(r

)

–4πr0r

Fig. 9.14 Comparison between the ef-fect of the envelope function for spheri-cal particles and an empirical third orderbackground polynomial.

the smooth background polynomial, the PDF in Fig. 9.13 results. ThisPDF very well matches the experimental PDF from Fig. 9.2. The fit bya polynomial of order N is a purely empirical adjustment of the calcu-lated PDF to match the experimental one. Analytical solutions to thecontributions by the different groups of interatomic vectors were dis-cussed in [3] for a number of nanoparticle shapes. Even these analyt-ical solutions are approximations, since the exact nanoparticle shape,the exact composition, especially on the local scale are not known.

Figure 9.14 shows a comparison between the effect of the analyti-cal envelope function for spherical particles [2] and the empirical back-ground fit used in [4]. The two lines have been calculated as:

sphere: −4πρorfe(r, d) (9.5)polynomial: −4πρor + p1r + p2r

2 + p3r3 (9.6)

where the average number density is ρ0 = 0.10 Å−3 and the the em-pirical parameters for the third order background polynomial are pi:0.00434, 0.0810, and −0.00129. The third-order polynomial does not in-clude a zero-order term, since such a term would create an unphysicaloffset of G(r) at r = 0. The overall shape of both curves is very sim-ilar. The main differences are the different intersection with the lineG(r) = 0, and the slightly more negative value of the calculated en-velope function fe. The refinement of the ZnSe particles resulted in aslightly elongated elliptical particle with diameters of Dab = 28 Å inthe ab-plane and Dc = 31.4 Å, i.e. an aspect ratio of Sc/Dab = 1.1.For the envelope function, the average diameter of D = 29.0 Å wasused, while the empirical curve becomes equal to G(r) = 0 at r = 27Å. This apparent smaller diameter as expressed by the zero point of theempirical background compared to the actual simulated diameters andcompared to the zero point of the envelope function is caused by thedefect structure of the ZnSe nanoparticles. The refinements resulted ina stacking fault probability of 30%. This very high defect concentrationconsiderably reduces the structural coherence of the nanoparticle, espe-cially for longer interatomic vectors, effectively rendering any distancethat is comparable to the diameter of the nanoparticle equally likely. Asa consequence, no observed and no calculated PDF maxima exist, evenat distances smaller than the actual particle diameter. Since the stackingfaults cause the PDF maxima to be wider and of smaller height than fora perfect nanoparticle, the empirical polynomial shifts up to compen-sate this change.

Page 160: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.3 PDF of nanoparticles 149

The macro pdf.mac contains the necessary commands to calculate thePDF for the ZnSe nanoparticles. This macro is executed in addition orinstead of the macro powder.mac that was used in line 28 of the macrodiscus.znse.mac in Section 9.2. Most of the parameters are identical to File: nano/pdf.mac

1 pdf2 #3 ides all4 jdes all5 isel all6 jsel all7 #8 set bound, crystal,3D9 set dens, p_density

10 set delta, p_delta11 set gamma, p_gamma12 set qalp, p_qalp13 set qsig, p_qsig14 set qmax, p_qmax15 set rad, xray16 set range, 32.08,0.0217 set srat, p_srat,3.518 set therm, gauss19 #20 set weig, p_scale21 set finite,poly22 set poly ,p_b1,p_b2,p_b323 #24 show25 calc26 save pdf,"INDI/indi.%4D.%4D" ,$1, $227 exit

those that would be used to calculate the PDF for a regular crystal andhere we will focus our attention on the differences. Refer to Section 4.3for a more detailed explanation of the parameters. In line 13 the bound-ary condition is set to include only atoms from the simulated crystalinstead of applying periodic boundary conditions. The latter would bedone for the calculation of the PDF for a disordered crystal. Next, weset the average number density to the value of the variable p_density.For a crystal and periodic boundary conditions, DISCUS can calculatethe average number density for you and will do so for you, if the valueof the variable p_density is set to zero. The simulated nanoparti-cle is of finite and possibly irregular shape, and may be one of manyparticles with different shapes and/or sizes whose PDF you will be av-eraged. The number density within this nanoparticle might well bedifferent from that of the overall sample, since the organic shell mightbe neglected, etc. Therefore one has to provide a value, which could ofcourse be subject to a refinement (see Section 11.3).

The next difference to the PDF calculation of a crystal is found in lines20–22 with the definitions of a PDF weight and the finite size treatment.As illustrated in Fig. 9.12, the structural model includes the inorganiccore only, and contributions by all other atoms are accounted for bya smooth background-like function. Additionally, keep in mind thatthe average composition of the nanoparticle core will be different fromthe chemical composition of the whole sample. Since the normaliza-tion of the experimental and calculated PDF relies on this composition,the height of the PDF peak may differ, if the simulation is based onan inorganic nanoparticle core only. The parameter of the set weighcommand allows an adjustment. In line 21 we define how to treat thefinite size of the nanoparticle. If the calculation is based on the simula-tion of the actual nanoparticle, the finite size treatment should be set topoly; the parameters for the background like polynomial are providedin line 22. The program provides polynomials up to fifth order to allowthe treatment of more irregularly shaped nanoparticles. To determinestarting parameters for the polynomial function, you can fit the param-eters pi from equation 9.6 to a line calculated according to the equation9.5, where d is the estimated particle diameter.

By changing the parameters to the command set finite (line 21),one can choose to multiply the PDF by an envelope function. An enve-lope of a spherical particle of diameter d would be selected using setfinite, sphere, d. Alternatively these finite size corrections canbe disabled completely.

Page 161: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

150 Creating nanoparticles

9.4 Creating core–shell particles

As a second example we will simulate a CdSe/ZnS core–shell nanopar-ticle [4]. This particle consists of a CdSe core in wurtzite structure witha ZnS shell in zincblende structure. A number of possible structureshave been discussed in the literature for these type of particles:

5 10 15 20 25r (Å)

–3

0

3

6

G(r

)

G(r

)

1 2 3 4 5

–3

0

3

6

Fig. 9.15 Experimental PDF of CdSe/ZnScore–shell nanoparticles. The positionsof the first maxima at 2.338 Å and 2.611 Åcorrespond very well to the interatomicdistances of Zn-S and Cd-Se in the re-spective crystalline compounds.

CdSe

ZnS

Fig. 9.16 Schematic structure of theCdSe/ZnS core–shell particles. The largecentral core is CdSe and its (001) spac-ing is indicated by the thick lines. Thesmaller lighter hemispheres represent theZnS shell particles. Their (001) spacing,indicated by thin lines, is smaller thanthat of the CdSe core. The ratio hasbeen exaggerated for clarity. The centerof each ZnS sphere is locally in epitaxialconditions as indicated by the matching(001) planes.

• perfectly epitaxial overgrowth of ZnS on CdSe;• small ZnS particles on the surface of CdSe;• independent crystallization of CdSe and ZnS nanoparticles.

Since the lattice constants of CdSe and ZnS differ by about 10%, an epi-taxial overgrowth would cause a large mutual strain in the core andthe shell. The experimental PDF (Fig. 9.15) of the particles does notshow a significant widening of the first neighbor distance neither forCd-Se nor for Zn-S. A TEM study by Yu et al. [7] showed irregularlyshaped particles. The Electron Energy Loss Spectroscopy (EELS) datashowed that sulfur is unevenly distributed around the CdSe core. Thestructural model we will develop here as an example is therefore basedon an elliptically shaped CdSe core that is covered by small ZnS parti-cles, Fig. 9.16. As detailed in [4], both the core and the shell are fairlydisordered. The irregular particle morphology is created by hemispher-ical ZnS particles with random diameters. A log-normal distribution isused to define the individual diameters. The ZnS particles will be dis-tributed randomly onto the surface of the elliptical core. Despite thelarge lattice mismatch it can be expected that each of the ZnS particlesis locally in an epitaxial position. This is achieved by shifting the ran-domly created central position of the ZnS to the closest Cd positions.By placing the ZnS particles onto a position that corresponds to a Cdatom at the surface of the nanoparticle, the condition for local epitaxyis maintained, since, as an approximation, the orientation of the CdSeand the ZnS base vectors is strictly parallel. Since ZnS and CdSe havedifferent lattice constants, only the central atoms of the ZnS core are inthe exact epitaxial conditions. Atoms within a given ZnS particle thatare above or below this position are at a slightly different height. InFig. 9.16 this is schematically shown by the (001) planes for the CdSecore and the ZnS shell particles. The same relationship holds, of course,in the ab-plane. In this plane as well, only the central atom of the ZnSshell particle is in strict epitaxial position with respect to the CdSe core.Additionally, the figure shows that different ZnS shell particles are notstructurally coherent with respect to each other as illustrated by thetwo adjacent particles on the right-hand side. Despite this structuralincoherence, i.e. a shift of the two lattices with respect to each other, thecalculation of the diffraction pattern assumes strict coherent diffraction.The calculation in effect assumes that the waves radiated by all individ-ual atoms interfere and that we can add the complex amplitude insteadof the intensities. The simulation for such a particle involves the fol-lowing steps:

Page 162: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.4 Creating core–shell particles 151

File: nano/discus.cdse.mac1 @variables.cdse2 #3 # Read the parameters: DIFFEV/Trials4 #5 fget 26 do i[3] = 1,parameters7 fget 2,r[200+i[3]]8 enddo9 stack_core = r[205]

10 stack_shell = r[213]11 #12 ab_core = r[206]13 cc_core = r[207]14 ab_shell = r[214]15 si_shell = r[215]16 #17 num_shell = r[208]18 #19 p_srat = r[220]20 p_density = r[221]21 p_scale = r[222]22 p_delta = r[223]23 p_gamma = r[224]24 p_qalp = r[225]25 p_qsig = r[226]26 #27 p_diameter = 100.00028 p_shape = 1000.00029 #30 read31 stru CELL/cdse_wurtzite.cell32 lat[1] = r[201]33 lat[2] = r[201]34 lat[3] = r[202]35 z[1] = r[203]36 b[1] = r[204]37 b[2] = r[204]38 save39 outfile "STRU/cdse_wurtzite.%4D.cell",kid40 run41 exit42 @makelayers.cdse cdse_wurtzite,ab_core,lat[1]43 #44 read45 stru CELL/zns_wurtzite.cell46 lat[1] = r[209]47 lat[2] = r[209]48 lat[3] = r[210]49 z[1] = r[211]50 b[1] = r[212]51 b[2] = r[212]52 save53 outfile "STRU/zns_wurtzite.%4D.cell",kid54 run55 exit56 @makelayers.cdse zns_wurtzite, 2.*ab_shell,lat[1]57 #58 do indiv=indiv_start,nindiv59 #60 @shape.core cdse_wurtzite61 do i[12]=1,num_shell62 @para.sub63 @shape.sub zns_wurtzite64 enddo65 @shape.shell cdse_wurtzite,zns_wurtzite66 @insert.sub67 @insert.core68 @powder kid,indiv69 @trans.for.pdf70 @pdf kid,indiv71 chem72 elem73 exit74 r[12] = res[2]*n[1]75 r[13] = res[3]*n[1]76 r[14] = res[4]*n[1]77 r[15] = res[5]*n[1]78 r[16] = (res[2]+res[3])/(res[4]+res[5])79 fopen 1,"INDI/content.%4D.%4D",kid,indiv80 fformat 1,i681 fformat 2,i682 fformat 3,i683 fformat 4,i684 fformat 5,f8.485 fput 1,r[12],r[13],r[14],r[15],r[16]86 fclose 187 enddo

• Create independent wurtzite type layers for CdSe and ZnS.• Create an elliptically shaped core.• Create several small ZnS particles whose diameter is distributed

with a log-normal distribution.• Locate random positions on the surface of the core and place the

ZnS particles with locally epitaxial conditions.• Place the core into the assembly of ZnS particles.• Calculate the PDF and/or the powder pattern.

The main macro for the simulation begins very similarly comparedto the main macro for the simulation of the ZnSe particles. Again,this is part of a refinement process. Initially, the parameters are readfrom a file called DIFFEV/Trials and copied into variables with morereadable names (lines 1–28). Then (lines 30–56) the default unit cellscdse_wurtzite.cell and zns_wurtzite.cell are modified according to the ac-tual parameter values at this step of the refinement and are stored forlater use. At the same time, layers are created with the instructions inthe makelayers.cdse.mac macro. This macro is identical to the one usedin the previous section.

Again, as for ZnSe, we run a loop (lines 58–87) to create several nano-particles that are all simulated with identical parameter values. Due tothe random stacking, they each differ in the sequence of the layer types.Since the size, number, and location of the ZnS shell particles are alsosubject to random generation, the individual particles will also differ inthis respect. The actual construction of the complex nanoparticle withinthis loop is of course different compared to the simple ZnSe particles.First, the core is built by shape.core.mac (line 60) with an algorithm thatis basically identical to the building of the ZnSe nanoparticles. Next,the individual ZnS particles are created in the loop in lines 61 through64. An essential step is to create the positions on the surface of the CdSecore onto which the individual ZnS particles are placed, shape.shell.macline 65. Here the domain concept of Chapter 8 is used to create a listof positions which are then decorated by the individual ZnS particlesby the macro insert.sub.mac, line 66. At this point the nanoparticle con-sists of the ZnS particles located around a hollow core and this coreis filled within macro insert.core.mac, line 67, by the core structure thathad been created beforehand in line 60. Now the particle simulation isfinished and the powder pattern and the PDF can be calculated, lines68 through 70. The remainder of the lines serve to check the chemicalcomposition of the nanoparticle, lines 71–73, and to report the (Cd+Se)to (Zn+S) ratio into a file, lines 74–86. This report serves to compare thenanoparticle composition to that determined by chemical analysis [4].

Next the individual steps that are different from the correspondingparts of the ZnSe simulation in the previous section will be discussed.Macro shape.core.mac is identical to the macro shape.mac used in Section9.2. Refer to this section for details. Macro para.sub.mac is a very shortmacro that defines the radius of the individual particle. A log-normal

Page 163: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

152 Creating nanoparticles

distribution with median ab_shell and sigma si_shell is used toset the radius. To prevent overly huge shell particles, the value is lim-ited to the smaller of the two values: current diameter and core ra-dius in the ab-plane, ab_plane. The modeling of the individual shellFile: nano/para.sub.mac

1 # Create the radius for an2 # individual ZnS sphere3 #4 radius_sub = logn(ab_shell,si_shell)5 radius_sub = min(radius_sub,ab_core)

particles in macro shape.sub.mac follows the familiar steps to create ananoparticle with random stacking faults. One point needs to be em-phasized though. After the stack has been shifted down to be symmet-rical around the origin, a fine tuning is necessary. The Zn atom that isclosest to the origin is located, line 7, and the center.mac macro shiftsthe shell particle such that this Zn atom is exactly at the origin. This isnecessary to ensure the local epitaxial conditions needed later on.

File: nano/shape.sub.mac

1 read2 cell "STRU/$1.%4D.cell",kid3 @stapel $1,radius_sub, stack_shell4 @shift radius_sub5 find env,Zn, 0.0,0.0,0.0, 0.0, 0.9*lat[1]6 if(env[1].gt.0) then7 @center x[env[1]],y[env[1]],z[env[1]]8 endif9 #

10 @trans2cart11 #12 boundary sphere,radius_sub13 #14 purge15 save16 outf "STRU/$1.%4D.%4D.%4D.sub",kid,indiv,i[12]17 omit ncell18 omit gene19 omit scat20 omit adp21 run22 exit23 #24 @plot.xbs.shell single_sub,i[12]

The next step is an essential step in the simulation of this core–shellparticle. Macro shape.shell.mac generates the positions for the individualshell particles. The aim of this step is to create positions at randomlychosen Cd positions on the surface of the elliptical core. These positionswill then serve as a center for the hemispherical ZnS shell particles,which are thereby in a locally epitaxial position with respect to the CdSecore.

File: nano/shape.shell.mac

1 read2 stru "STRU/$1.%4D.%4D.core",kid,indiv3 #4 variable integer,ll5 #6 sys "cp CELL/header DOMAIN/domain.%4D.%4D.list",kid,indiv7 fopen 1,"DOMAIN/domain.%4D.%4D.list",kid,indiv,append8 #9 i[13] = 0

10 do while(i[13].lt.num_shell)11 r[31] = 2*ran(0) - 1.012 r[32] = 2*ran(0) - 1.0

Page 164: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.4 Creating core–shell particles 153

13 r[33] = 2*ran(0) - 1.014 r[30] = blen(r[31],r[32],r[33])15 r[31] = r[31]/r[30]*ab_core16 r[32] = r[32]/r[30]*ab_core17 r[33] = r[33]/r[30]*cc_core18 find env, cd, r[31],r[32],r[33],0, 3.819 do i[0]=0,env[0]20 i[100+i[0]] = env[i[0]]21 enddo22 do i[0]=1,i[100]23 ll=i[0]+10024 find env,se,x[ll],y[ll],z[ll],0,2.925 if(env[0].lt.4) then26 i[13] = i[13] + 127 fput 1,"D%2D %10.6f %10.6f %10.6f 1.0",i[13],x[ll],y[ll],z[ll]28 break 229 endif30 enddo31 enddo32 fclose 1

To achieve this goal, the macro starts by reading the CdSe core, whichhad been created earlier on (lines 1–2). Next, a template file CELL/headeris copied to a working copy named DOMAIN/domain.A.B.list. Herethe place holders A and B are used to number the simulated parti-cles. The file is opened in append mode so that we can add new lines.This header is a straightforward DISCUS structure file header for spacegroup P1 and cartesian metric. The pseudo-atom positions in this filewill be the locations of the shell particle centers. Again we make use ofthe domain concept described in Chapter 8. The following loop, lines10 through 31 is executed until the required number of shell particleshas been created. A vector, r[31],r[32],r[33], whose individualcoordinates are randomly distributed in the interval [−1, 1], is first nor-malized to unit length by dividing it by the length of this vector andthen sheared to account for the different radii of the elliptical core, lines11 through 17. Admittedly, this is not an accurate algorithm to createvectors randomly distributed on the surface of an ellipsoid in hexago-nal space. It is, however, much faster and a sufficient approximation,especially, since we now search for a Cd atom close to this random po-sition, line 18. The index of all Cd atoms within a radius 3.8 Å aroundthe random position are stored in variables i[101], i[102]. . . . Inmost cases there should be only one Cd atom in this sphere. Within thefollowing loop, lines 22–30, each of these Cd atoms is inspected to findthe first Cd atom that is located on the surface of the core. To distin-guish surface atoms from inner atoms, we find the number of Se atomswithin a sphere of 2.9 Å radius around each of these Cd atoms, line24. If this number of Se neighbors is less than 4, line 24, its location iswritten to the domain file (line 26) in the format:

D01 0.333333 0.666666 0.000000 1.0

which corresponds to the format for atoms in a standard DISCUS struc-ture file. Note that the names of the pseudo atoms are D01, D02, etc., i.e.they are simply numbered. When replacing these pseudo atoms by theactual shell particle, we will refer to this number to match the shell par-ticle created by macro shape.sub.mac. To ensure that we create only one

Page 165: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

154 Creating nanoparticles

pseudo atom close to a given random vector r[31],r[32],r[33],the break 2 command will force termination of the innermost twoif/do constructions, here the if statement in line 5 and the do state-ment in line 22. No provisions are, however, undertaken to preventtwo different random positions from being too close to each other! Thisactually allows for two or more shell particles to overlap to some de-gree, as shown schematically in Fig. 9.16. The model presented hereassumes that the shell particles nucleate independently on the core sur-face. Thus, one of these shell particles may well grow (partially) on topof another.Note that lines 11–12 are a single line in

the actual macro, broken here to fit thepage. File: nano/insert.sub.mac

1 read2 free3 #4 domain5 rese6 exit7 #8 do i[0] = 1,num_shell9 domain

10 assign charac,"D%2D",i[0],fuzzy11 assign conten,"D%2D",i[0],12 .. "STRU/zns_wurtzite.%4D.%4D.%4D.sub",kid,indiv,i[0]13 assign fuzzy ,"D%2D",i[0],2.014 assign orient,"D%2D",i[0],1, 1.0,0.0,0.0, 0.015 assign orient,"D%2D",i[0],2, 0.0,1.0,0.0, 0.016 assign orient,"D%2D",i[0],3, 0.0,0.0,1.0, 0.017 assign shape ,"D%2D",i[0],1, 1.0,0.0,0.0, 0.018 assign shape ,"D%2D",i[0],2, 0.0,1.0,0.0, 0.019 assign shape ,"D%2D",i[0],3, 0.0,0.0,1.0, 0.020 mode pseudoatoms21 exit22 enddo23 domain24 inputfile "DOMAIN/domain.%4D.%4D.list",kid,indiv25 mode pseudoatoms26 show27 run28 exit29 #30 save31 outf "STRU/zns_wurtzite.%4D.%4D.loaded",kid,indiv32 omit ncell33 omit gene34 omit scat35 omit adp36 run37 exit38 @plot.xbs.shell loaded.shell.bs,kid

The last two steps in the simulation process insert the actual atoms intoour nanoparticle, line 66–67 of the main macro discus.cdse.mac. We firstinsert the atoms that form the shell insert.sub.mac and then insert thecore into this construction, and both insertion algorithms utilize thedomain concept. With this concept, all atoms that are inserted lateron, remove previous atoms that are too close to the new positions. Byinserting the core after the shell has been created, we make sure that thecore keeps its original elliptical shape and that the inner half of all shellparticles is removed. Since the shell particles were initially created as

Page 166: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.4 Creating core–shell particles 155

spheres, whose centers were positioned on the core ellipsoid’s surface,this algorithm also automatically creates the intended hemisphericalshell particles.

For each of the shell particles that had been created by shape.sub.macand whose position was determined by shape.shell.mac, the propertiesof a domain are defined in the loop in lines 8–22. Within each cycle, thepseudo atom name and the content file is incremented to correspondto the names created in shape.shell.mac and shape.sub.mac. Here we needto use an individual pseudo-atom name for each domain, since eachdomain corresponds to an individual shell particle. All shell particlesare different, since they have their individual diameter and their indi-vidual stacking sequence. At the domain level (lines 23–28) the runcommand finally inserts all atoms from the individual shell particlesinto a preliminary particle.

File: nano/insert.core.mac

1 read2 stru "STRU/zns_wurtzite.%4D.%4D.loaded",kid,indiv3 #4 domain5 rese6 assign character,si, fuzzy7 assign content,si, "STRU/cdse_wurtzite.%4D.%4D.core",kid,indiv8 assign fuzzy ,si, 2.559 assign orient ,si, 1, 1.0, 0.0, 0.0, 0.0

10 assign orient ,si, 2, 0.0, 1.0, 0.0, 0.011 assign orient ,si, 3, 0.0, 0.0, 1.0, 0.012 assign shape ,si, 1, 1.0, 0.0, 0.0, 0.013 assign shape ,si, 2, 0.0, 1.0, 0.0, 0.014 assign shape ,si, 3, 0.0, 0.0, 1.0, 0.015 inputfile CELL/position.core16 mode pseudoatoms17 show18 run19 exit20 #21 purge

File: nano/trans.for.pdf.mac1 r[1] = 50.00/lat[1]2 r[2] = 50.00/lat[2]3 r[3] = 50.00/lat[3]4 trans5 anew r[1], 0.0, 0.06 bnew 0.0, r[2], 0.07 cnew 0.0, 0.0, r[3]8 onew 0.0, 0.0, 0.09 sel all

10 incl all11 run12 exit13 #14 save15 outf "STRU/temp.%4D.%4D",kid,indiv16 omit ncell17 omit gene18 omit scat19 omit adp20 run21 exit22 read23 stru "STRU/temp.%4D.%4D",kid,indiv

The insertion of the core is comparatively easier. We need just onepseudo atom at a fixed location to define the center of the core. A pre-defined file, CELL/position.core, line 15, contains a single silicon atom atthe origin. The domain statements (lines 4–18) defined that this siliconatom is interpreted as pseudo-atom and to be replaced by the contentof file STRU/cdse_wurtzite.xxxx.yyyy.core. Once the core has been in-serted, the particle will contain a lot of voids, since DISCUS replacesatoms that have been removed from the crystal by this atom type. Tospeed up the following calculation of the powder pattern and the PDF,we purge all voids from the crystal in line 21. At this point the simula-tion of the core–shell particle is finished and the result is shown in Fig.9.17. The PDF algorithm implemented in DISCUS works faster if eachunit cell contains the same number of atoms. This is done by the macrotrans.for.pdf.mac. As a last step, we therefore transform the unit cell toa large 50Å unit cell that contains all atoms. At this stage the powderdiffraction pattern and the PDF may be calculated.

Page 167: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

156 Creating nanoparticles

5 10 15 20 25

–6

–3

0

3

6

G(r

)

r (Å)

1 2 3 4 5–6–3

0

3

6

G(r

)

Fig. 9.17 Calculated PDF of CdSe/ZnS core–shell nanoparticles. The calculated PDF givesa reasonable fit to the observed PDF.

9.5 Carbon nanotubes

a

b

a2

1

(1,1)

(2,0) (3,0)

(2,1)

Fig. 9.18 Base vectors for the descriptionof carbon nanotubes. Vectors a1 and a2

are used for the (m, n) notation of theequatorial vector, while a1 and b = −a2

form the standard hexagonal unit cell.

As a final example we will present an algorithm to simulate carbonnanotubes. Single walled carbon nanotubes consist of a single graphitelayer that is rolled up to form the tube. In the literature this sheet isreferred to as graphene and is usually described in a unit cell that con-sists of vectors a1 and a2 that are of equal length and form an angleof 60◦ as shown in Fig. 9.18. The length of each vector is the distancebetween the centers of two adjacent C6 rings. The vector a2 is equalto −b, the second base vector in a standard hexagonal setting. Twovectors are needed to define a rectangular section of this graphite sheetthat is rolled up, the vector parallel to the cylinder axis caxis and a vec-tor e normal to the cylinder axis within the graphene sheet, which willform the equatorial plane of the tube. A continuous pattern aroundthe cylinder axis is formed, if this vector e is an integer vector of thegraphite lattice. It has become standard to refer to this vector simply bythe multiples of the pseudo-hexagonal vectors a1 and a2, such as (m,n)with integer m, n values: (12, 12) or (12, 0). Due to the P6mm symmetryof the graphene sheet, n is reduced to the interval [0 : m]. To simulatea carbon nanotube, we will first create a large flat graphene sheet ofproper dimensions and in a second step roll this up to form the nan-otube. The calculations in this macro are based on the asymmetric unitin file hexagonal.cell with standard hexagonal dimensions, space groupP6 and a carbon atom at 1/3, 2/3, 0. In this metric, we have to keep inmind that the vector a2, used in the (m, n) notation is equal to −b, and

Page 168: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.5 Carbon nanotubes 157

accordingly, the n component of the equatorial vector (eqx, eqy) is in-verted in line 15. Alternatively, you could use a unit cell with γ = 60◦, File: nano/nano.single.wall.mac

1 variable integer,dimx2 variable integer,dimy3 variable real,eqx4 variable real,eqy5 variable real,ax6 variable real,ay7 variable real,circum8 variable real,radius9 variable real,length

10 variable real,tpi11 #12 tpi = 8.*atan(1.0)13 eqx = $114 eqy = $215 eqy = -1.*eqy16 length = $317 #18 read19 cell hexagonal.cell20 #21 vprod eqx,eqy,0.0, 0,0,-122 r[0] = blen(res[1],res[2],0.0)23 ax = res[1]/r[0]*length/2.24 ay = res[2]/r[0]*length/2.25 #26 r[1]=max(abs( eqx/2+ax),abs( eqx/2-ax))27 r[2]=max(abs(-1.*eqx/2+ax),abs(-1.*eqx/2-ax))28 dimx=2*int(max(r[1],r[2])+1)29 r[1]=max(abs( eqy/2+ay),abs( eqy/2-ay))30 r[2]=max(abs(-1.*eqy/2+ay),abs(-1.*eqy/2-ay))31 dimy=2*int(max(r[1],r[2])+1)32 #33 read34 cell hexagonal.cell,dimx,dimy,135 #36 circum = blen(eqx,eqy,0.0)37 radius = circum/tpi38 #39 @trans2cart40 #41 boundary hkl, 1, 0, 0, circum*0.5+0.142 boundary hkl,-1, 0, 0, circum*0.5-0.143 boundary hkl, 0, 1, 0, length*0.5+0.144 boundary hkl, 0,-1, 0, length*0.5+0.145 purge46 #47 do i[0]=1,n[1]48 r[34] = x[i[0]]/circum*tpi49 x[i[0]] = radius*sin(r[34])50 z[i[0]] = radius*cos(r[34])51 enddo52 #53 @plot.xbs single,eqx,abs(eqy),length54 @powder single,eqx,abs(eqy),length55 @trans.for.pdf56 @pdf single,eqx,abs(eqy),length

space group symmetry P1 and two carbon atoms at 1/3, 2/3, 0 and at2/3, 1/3, 0. In this case, the equatorial vector could be taken from the(m, n) notation without any further change. This unit cell would alsobe a good choice for the simulation of BN nanotubes, since you simplychoose one of these atoms to be boron and the other nitrogen. The thirdparameter $3 given to the macro is the length of the nanotube in Å inline 16.

Next we determine the dimensions of the hexagonal graphene sheetfrom which the tube shall be cut. The vector along the tube axis, caxis, iscalculated as the vector product of the equatorial vector (eqx,eqy,0)and the hexagonal c axis and normalized to half the tube length. Thecoordinates of the four vectors ±e/2 ± caxis are analyzed for the max-imum values along the hexagonal a and b axis to give the requireddimension of the hexagonal layer. This is illustrated in Fig. 9.20 fora (1, 1) nanotube of length four unit cells. As long as the values of(m, n) are limited to positive integers, the calculation of the required di-mensions could be reduced to dimx = 2*(eqx/2+ax)+2 and dimy= 2*(eqy/2+ay)+2. Lines 26–31 of the macro allow you to adaptany positive and negative (m, n) values. If you modify the (m, n) val-ues you will see that the nanotubes repeat according to the hexagonalsymmetry of the graphene sheet.

Now the hexagonal unit cell is expanded to a sheet, lines 33–34, andwe calculate the circumference of the tube, which is just the length ofthe equatorial vector (m, n). At this stage the unit cell metric is trans-formed to a cartesian system with the x-axis parallel to the equatorialvector and the y-axis parallel to the tube axis, see macro trans2cart.mac

–8 –6 –4 –2 0 2 4 6 8

–4

–2

0

2

4

z

x

0 1 2

09 1929

α

Fig. 9.19 Illustration of the projection of the graphene sheet into the nanotube. The dis-tance of the atoms in the graphene sheet (solid circles) gives the angle between their posi-tion in the nanotube (open circles) and the z-axis, as shown for atom 2 and its projection2’.

Page 169: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

158 Creating nanoparticles

b

a

Fig. 9.20 Determination of the required graphene sheet size. The coordinates of the fourpoints ±e/2 ± caxis define the required part of the graphene sheet that will be rolled up.The equatorial vector is drawn as the solid thick vector, the tube axis vector as the brokenthick vector and the hexagonal base vectors as the thin broken vectors.

Fig. 9.21 Left: structure of the (12,12) nanotube. Right: structure of the (20, 0) nanotube.

in line 39. Within this cartesian metric it is straightforward to cut thesheet to the correct size, lines 41–44. The two {100} faces at half thecircumference and the two {010} faces at half the tube length will cutthe sheet as shown in Fig. 9.20. A small margin is added to allow forrounding errors.

Now we are ready to roll up the nanotube. The x-coordinate of eachatom defines the angle α between the z-axis and the position of theatom in the rolled up nanotube: α = 2πx/circumference as shown in Fig.9.19. The distance of all atoms from the y-axis is simply the radius ofthe nanotube. Figure 9.21 shows the (12, 12) and (20, 0) carbon nan-otubes. Both have been simulated with a length of just 10 Å. The car-bon hexagons in the (m, m) nanotubes are oriented with a corner in the

Page 170: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

9.6 Bibliography 159

equatorial plane, while those for the (m, 0) nanotubes are oriented witha corner pointing along the nanotube axis. At first sight, more complexnetworks seem to appear for general (m, n) nanotubes. Keep in mindthough that these nanotubes are all equally constructed from the iden-tical graphene sheet and the only difference is the orientation of theequatorial vector.

0 20 40 602Θ

80 1000

1

2

3

4

5

Inte

nsity

100

0)

Fig. 9.22 Powder diffraction pattern of a(12,12) nanotube. This is a neutron pow-der pattern calculated for a wavelengthof 1.5 Å. The features at 45 and 80◦ areslightly different for the various (m, n)nanotubes.

5 10 15 20 25 30

Diameter

8

6

4

2

0G

(r)

r (Å)

Fig. 9.23 PDF of a (12, 12) nanotube. Thepeak at r=16.3 Åcorresponds to the nan-otube diameter. The PDF was calculatedwith a Qmax = 30 Å−1, and atomic dis-placement parameter BCarbon = 0.5.

The powder pattern and PDF of the generated nanotube are shownin Fig. 9.22 and 9.23, respectively. It is characterized by Bessel func-tion oscillation in the lower 2Θ part. The position of the oscillationsare a direct measure of the nanotube diameter. This part of the powderdiffraction pattern is almost identical for the different carbon nanotubesas long as the diameter is the same. The PDF of different nanotubes arealmost identical for the first few Å. In this range of interatomic dis-tances, the different curvatures of the rolled up graphene sheet do notyet change the interatomic distances very much. A common featureto all nanotubes is the pronounced maximum at a distance that corre-sponds to the nanotube diameter, here for the (12, 12) carbon nanotubeat 16.3 Å. As the diameter of (m, m) carbon nanotubes is changed, thefollowing effects are observed in the PDF. Peaks beyond approximately8 Å distance start to shift to longer values with increasing diameter,since the increase in diameter moves atoms further apart. New max-ima appear in this range as well, since more C6 rings are added alongthe circumference.

9.6 Bibliography

[1] K. Kodama, S. Iikubo, T. Taguchi, S. Shamoto, Finite size effects ofnanoparticles on the atomic pair distribution functions, Acta Cryst.A62, 444 (2006).

[2] R.C. Howell, Th. Proffen, S.D. Conradson, Pair distribution func-tion and structure factor of spherical particles, Phys. Rev B 73,094107 (2006).

[3] V.I. Korsunskiy, R.B. Neder, A. Hofmann, S. Dembski, Ch. Graf,E. Rühl, Aspects of the modelling of the radial distribution func-tion for small nanoparticles, J. Appl. Cryst. 40, 975 (2007).

[4] R.B. Neder, V.I. Korsunskiy, Ch. Chory, G. Müller, A. Hofmann,S. Dembski, Ch. Graf, E. Rühl, Structural characterisation of II-VIsemiconductor nanoparticles, Phys. Stat. Sol. C 4, 3221 (2007).

[5] T. Egami, S.J.L. Billinge, Underneath the Bragg Peaks Structural Anal-ysis of Complex Materials, Peregamon, 2003.

[6] D.A. Keen, A comparison of various commonly used correlationfunctions for describing total scattering, J. Appl. Cryst. 34, 172(2001).

[7] Z. Yu, L. Guo, H. Du, T. Krauss, J. Silcox, Shell distribution oncolloidal CdSe/ZnS quantum dots, Nano Letters 5, 565 (2005).

Page 171: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

160 Creating nanoparticles

Exercises(9.1) Create spherical silicon nanoparticles free of any

defects. Calculate the X-ray and neutron powderdiffraction pattern and the PDF as a function of par-ticle size.

(9.2) Start from the nanoparticle of the previous exercise,and simulate it with diameter D. Introduce a defectmodel in which the nanoparticle surface is allowedto relax. Define an outer shell of the silicon particlewith thickness T , which shall be user-definable. De-velop models for two different relaxation schemes:

(a) The interatomic distance between the shellatoms shall be constant within the shell, ata user-definable fraction F of the interatomicdistance within the core.

(b) The interatomic distance between the shellatoms shall be a linear function of the dis-tance from the inner shell surface. At the in-ner shell surface the relative relaxation shallbe one, i.e. no relaxation, and should changetowards the particle surface, where the relax-ation shall reach the user-defined fraction F ofthe interatomic distance within the core.

Analyze the effect of these relaxation schemes on

the powder pattern and the PDF, for a range of frac-tion from some 0.8 to 1.2. How do the observed ef-fects depend on the total diameter D and the shellthickness T ?

(9.3) Modify the macros that are given in this chapter tocreate carbon nanotubes such that you can simulatesingle-walled boron nitride nanotubes.

(9.4) Rolling up a very long nanotube may take severalseconds on your computer, and here you shoulddevelop an alternative algorithm for the nanotubesimulation along the following ideas.Along the nanotube axis all nanotubes are periodic.Determine the periodicity as a function of (m, n)values. Use this periodicity to create a unit cell ofthe nanotube, which you can then expand to anylength.

(9.5) Simulate multiwalled carbon nanotubes that havea spiral shaped cross-section. The distance be-tween the layers shall remain constant, i.e. the spi-ral should be an Archimedean spiral. The carbon-carbon distances shall remain constant throughoutthe nanotube.

Page 172: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Analyzing disorderedstructures 10In the previous chapters, the focus was to generate disordered struc-tures or nanoparticles. In this section we will introduce the tools thatDISCUS provides, to analyze a given structure. These tools include cal-culating correlations, bond length distribution or to export the whole orany part of the structure, to be visualized using an external program.

10.1 Visualizing structures

The program DISCUS itself has no plotting capabilities, and the mecha-nism to create a plot of a structure is to export part or all of the atomsin a format suitable for plotting by external programs. Programs sup-ported by DISCUS are listed in Table 10.1. The first program, KUPLOT,is actually included in the DISCUS package. In fact most of the struc-ture plots in this book were created using that program. The limitationis the fact that KUPLOT can only create two-dimensional plots. Theother programs on the list allow for three-dimensional plots with vary-ing degrees of sophistication, and we will look at a plot generated withthe program ATOMS later in this section. DISCUS also allows one to ex-port the desired atom coordinates in CIF files. Note that many structure CIF stands for Crystallographic Informa-

tion Framework. It is a common fileformat to store crystallographic informa-tion. More information can be found athttp://www.iucr.org/iucr-top/cif/.

plotting programs are unable to read structures containing more than

Table 10.1 Structure plotting programs supported by DISCUS.

Program Command Website

CIF prog cif Allows import in most programs.

ATOMS prog atoms http://www.shapesoftware.com/DIAMOND prog dia http://www.crystalimpact.com/DRAWXTL prog drawxtl http://home.att.net/

∼larry.finger/drawxtl/GNUPLOT prog gnuplot http://www.gnuplot.info/KUPLOT prog kuplot http://discus.sourceforge.net/XBS prog xbs http://www.ihp-ffo.de/∼msm/

161

Page 173: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

162 Analyzing disordered structures

one unit cell. This problem is overcome by transforming the completemodel structure into one unit cell. This task is done automatically byDISCUS if required by the selected output format, e.g. the exported CIFfiles consist of a single super unit cell containing the complete structure.File: analyse/plot.1.mac

1 plot2 prog kuplot3 ext all4 select all5 set 0,8,6,0.86 set 1,3,6,1.07 #8 vec 0, 0, 09 uvw 0, 0, 1

10 abs 1, 0, 011 ord 0, 1, 012 thick 1.013 outfile sro_001.plot14 run15 #16 vec 0, 0, 017 uvw 1, 0, 118 abs -1, 0, 119 ord 0,-1, 020 thick 1.021 outfile sro_101.plot22 run23 #24 prog atoms25 ext x,-5.0,5.026 ext y,-5.0,5.027 ext z,-5.0,5.028 vec 0, 0, 029 uvw 0, 0, 130 abs 1, 0, 031 ord 0, 1, 032 thick 9999.033 outfile sro.inp34 run35 exit

First we want to use KUPLOT to create structure plots of a structureshowing chemical short-range order similar to the example in Section5.5. The structure is 50 x 50 x 50 unit cells in size and rather than export-ing all the atoms, we start by looking at slices in particular directions.The corresponding macro to export the structure slices is shown here.After entering the plot module (line 1), the format for the programKUPLOT is selected (line 2). Next we choose to include all of the crys-tal (line 3) which later will be limited to the selected slice. In line 4all atoms types will be included in the output file. In lines 5–6 the de-sired marker, color and size for each atom type is selected. Next weneed to define the desired slice. Such a slice is defined by a point v inreal space, its thickness, and its normal. For each atom in the crystalthe vector from the point v to the atom is projected onto the real spacenormal to the slice. Only if the length of this projection is less than the

–20 –10 0 10 20

–20

–20–20

–10

–10

0

0

10

10

20

20

–10 0 10 20 –20 –10 0 10 20

[1 0 0]

[1 0 0]

–20 –10 0 10 20[0 1 0]

[0 1 1]

–20

–10

0

10

20

[0 1

0]

–20

–10

0

10

20

[0 0

1]

[0 0

1]

[1 0

0]

Fig. 10.1 Different sections of a disordered structure.

Page 174: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

10.1 Visualizing structures 163

thickness, is the atom exported. The value of v is set in line 8, the vectornormal to the plane is set in line 9 and the vectors for the abscissa andordinate of the exported slice are defined in lines 10 and 11. The thick-ness of the slice is set in line 12 to a value of 1.0 Å. Finally an outputfile name is specified (line 13) and the structure export is executed (line14). The resulting structure plot is shown in the bottom left panel ofFig. 10.1. The positive correlation showing up as chains of white atomsalong the [010] direction can easily be seen. Inspecting slices in the otherdirections, one can obtain a picture of the nature of the chemical short-range order. Lines 16–22 export the slice normal to [101] shown in thetop right panel of Fig. 10.1. This view lets one observe the positivecorrelation along [011] very easily. The remaining commands in thisexample macro export part of the structure in a format suitable to beimported by the program ATOMS. First the program ATOMS is selected(line 24) and next we limit the extend of the structure to be exportedto 10 x 10x 10 unit cells. Remember, the origin (0, 0, 0) is at the centerof the model crystal. We set up our directions as before (lines 28–31),but we select a thickness large enough to include all the atoms (line 32).The exported file is then imported into ATOMS and the resulting three-dimensional plot is shown in Fig. 10.2. We have used plotting options

Fig. 10.2 Three-dimensional view of disordered structure created using the programATOMS.

Page 175: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

164 Analyzing disordered structures

within ATOMS, to color the bonds between the different atom types dif-ferently to enhance the correlations present in the structure. Of courseexploring the three-dimensional structure interactively on a computerwill give a much better insight into the disorder than the plots in thisbook. As we have mentioned earlier, ATOMS treats the complete modelas a single unit cell.

00

14.4

b-ax

is (Å

)

14.4a-axis (Å)

Fig. 10.3 Example of a plot of a hexagonalstructure.

File: analyse/plot.3.mac1 load cr,sro_100.plot2 #3 aver 1.04 angl 90.05 #6 plot

File: analyse/plot.2.mac1 plot2 prog kuplot3 ext all4 vec 0,0,05 uvw 0,0,16 abs 1,0,07 ord 0,1,08 set 1,3,6,1.09 sel all

10 #11 thick 1.012 type crystal13 outfile crystal.dat14 run15 #16 thick 9999.017 type projection18 outfile density.dat19 run20 #21 exit

The exported atom coordinates are given as fractional coordinatesand an undistorted plot is either obtained by transforming the crystalinto cartesian coordinates (see Section 3.5) or by plotting the result ap-propriately. Here we show the commands used in KUPLOT to create thegraphs we discussed earlier. The two commands of interest are givenin lines 3 and 4. The command aver allows one to specify the aspectratio between the x and y axis of the plot, and angl allows one to setthe angle between the plotting axis. This way an undistorted plot canbe achieved as in Fig. 10.3 showing four unit cells of a hexagonal struc-ture.

So far we have exported all the unit cells within the selected sliceand extent of the model. The next example is a structure of 20 x 20x 20 unit cells in site with one atom on (0, 0, 0). Each atom has beendisplaced according to its atomic displacement parameter. The macro isgiven here and lines 1–14 are familiar already. The corresponding plotis shown in Fig. 10.4 on the left. The thermal displacements are barleyvisible on the given scale. Often it is convenient to project all atomsback into one unit cell and investigate the atom density distributionshown in the right panel of Fig. 10.4. Now the isotropic displacementsaround the ideal (0,0,0) position can easily be seen and quantified. Theonly difference in the commands used to export the structure is theparameter of the command type (line 17) which is set to projectionrather than crystal.

In general visualizing complex disordered structures is rather chal-lenging, because of the size of the model and/or the nature of the dis-order. Possibilities to enhance the disorder are to enlarge displacements

–0.05–5 0 5

–0.05

0

0.05

y (l

.u)

0 0.05x (l.u.) x (l.u.)

–5

0

5

y (l

.u.)

1020

30D

ensi

ty (

arb.

uni

ts)

Fig. 10.4 Example of crystal and density export.

Page 176: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

10.2 Occupancies 165

or color coding atoms with a certain environment by assigning them adifferent atom type. There are many ways to enhance the visibility ofthe disorder and the most suitable method will depend on the nature ofthe disorder present. In the remaining sections of this chapter we willdiscuss tools to quantify the disorder present in a given structure.

10.2 Occupancies

Many defect structures involve doping or creating vacancies and themost simple question is, what is the overall composition of the modelstructure? The command elem in the chem module of DISCUS willdisplay the following information:

Size of the crystal (unit cells) : 50 x 50 x 1Total number of atoms : 2500Number of atoms per unit cell : 1Number of different atoms : 1

Element : VOID(0) rel. abundance : 0.199 ( 497 atoms)Element : CU(1) rel. abundance : 0.801 ( 2003 atoms)

The first four lines contain general information about the current struc-ture, such as the size in unit cells and the number of atoms in a unit cell.

0.4 0.6 0.8 1Concentration copper

0.4 0.6 0.8 1Concentration copper

0

20

40

0

20

40

Prob

abili

ty (

%)

Prob

abili

ty (

%)

(a) (b)

(c) (d)

Fig. 10.5 Density of copper occupied sites for two test structures.

Page 177: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

166 Analyzing disordered structures

The remaining lines list the abundance for each atom type present in themodel. Of course this information is not sufficient to learn for exam-ple how homogeneously the vacancies are distributed. DISCUS allowsone to obtain atom concentrations in subregions or lots of the crystal.This is the same mechanism that is used to obtain smooth diffractionpatterns (see Section 4.1.2), only this time the atom concentrations aredetermined, and not the scattering intensities. The short macro shownFile: analyse/homo.1.mac

1 chem2 set lots,eli,4,4,1,500,y3 set bin,114 homo occ,cu,homo.dat5 exit

here illustrates this. The chem module is entered in line 1. The size ofthe sample volume is set to an ellipsoid of 4 x 4 x 1 unit cells. A total of500 lots will be used (line 2). Next the number of bins is set to 11 (line 3).Obviously the largest number of bins corresponds to one over the max-imum number of atoms in one lot. This represents the smallest possiblechange in concentration. The command homo (line 4) starts samplingthe occupancy of the copper atoms and writes the result to a file. Fig-ures 10.5a and b show the structure and concentration distribution for adisordered sample. Here the relative abundance of copper given by thecommand elem is 0.8 as indicated by a dashed line in Fig. 10.5. Inspec-tion of the structure shown in Fig. 10.5a reveals that the crystal actuallyconsists of two phases, one checker-board type with a copper concentra-tion of 0.5 and regions with full copper occupancy or in other words aconcentration of 1.0. This can also be seen in the concentration distribu-tion shown next to the structure plot. The two maxima correspond toa concentration of 0.5 and 1.0. By adjusting the size of the sample vol-ume (lots) additional information about the size of the phase regionscan be obtained. Figures 10.5c and d show the same plots for the sameconcentration of copper atoms but with a random distribution. Herethe histogram peaks at the average concentration of 80%, as expected.

10.3 Finding neighbors

In many of our examples, we have used neighbor definitions based onunit cell and site number. For simple structures, these are easy to define.However, in case of more complex structures, the DISCUS commandenv might be a useful tool. The simple macro shown here will find allFile: analyse/neig.1.mac

1 chem2 neig atom,1,2.503 exit

neighboring atoms around atom number one up to a distance of 2.5 Å(line 2). The output is shown here:

Found neighbours (quick more=T periodic boundaries (x,y,z) = TTT)Position of search center : -2.000 -2.000 -2.000Search radius [A] : 2.500Unit cell and site : 1 1 1 / 1Atom index : 1 (ZR+4(1) )

# atom name dist[A] pos cell site-----------------------------------------------------------------

1 1500 O-2(2) 2.23 2.75 2.75 2.75 5 5 5 122 1446 O-2(2) 2.23 -1.75 2.75 2.75 1 5 5 63 1255 O-2(2) 2.23 2.75 -1.75 2.75 5 1 5 74 1209 O-2(2) 2.23 -1.75 -1.75 2.75 1 1 5 95 296 O-2(2) 2.23 2.75 2.75 -1.75 5 5 1 86 251 O-2(2) 2.23 -1.75 2.75 -1.75 1 5 1 117 58 O-2(2) 2.23 2.75 -1.75 -1.75 5 1 1 108 5 O-2(2) 2.23 -1.75 -1.75 -1.75 1 1 1 5

Page 178: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

10.4 Distortions 167

As one can see right away, not only are the neighboring atoms listed,but also their corresponding unit cell and site number. This is veryhelpful when constructing the neighbor vectors in the MC setup, orto calculate distortions or correlations as we will discuss in the nextsections.

10.4 Distortions

2.752.52.25Bond length ( ¼)

0

0.25

0.5

Prob

abili

ty

Cu–Cu

Cu–Au

Au–Au

Fig. 10.6 Example of bond length distri-butions calculated by DISCUS.

After learning about occupancies and how to analyze the chemistry ofa model crystal, we now focus on distortions. In Section 5.6 we con-structed a disordered model showing size-effect type distortions. Thecorresponding bond length distribution is shown again in Fig. 10.6.The simple macro to generate these distributions is shown below thefigure. First the chem module is entered. Next the desired range (line

File: analyse/blen.1.mac1 chem2 set blen,1.5,3.53 set bin,4014 #5 blen cu,cu,cu_cu.blen6 blen cu,au,cu_au.blen7 blen au,au,au_au.blen8 exit

File: analyse/blen.2.mac1 chem2 set neig,rese3 set vec, 1,1,1, 1, 0, 04 set vec, 2,1,1,-1, 0, 05 set neig,vec,1,26 set neig,add7 #8 set vec, 3,1,1, 0, 1, 09 set vec, 4,1,1, 0,-1, 0

10 set neig,vec,3,411 set neig,add12 #13 set vec, 5,1,1, 0, 0, 114 set vec, 6,1,1, 0, 0,-115 set neig,vec,5,616 #17 disp cu,cu,cu_cu.disp18 disp cu,au,cu_au.disp19 disp au,au,au_au.disp20 exit

2) and the number of histogram points (line 3) are defined. In our casethe distribution is calculated for distances between 1.5 Å and 3.5 Å witha resolution of 0.005 Å corresponding to 401 data points. In lines 5–7the distribution is calculated separately for each set of pairs: Cu-Cu,Cu-Au and Au-Au. This allows us to separate the contributions in Fig.10.6. The distributions will be written to the specified files. DISCUS alsocreates the following screen output:

Calculating bond-length distibutionAllowed range : 1.50 A to 3.50 A / File : all.blen ( 401 pts)

CU(1) - CU(1) : d = 2.919 +- 0.417 A (Min = 2.235, Max = 3.500)(Pairs = 1295708)

CU(1) - AU(2) : d = 2.876 +- 0.464 A (Min = 2.163, Max = 3.500)(Pairs = 554554)

AU(2) - AU(2) : d = 2.845 +- 0.502 A (Min = 2.083, Max = 3.500)(Pairs = 241432)

For each pair, the average bond length and standard deviation are givenas well as the number of pairs found. For small models it is importantto make sure that the number of pairs is sufficiently large to yield ameaningful result.

The command blen will calculate bond lengths between atoms in alldirections. Sometimes it is desirable to obtain the distribution of dis-tances along certain neighboring directions. There is a different com-mand to achieve this as can be seen in the macro file given here. Theinstructions in lines 2–9 should be familiar as they are similar to theones used in the MC simulation setup (see Section 5.5). Here we havethree different neighbor definitions for the [100], [010] and [001] direc-tions. The rest is simply executing the command disp for all the de-sired pairs. The screen output is shown next:

Page 179: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

168 Analyzing disordered structures

Calculating distortionsAtom types : A = all and B = all

Neig. Atom A Atom B distance sigma # pairs---------------------------------------------------------

1 CU(1) CU(1) 2.552 0.060 2446041 CU(1) AU(2) 2.475 0.061 1053721 AU(2) AU(2) 2.404 0.063 446522 CU(1) CU(1) 2.553 0.062 2447322 CU(1) AU(2) 2.475 0.062 1052442 AU(2) AU(2) 2.403 0.062 447803 CU(1) CU(1) 2.552 0.062 2456443 CU(1) AU(2) 2.476 0.061 1043323 AU(2) AU(2) 2.405 0.061 45692

0.2

Cu–Cu <100> Pairs

Cu–Au <100> Pairs

Au–Au <100> Pairs

x (l.u)0.4 0.6 0.8 10

0

0

0

Fig. 10.7 Atom densities for 〈100〉 neigh-bors for three different pairs.

Now an average distance and its standard deviation is given for eachneighbor and we see small differences for the pairs in the three differentdirections. All the corresponding difference vectors are stored in the filespecified as the last parameter of the command disp. This file can thenbe used to plot atom densities as shown in Fig. 10.7. It can easily be seenthat the distribution is narrow perpendicular to the neighboring vector,but broad in other directions. This is a result of only using nearest-neighbor terms in the MC simulation used to generate this disorderedstructure (see Section 5.6).

In this section we have discussed how to determine bond length dis-tributions in different ways. Displacement correlations as well as chem-ical correlations are the subject of the next section.

10.5 Calculating correlations

The properties such as occupancies or distortions that we have calculateso far, are a function of a single atom. Now we will discuss examplesof calculating correlations within the crystal. We have discussed corre-lations in Section 5.1, and it is worth remembering that scattering onlycontains information about two-body correlations. As a quick reminder,a correlation of zero corresponds to a random arrangement. A positivecorrelation describes two variables wanting to be the same, for exam-ple the direction of a displacement or two atoms, or the occupancy oftwo atomic sites. A negative correlation describes the opposite situa-tions, the variables want to be opposite. In the following sections wewill learn how to calculate chemical and displacement correlations inDISCUS.

10.5.1 Occupational correlations

Although we have discussed correlations earlier in this book, no defi-nition has been given so far. One definition of the chemical correlationcoefficient cij between a pair of sites i and j based on a statistical defi-nition of correlation [1] is given as:

cij =Pij − θ2

θ(1 − θ)(10.1)

Page 180: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

10.5 Calculating correlations 169

Model 1 Model 2 Model 3

Fig. 10.8 Three model structures showing different vacancy ordering.

Pij is the joint probability that both sites i and j are occupied by thesame atom type and θ is its overall occupancy. Negative values of cij

correspond to situations where the two sites i and j tend to be occu-pied by different atom types while positive values indicate that sites iand j tend to be occupied by the same atom type. A correlation valueof zero describes a random distribution. The maximum negative valueof cij for a given concentration θ is −θ/(1 − θ) (Pij = 0), the maxi-mum positive value is +1 (Pij = θ). This definition of correlations caneasily be converted to the Warren-Cowley short-range order parameterαij

lmn = 1 − P ijlmn/θ [2]. Here lmn denotes the corresponding neighbor-

ing direction.As an example, we use a two-dimensional model of 50 x 50 unit cells

in size, showing three different types of chemical short-range order.Models 1 to 3 are shown in Fig. 10.8. These models were constructedusing the mmc module of DISCUS similar to the example in Section 5.5,except that only 〈10〉 vectors were used. The macro shown here will File: analyse/corr.1.mac

1 chem2 set mode,quick,periodic3 set neig,rese4 #5 set vec,1,1,1, 1, 0, 06 set vec,2,1,1, 0, 1, 07 set vec,3,1,1,-1, 0, 08 set vec,4,1,1, 0,-1, 09 set neig,vec,1,2,3,4

10 set neig,add11 #12 set vec,5,1,1, 1, 1, 013 set vec,6,1,1,-1, 1, 014 set vec,7,1,1, 1,-1, 015 set vec,8,1,1,-1,-1, 016 set neig,vec,5,6,7,817 #18 corr occ,cu,void19 exit

calculate the correlations c10 and c11 for the 〈10〉 and 〈11〉 directions, re-spectively. The macro should look very familiar, since most of it (lines5–16) are vector definitions, identical to the ones in the MC examples.One new command is given in line 2, selecting the calculation modeand enabling periodic boundaries. The calculation mode quick is only

Table 10.2 Calculated corre-lations.

Model c10 c11

1 −0.02 0.022 0.74 0.623 −0.43 0.35

available for crystalline structures stored in the correct order (see DIS-CUS Users Guide). The calculation itself is carried out by the commandcorr (line 18). The parameters specify the type of correlation, here oc-cupational, and the atom types which are copper (cu) and vacancies(void).

Calculating correlationsAtom types : A = CU and B = VOID

Neig. AA AB BB # pairs correlation---------------------------------------------------------

1 40.32 % 59.68 % 0.00 % 10000 -0.42532 56.48 % 27.36 % 16.16 % 10000 0.3466

The output for model 3 (Fig. 10.8) is shown above. For each neighbordefinition the probability for all the different pairs as well as the corre-sponding correlation coefficient are shown. In our macro neighbor one

Page 181: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

170 Analyzing disordered structures

is 〈10〉 and neighbor 2 is 〈11〉. We can see that c10 is negative as onewould have expected from inspection of Fig. 10.8. We also observe apositive value for c11 which is a result of this particular ordering. Thecorrelation coefficients for all three models are given in Table 10.2.

10.5.2 Displacement correlations

Fig. 10.9 Schematic illustration of dis-placement correlations.

Similar to occupational correlations relating the occupancy of two sites,one can define a correlation coefficient relating the displacements awayfrom the average site positions of two sites. The correlation coefficientcij for displacements between two sites i and j is defined as:

cij =〈xixj〉√〈x2

i 〉〈x2j 〉

(10.2)

Here xi is the displacement of the atom on site i from the average posi-tion in a given direction and 〈·〉 stands for the average over the crystal.A value of zero again describes the case of random displacements. Inthe case of positive correlations atoms are displaced in the same direc-tion and for negative correlations they are displaced in opposite direc-tions. This is schematically illustrated in Fig. 10.9. As an example, weFile: analyse/dcorr.1.mac

1 chem2 set mode,quick,periodic3 set neig,rese4 #5 set vec,1,1,1, 1, 0, 06 set vec,2,1,1,-1, 0, 07 set vec,3,1,1, 0, 1, 08 set vec,4,1,1, 0,-1, 09 set vec,5,1,1, 0, 0, 1

10 set vec,6,1,1, 0, 0,-111 set neig,vec,1,2,3,4,5,612 set neig,dir,1,0,0,1,0,013 set neig,add14 #15 set neig,vec,1,2,3,4,5,616 set neig,dir,1,0,0,0,1,017 #18 corr disp,cu,au19 exit

analyze the disordered structure used in the previous section to calcu-lating distortions. The macro is shown here and again most of the com-mands are our familiar neighbor definitions. There is only one newcommand, set neig,dir that we have not seen before. This com-mand allows one to consider all displacements (set neig,dir,all)or just displacements in a given direction as in our example. Note thatthe displacement direction for the two sites i and j is not necessarilythe same. In our case we want to determine the correlation betweendisplacements both in the x direction (neighbor definition 1) and be-tween displacements in the x and y directions (neighbor definition 2).The command corr again calculates the correlations, this time for theatom displacements between copper and gold atoms. The output ofDISCUS is shown here:

Calculating correlationsAtom type: A = cu B = au

Neig. Displacement A Displacement B # pairs correlation---------------------------------------------------------------

1 1.00 0.00 0.00 1.00 0.00 0.00 157474 0.30132 1.00 0.00 0.00 0.00 1.00 0.00 157474 0.0223

Neighbor one results in a positive correlations which is consistent withthe size effect type distortion where copper and gold atoms are mov-ing closer in the 〈100〉 direction. There is however a nearly zero valuefor neighbor definition two indicating that no correlations between dis-placements in the x and y directions exist.

Page 182: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

10.6 Bond valence sums 171

10.5.3 Correlation fields

So far we have calculated correlations for a discreet set of neighbors.In many cases, however, it is very interesting to study how correla-tions extend within the model structure. One way of doing this is todefine many neighbors extending to larger distances and recording thecorrelations. DISCUS on the other hand also allows the calculation ofcorrelation fields for occupational and displacement correlations as inthe macro shown here. As in many examples before, most of the com- File: analyse/field.1.mac

1 chem2 set mode,quick,periodic3 #4 set neig,rese5 set vec,1,1,1, 1, 0, 06 set vec,2,1,1, 0, 1, 07 set vec,3,1,1,-1, 0, 08 set vec,4,1,1, 0,-1, 09 set neig,vec,1,2,3,4

10 #11 field occ,cu,void,10.dat,0.0,20.012 #13 set neig,rese14 set vec,5,1,1, 1, 1, 015 set vec,6,1,1,-1, 1, 016 set vec,7,1,1, 1,-1, 017 set vec,8,1,1,-1,-1, 018 set neig,vec,5,6,7,819 #20 field occ,cu,void,11.dat,0.0,20.021 #22 exit

1 2 3 4 5 6 7 8 9 10 11Neighbour (Multiple of vector)

Direction <11>

Direction <10>

0

0.25

Cor

rela

tion

Cor

rela

tion

–0.25

0.25

0

Fig. 10.10 Chemical correlation field for〈10〉 and 〈11〉 neighbors of model struc-ture 3 (Fig. 10.8).

mands define the neighboring vectors. This time, the command corris replaced by the command field (lines 11 and 20). The first threeparameters specify the type of correlations and the two atom types, asfor the command corr. Next a filename to output the results and therange of the calculation is given. The range is in units of multiples ofthe corresponding vector definition. In our case, neighbors for the firstfield are 〈10〉, so the correlation field will be calculated for atoms sepa-rated by 〈10〉, 〈20〉, 〈30〉 and so on. Similarly for the second calculation,neighbors are 〈11〉, 〈22〉, 〈33〉 and so on. The result for both calculationsfor the model structure 3 is shown in Fig. 10.10. This structure had anegative correlation in the 〈10〉 direction and a positive correlation inthe 〈11〉 direction as we have calculated in Section 10.5.1. The top panelshows correlations in 〈10〉 direction. It shows the correlation between asite i and sites separated by integer multiples of the vectors used in theneighbor definitions. As expected, the first neighbor correlation is neg-ative for 〈10〉 and positive for 〈11〉 as previously. The correlation in the〈11〉 direction is decaying as a function of the distance within the crys-tal, giving a measure of the extension of the area with preferred 〈11〉vacancy neighbors. Eventually the value tends to zero. The absolutevalue of correlation c10 decays as well, but oscillates between negativeand positive values. This can be understood by thinking of a perfectABAB sequence. All odd neighbors (i.e. 1, 3, 5, . . . ) are AB or BA re-sulting in a negative correlation whereas even neighbors (i.e. 2, 4, 6,. . . ) are AA or BB giving a positive correlation.

10.6 Bond valence sums

The concept of bond valence has found wide applicability in solid statechemistry [3, 4]. One application is the use of bond-valence sums ofcertain atoms or sites as a check on the reliability of a determined lo-cal structure. The valence of an atom i is calculated by the followingempirical expression:

Vi =∑ij

exp

{r0ij − dij

b

}(10.3)

Here r0ij and b are the so-called bond valence parameters, dij is the dis-

tance between the central atom i and the neighboring atom j. The sumgoes over all nearest neighbors. The bond valence parameters, r0 and

Page 183: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

172 Analyzing disordered structures

b are stored as a lookup table in DISCUS. The values were taken froma list compiled by I.D. Brown, McMaster University, Hamilton, Canadafrom various references. The parameters are specific for a given atompair, here Zr4+ and O2−. Note that it is required to use the atom namesindicating the oxidation state like in the example above. It should alsobe noted that bond valence parameters are not available for all pairs ofatoms.The macro shown here illustrates the calculation of bond valencesums. The command is in fact similar to env introduced in Section 10.3.Instead of listing all neighboring atoms, the bond valence sum is calcu-File: analyse/bval.1.mac

1 chem2 bval atom,1,2.53 exit

lated for all neighbors in an environment of 2.5Å around atom one. Forthe cubic example structure of ZrO2 used before, the resulting bondvalence sum is 3.66. This is lower than the expected 4.00 for Zr4+ in-dicating that zirconium is not very happy in the given environment ofthis example structure.

10.7 Bibliography

[1] T.R. Welberry, Diffuse X-ray scattering and models of disorder, Rep.Prog. Phys. 48, 1543 (1985).

[2] J.M. Cowley, Diffraction Physics, Elsevier Science, Amsterdam, 3edition, 1995.

[3] I.D. Brown, D. Altermatt, Bond-valence parameters obtained from asystematic analysis of the inorganic crystal structure database, ActaCryst. B41, 244 (1985).

[4] N.E. Brese, M. O’Keeffe, Bond-valence parameters for solids, ActaCryst. B47, 192 (1991).

Page 184: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Exercises 173

ExercisesAll exercises deal with the analysis and visualization ofthe structure file mystery.stru, which can be found on theCD-ROM.

(10.1) Determine the stoichiometry and the average struc-ture of our mystery compound.

(10.2) Determine if chemical SRO is present in the struc-ture and quantify the correlations in different direc-tions. Do the correlations violate the cubic symme-try of the crystal?

(10.3) As you will have discovered in the previous ex-ercises, the mystery compound contains vacanciesand as a result, the copper atoms have different co-ordination, or in other words a different number

of nearest neighbors. Use DISCUS to determine thenumber of copper atoms in each possible coordina-tion. Export one section of the structure for plottingwith KUPLOT in such a way that the differently co-ordinated atoms are shown in different colors.

(10.4) Calculate bond length distributions and determineif the distortions are consistent with the cubic sym-metry of the structure.

(10.5) This exercise deals with visualising distortions.Starting from our mystery structure, export a sec-tion of the structure in the following ways:

• enlarge displacements by a factor of three;• color atoms that are displaced more than a cer-

tain amount from the average site differently.

Page 185: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 186: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Refining disorderedstructures 11Up to this point we have shown examples of how to create a particulardisordered structure and to calculate its diffuse scattering pattern or itspowder diffraction pattern. The goal of course is to somehow have thecomputer figure out the correct disordered structure. One can think oftwo different approaches to this problem: First one treats every atomand its position as free parameters. One can for example start with theaverage structure and allow the computer to modify this structure un-til a match with the experimental data is achieved. This is the principleof the Reverse Monte Carlo (RMC) method discussed in the next sec-tion. In practice it turns out that a successful RMC refinement requirescareful selection of constraints to end up with a chemically and phys-ically sensible model structure. The second approach is to come upwith a model describing the disorder and refining its free parametersrather than the individual atoms. This strategy using a least-squaresalgorithm to optimize the model parameters was applied to the dif-fuse scattering of Fe(CO)12 [1] and there are more recent examples inthe literature [2]. One should note that every iteration requires the fullconstruction of the disordered structure and the calculation of the dif-fuse scattering or PDF. Of course one can use different minimizationtechniques to refine the parameters of a disordered structural model,and the program DIFFEV was recently added to the DISCUS package toallow minimization via a genetic algorithm. We will give details andshow two examples of this approach in Section 11.3.

11.1 Reverse Monte Carlo method

Trail and error is a very nice way to model diffuse scattering in caseswhere one has a reasonable guess about the model. Many times thiswill only result in a qualitative model describing the data. One ap-proach of analyzing total scattering data is the so-called Reverse MonteCarlo (RMC) method [3].

The RMC process is illustrated schematically in Fig. 11.1. After calcu-lating the agreement with the measurement for the initial model crystalor configuration, a random site is selected and variables associated withit, like occupancy or displacement, are changed by a random amount.The scattering intensity is recalculated after the generated move and the

175

Page 187: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

176 Refining disordered structures

Initial configuration

Calculate

χ 2

Change a variable

at random

Calculate change in χ2

Repeat until an acceptable agreement is obtained

Worse (> 0)

Keep new configuration with a certain

probability

Better (< 0)

Keep new configuration

Fig. 11.1 Schematic diagram of RMC algorithm.

goodness-of-fit parameter χ2 as given in equation 11.1 is computed.

χ2 =N∑

i=1

[Ie(hi) − Ic(hi)]2

σ2(11.1)

The sum is over all measured data points hi, Ie stands for the experi-mental and Ic for the calculated intensity. The change in the goodness-of-fit is given by Δχ2 = χ2

old − χ2new. Every move, which improves the

fit to the data (Δχ2 < 0) is accepted. Those moves which worsen thefit (Δχ2 > 0) are accepted with a probability of P = exp(−Δχ2/2). Theparameter σ is assumed to be independent of h and is treated as a pa-rameter of the modeling. This is of course very similar to the MonteCarlo simulations discussed in Chapter 5 except that we minimize thedifference between observed and calculated data rather then the energyof the system. In fact, the value σ can be identified with the tempera-ture T in the (direct) Monte Carlo method described in Chapter 5. Howmany bad moves are accepted depends on the value of σ or T .

So far changes to the crystal made during the RMC refinement weresimply called moves. These moves can either be a displacement of anatom or the change of the occupancy of an atom site. Because the rel-ative abundance of the elements is not allowed to change during thesimulation, the latter move is actually made by switching the atoms oftwo sites within the crystal. The program knows three different opera-tion modes which involve three different kinds of moves shown in Fig.11.2. Additionally user-defined moves can be included in an externalsubroutine linked to the program DISCUS. A short description of thedifferent RMC operation modes is given in the list below.

Page 188: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.1 Reverse Monte Carlo method 177

• Swap chemistryThis mode (Fig. 11.2a) allows us to simulate occupational disor-der by selecting two different atoms randomly and switch thesetwo atoms. This operation mode ensures that the overall compo-sition of the model crystal is preserved.

(a) swap atoms

(b) shift atoms

(c) swap displacements

Fig. 11.2 RMC operation moves availablein DISCUS.

• Shift atomIf this mode (Fig. 11.2b) is set, a randomly selected atom is shiftedby a random amount in a random direction. The size of the gen-erated shift is chosen uniformly in the interval [−1, 1] unit cell.

• Swap displacementsThis mode (Fig. 11.2c) swaps the displacement, i.e. the differencebetween the average and the actual position of two randomly se-lected atoms of the same type and thus the overall average dis-placements remain constant in contrast to the previous mode.

• ExternalThe program DISCUS allows the user to define more complexRMC moves via an external subroutine. For more details aboutthe construction of such a subroutine, read the commented exam-ple in the file extrmc.f, which is part of the distribution.

The RMC method has been used extensively to model glasses. The firstapplication to single crystal diffuse scattering was a neutron diffractionstudy on ice Ih [4]. There is a number of later examples and discussionsof the RMC method in the literature [5, 6, 7, 8, 9, 10]. It is becoming ap-parent, as the RMC method is used more extensively that the key to asuccessful RMC refinement is access to suitable constraints to preserveknown connectivity in the model, e.g. keeping octahedra from distort-ing too heavily. Once the RMC refinement is finished, the result needsto be analyzed in terms of bond length and bond angle distributions,correlations, and so on. DISCUS provides tools to analyze the resultingconfiguration (see Chapter 10). File: refine/rmc.1.mac

1 read2 stru cuau.random.stru3 #4 pdf5 set range,14.5,0.016 set therm,gaus7 set delta,0.38 set bound,periodic9 set rad,xray

10 #11 set disp,n[1]12 set cyc,n[1]13 set fran,1.0,14.514 des all15 sel cu,au16 data cuau.c110.pdf17 show all18 exit19 #20 variable real,sigma21 variable integer,loop22 #23 do loop=1,2524 sigma=0.0125-loop*0.000525 pdf26 set sigm,sigma27 set mode,swchem28 run29 save stru,cuau.rmc.stru30 save pdf,cuau.rmc.pdf31 exit32 enddo

Next we want to look briefly at an example macro refining chemi-cal short-range order (SRO) using RMC. In fact this is precisely the setof commands used to refine the SRO in Cu3Au from X-ray PDF data[11]. The macro is shown in the margin and starts by reading a start-ing structure (lines 1–2) containing the correct amounts of copper andgold distributed randomly throughout the crystal. Next we enter thePDF module (line 4). It should be noted, that DISCUS can be used forRMC refinements on single-crystal diffuse scattering data as well as thePDF. In the first case, one uses the RMC module of DISCUS, in the lattercase, the PDF module. The commands relating to RMC are the same.Next we set fixed PDF calculation parameters as discussed in Section4.3. Next some RMC related parameters are set: the interval for screenoutput (line 11) and the number of cycles to be carried out (line 12).Note that the variable n[1] contains the number of atoms in the modelcrystal. The refinement range is set to 1.0 Å to 14.5 Å in line 13, theatom types to participate are set to Cu and Au (line 15) and finally theexperimental PDF data are read (line 16). In this macro, we want to sys-tematically reduce the value of σ (equation 11.1), so we systematically

Page 189: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

178 Refining disordered structures

accept less and less bad moves as the refinement progresses. First wedefine two variables loop and sigma (lines 20–21). Next we enter intoa loop (line 23) and adjust the value of σ to a smaller number in eachiteration of the loop (line 24). Then the PDF module is entered and aftersetting the value of σ and selecting the swchem mode, we actually startthe RMC refinement (line 28). All that is left is to save the structure andcalculated PDF at every iteration of the loop.

In addition to DISCUS, there is an advanced suite of RMC programsfor modeling glasses, disordered crystalline structures as well as disor-http://www.isis.rl.ac.uk/RMC/dered magnetic structures, some of which are beyond the scope of theDISCUS RMC module.

11.2 Length-scale dependent PDF refinements

In Chapter 4, we have the pair distribution function (PDF). Modelingtechniques described in this chapter can be used not only to refine sin-gle crystal diffuse scattering, but also the PDF. However, all these meth-ods require the construction of a large model crystal which can ade-quately describe the short- and medium-range order or disorder. ThePDF, or G(r), on the other hand, is a function in real space. This opensthe door to a different approach: the refinement of a small structuralmodel over a varying refinement range. This way, one obtains a sep-arate structural picture consistent with the local-, medium- and long-range structure depending of the refinement range.

Fig. 11.3 Cross-section of a structure con-taining domains.

This approach requires the program PDFFIT [12] included in the DIS-CUS package. As we have mentioned earlier in Chapter 4, the discus-sion of the details of PDFFIT is beyond the scope of this book and wewill limit ourselves to the general principle of these discussions. Be-fore diving into our example, it is also worth noting that a new PDFFITis currently under development [13] making these type of refinementseasier.

As an example [14], we consider a simple domain structure. A sec-tion of the structure is shown in Fig. 11.3. We call the atoms of thehost structure shown as + atom H and the atoms of the domain shownas filled circles atom D. All domains have a spherical shape and a di-ameter of 15 Å. The only difference between the host and the domainstructure is the atom type occupying site (0, 0, 0). The overall concen-tration of atoms D in the crystal is 15%. This domain structure wascreated using DISCUS as we have seen in Chapter 8. We now calculatethe PDF based on this structure and call it our experimental data. Usingthese calculated data as input, we refine a single unit cell model to thePDF. The only parameter of interest is the occupancy of the one singlesite in the unit cell. If we carried out a normal structure refinementbased on Bragg data, the occupancy would come out to the overall con-centration of atoms D, because the average structure is independentof the formation of domains. A similar result is obtained if the PDF

Page 190: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.2 Length-scale dependent PDF refinements 179

5 7.5 10 12.5 15 17.5 20 22.5 25r(Å)

R=0.36%

R=0.58% R=0.13% R=0.11% R=0.05% R=0.08%

R=0.14% R=0.04% R=0.03% R=0.03%–10

0

0

10

10

–10

G(r

)G

(r)

Fig. 11.4 PDF refinements of the experimental data calculated from the domain structure.The top panel shows the refinement over the complete range with R values given for each5 Å section. The bottom panel shows the refinements for each individual 5 Å section.

is refined over a wide range as shown in the top panel Fig. 11.4. Thedifference between calculated and experimental data shows that we ob-tained a good agreement at higher values of atom-atom distance r, butsome larger differences can be seen at low r. Note that the differencecurve was enlarged by a factor of 50. The individual R values for each The R value is a measure for the agree-

ment between observed and calculateddata. It is defined as

R =

√∑i(Gobs(r) − Gcalc(r))2∑

iG2

obs(r)

(11.2)

section 5 Å wide are shown just below the difference curve. If we nowcarry out individual refinements over those 5 Å wide ranges, we getthe five separate refinements shown in the bottom panel of Fig. 11.4.This time, all the refinements are similar in their agreement, although

0 5 10 15 20Refinement range (Å)

10

15

20

25

Occ

upan

cy (

%)

Fig. 11.5 Occupancy of atom D as a func-tion of refinement range.

the R value for the first region is somewhat higher, which is due to thesmall size of our example domains. Each refinement yielded one occu-pancy parameter shown in Fig. 11.5. As we can see from the figure, allrefinement ranges except the first one produce an occupancy for atomsD of approximately 15% which is in good agreement with the overalloccupancy. The first range corresponding to atom-atom distances of2.5 ≤ r ≤ 7.5 Å shows a much higher occupancy of 28%. Lookingback at Fig. 11.3 this is not a surprise, since atoms D exist in domains.Once distances larger than the domain radius are probed, less and lessintradomain D-D pairs are observed. Note that in our example, thedomain radius is 7.5 Å which is also the boundary of our lowest r re-finement range.

As we have seen in our simple example, r dependent refinement ofthe PDF can yield information about the size and structure of domainsin the material under investigation. This approach might sometimes

Page 191: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

180 Refining disordered structures

be a simple first step compared to the construction of a large modelcontaining domain and host atoms. This r dependent refinement tech-nique was for example recently used to shed light on the local structureof LaMnO3 as a function of temperature [15]. Ultimately, however, onewill want to create a complete model of the disordered structure andsomehow refine the parameters used in the creation of the model. Thiswill be the topic of the next part of this chapter.

11.3 Refining parameters of a disorder model

We will now discuss approaches where parameters that define the dis-ordered structure are refined. In contrast to the RMC method, one hasto have prior idea of the concept that defines the disordered structure.Starting from such an initial model, one can refine the parameters thatdefine this model. The fastest way to obtain a solution for the param-eters is to develop an analytical description that allows us to calculatethe diffuse scattering or the PDF based on model parameters. In thiscase one can apply a standard least-squares refinement to obtain the setof parameters that best describe the disordered structure and in turn itsdiffuse scattering. A number of such theoretical approaches have beendeveloped in the literature. While such an approach allows the fastestrefinement, it requires in turn the careful development of the analyticalexpression. Furthermore, such an approach is valid only for the specificmodel of disorder, like the calculation of a powder pattern from disor-dered stacks of layers. Each type of disorder requires the developmentof its own analytical approach.

In this book we will choose a different approach that is much moreflexible, even if the actual refinement process will be slower than aleast-squares refinement based on an analytical expression. We will usethe tools developed in the previous chapters to simulate the disorderedstructure. The refinement process attempts to find the best solution forthe parameters that are used to simulate the disordered structure. Suchparameters would for example be short-range order parameters for abinary alloy, or the probabilities for a layer type to be stacked on top ofa previous layer sequence. The task of any crystal structure refinementprocess is to find that set of parameters that best describes the observedintensity. The difference between observed intensity and calculated in-tensity is used as a measure of the quality of the fit, usually defined asa weighted residual or R value Rw:

Rw =

√∑i wi(Io(i) − Ic(i))2∑

i wiIo(i)2(11.3)

Here the sums run over all data points, i.e. all points in a powder pat-tern or PDF, or all points in lines or planes in reciprocal space. Keep inmind that these point are not limited to integer hkl values since we aredealing with diffuse scattering. The weights wi assign an appropriatestatistical weight to each data point. Its exact value depends on the data

Page 192: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 181

collection and data treatment procedure but usually wi=1/σi, where σi

is the uncertainty of data point i. Several data sets like X-ray and neu-tron diffraction patterns may be used to calculate a combined R value.This may also include other data like NMR, EXAFS, optical propertiesetc.

P

P

0

1

III

II

I

i

iiiii

Fig. 11.6 Schematic sketch of an evolu-tionary algorithm. Two parameters P0

and P1 are refined in the search for theoptimum solution. Members I, II, and IIIgenerate the new members i, ii, and iiiby modification of the original parame-ter values. The new members ii and iiihave an improved R value, while mem-ber i has a worse R value compared tothe original member I. The next genera-tion will thus comprise of members I, ii,and iii.

Based on an initial guess of the disordered structure, the intensityis calculated and compared to the observed intensity. The parametersare then modified and the intensity is calculated again. The goal mustbe to modify the initial parameters as efficiently as possible until theglobal minimum of the R value is reached. The best strategy for themodification of the parameters depends on the refinement algorithm.If an analytical expression for the calculated intensity exists, one cancalculate all partial derivatives of the R value with respect to the modelparameters. In this case a least squares algorithm is the best choice. Avariety of techniques exist to find the fastest path to the global mini-mum. If no analytical expression for the calculated intensity exists, thederivative of the calculated intensity with respect to the model param-eters has to be calculated numerically. This numerical derivative canthen be used in a general least-squares algorithm to refine the parame-ters. In the case of disordered structures, this numerical calculation ofthe derivatives with respect to all model parameters will be very timeconsuming, since for each parameter, a new structural model must besimulated with a slightly modified parameter and the intensity calcu-lated for this new structure.

A more serious drawback comes up if the structure is simulated withthe use of any randomly chosen defect probability, as will be the casewith essentially every disordered structure. Now, the actual simulatedstructure is one of many possible structures that can result from thesame structural parameter. Accordingly, the calculated intensity willvary from one simulation to another, even if identical parameters areused. Depending on the underlying distribution function and the spe-cific disorder model, two simulations may actually yield two very dif-ferent diffuse intensity distributions. In this case the simulated struc-ture must either be large enough to be considered a true representationof all different possible structures, or the structure must be simulatedrepeatedly and the corresponding calculated intensities be averaged.In both cases, the calculation of all numerical derivatives requires newsimulations for each derivative to be calculated and the computationaleffort is very large. In this situation, optimizations by evolutionary orgenetic algorithms are a good alternative choice as seen in Fig. 11.6.Both algorithms mimic the changes in a plant or animal population ac-cording to Darwinian evolution. Initially a large population is created.Each member of this population represents a parameter set that is usedto describe the problem at hand. In our case such a parameter set maycontain parameters like the lattice constants, atomic positions, thermalparameters, defect probabilities, etc. The actual parameter values willvary from one member to the next. A suitable cost function, for ex-ample the R value of a powder pattern, is calculated for each member.

Page 193: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

182 Refining disordered structures

At this stage a new generation of members is generated by modifyingthe individual parameter values and the cost function is calculated foreach of these children. A general survival of the fittest concept is usedto weed out those parameter sets which lead to bad R values. By re-peating this cycle the parameter values will eventually converge to thebest solution.

Many different algorithms exist that differ in the encoding of the pa-rameter values, in the creation of the next generation of parameter val-ues and finally in the process of weeding out bad solutions. Geneticalgorithms, developed by Holland [16] and Goldberg [17], encode theparameters as bit strings and are well suited for combinatorial prob-lems such as the traveling salesman problem. Evolutionary strategies,introduced by Rechenberg [18] and Schwefel [19], usually encode theparameter values as floating point numbers and thus are better suitedto treat continuous functions. Since disordered crystals are best de-scribed by continuous functions of the typical parameters such as latticeparameters, atom positions, etc., we will focus on evolutionary strate-gies.P

P

0

1

i

I

II ii

i�

ii�

i’

ii’

i

ii

0P P P P P2 3 41

0P P P P P2 3 41

Fig. 11.7 Cross over procedure duringan evolutionary algorithm. Top: par-ents I and II have generated the newmembers i and ii, in a two-dimensionalsection of a five-dimensional parameterspace. The cross-over switches the valuesof parameter 0, while parameter 1 is re-tained as inherited from the parent. Bot-tom: schematic status of members i andii prior to and after the cross-over. Herethe values of parameters 0 and 3 havebeen switched between members i and iito create the final trial parameter sets i’and ii’.

Evolutionary strategies often generate the next generation by addingrandom numbers to each of the parameter values of the correspondingparent parameter set. This change of the parameter value reflects themutation of the genetic information in biological systems. The randomnumber is usually Gaussian distributed with mean zero and a standarddeviation σ that will have a different value for the different parametervalues. In the most simple form σ remains constant throughout therefinement process. Better performance is achieved if the value of σis adapted during the refinement process. A second option is usuallycombined with the initial mutation. In this second step, one or severalof the parameter values are interchanged between two members of thepopulation, a process that resembles sexual replication, and is referredto as recombination or cross-over (Fig. 11.7).

The performance of an evolutionary algorithm depends on a properchoice of the mutation and recombination parameters. If the standarddeviation σ is too small, the algorithm will search the parameter spaceonly in the immediate vicinity of a parent and will take a very long timeto find the global optimum or may even get stuck in a local minimum.A very large value of σ will, on the other hand, prevent fast conver-gence into a minimum, since most trials are far away and thus willlikely be of less quality. Introductions to evolutionary algorithms aregiven in numerous books and papers, for example Bäck [20], Cartwright[21], Kost [22], and Price et al. [23].

Evolutionary algorithms have been applied to a number of crystalstructure related topics. In the applications by Shankland et al. [24],Kariuki et al. [25], Harris et al. [26] [27], Helliwell et al. [28], andAltomare et al. [29] evolutionary algorithms were used to determinecrystal structures from powder diffraction data and to index powderpatterns by Paszkowicz [30]. Landree et al. [31] applied them to deter-mine surface structures. Wormington et al. [32] and Ulyanenkov et al.

Page 194: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 183

[33] used evolutionary algorithms to study thin film structures. Knorret al. [34] used evolution strategies to refined structural fragments likeorientationally disordered molecules on the basis of Bragg reflectiondata. Weber et al. [35] were the first to use evolutionary algorithmsin the study of disordered materials based on diffuse X-ray diffractiondata. Recently evolutionary algorithms have been applied to the refine-ment of nanoparticle structures [36] on the basis of powder diffractionand PDF data.

11.3.1 The program DIFFEVP

B

I

II

D = (D,D)

P2

P1

(D,P)

(P,D)

v

f*v

Fig. 11.8 Schematic diagram of the differ-ential evolutionary algorithm.

For the refinement simulations in this book a differential evolutionaryalgorithm [23] was used. The characteristic feature of this algorithm isthe determination of parameters for the next generation as differencevectors between parameter sets of the current generation. We foundthis to be a robust and fast way to refine models of disordered struc-tures.

The basic differential evolutionary algorithm starts with a popula-tion of M members. Each member represents one possible set of the Nparameters that shall be refined. These parameter sets can be thoughtof as vectors in the N -dimensional parameter space. According to eachparameter set, the cost function, here the R value, is calculated. To de-rive the trial vectors for the next generation, the algorithm takes in turnall members of the population as the current parent vector, denoted aspoint P in the two dimensional parameter space of Fig. 11.8. The al-gorithm then calculates the difference vector v between the parametersets of two other, randomly chosen members, I and II in Fig. 11.8. Thisdifference vector v is multiplied by a user-definable parameter f andadded to a third also randomly chosen member, vector B in Fig. 11.8.The resulting point in parameter space is called the donor vector D. Inthe final step, a so-called cross-over is determined between the param-eter set of the parent vector and the donor vector. By random choice,the algorithm picks the value of each parameter from either the parentor the donor vector. In order to prevent the original parent vector re-produced, one randomly chosen parameter is always chosen from thedonor vector. In the two-dimensional parameter space of Fig. 11.8,three different points may thus turn out to be the parameter set of thechild vector. If both parameters are chosen from the donor vector thisdonor will be the next child vector. If one parameter is taken from theparent and the other from the donor vector, points (D,P) or (P,D) mayresult. In a multidimensional parameter space many different locationsmay end up as trial vector. The cost function is calculated for this newchild and its value compared to that of the parent vector. The vectorwith the lower cost function is in turn chosen as the parent vector forthe next generation.

By determining the donor as the sum of a base vector and the dif-ference between two parent vectors, the differential evolutionary algo-rithm will search a large volume in the parameter space. If the initial

Page 195: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

184 Refining disordered structures

population is widely distributed, the difference vectors between anytwo members will also be large, and the child vector may be located ata very different point in parameter space, even well outside the originalpopulation. This enables the algorithm to jump out of a local minimumand thus enhances the chance of finding the true global minimum. Asthe population converges into the global minimum, the difference vec-tors become shorter, parameter space is searched more finely, and thealgorithm automatically converges.

The basic algorithm has only two control variables, the factor f bywhich the difference vectors is multiplied and the cross-over probabil-ity. The population size in relation to the number of refinable param-eters may be considered as a third control variable. The best valuesfor these variable are those that enable the algorithm to find the solu-tion for a specific problem with a minimum of function calls, here aminimum of structure simulations. The best values very much dependon the actual problem at hand. See Chapters 2 and 3 in Price et. al.[23] for a detailed discussion. In our experience, the factor f should besomewhat smaller than one, to aid convergence. The cross-over prob-ability for most problems should be in the range 0.7 to 1.0, i.e. most ofthe parameters are taken from the donor vector. The population sizeis more difficult to estimate; our experience shows that it should be atleast about ten times the number of refined parameters. At the initialstage of a refinement, a large population size prevents premature con-vergence into a local minimum, since many more different differencevectors are added to the base vector. This helps to jump from one localminimum to another. At a later stage in the refinement, when the popu-lation has converged into the global minimum, a large population doesnot appear to be helpful. Many function calls are required per genera-tion. A smaller population size applies the evolutionary pressure moreoften in relation to the number of function calls and will converge fasterinto this minimum.

A number of variations to this basic algorithm have been proposedin the literature on differential evolution. The first variation concernsthe choice of the donor base vector. Alternative algorithms always pickthe current best member as donor base and add the difference vector tothis base vector. By choosing the current best member as donor base,the algorithm has the chance to converge faster, since the search fo-cuses on the surrounding of the current minimum. If this minimumhappens to be a local minimum, the chance of converging into this lo-cal minimum increases correspondingly. Another variation introducesa third control parameter k in the range [0:1]. The difference vector isthen added to a point along the line between the parent vector and thedonor base vector. The control parameter k determines whether thepoint is at the parent vector, k = 0, or at the donor base vector, k = 1, orat any other point along this line. In the basic algorithm, a child vectoris always compared to its immediate parent vector, and the better ofthe two survives. As an alternative, one can take the combined groupof all parents and all children and keep the better members, regardless

Page 196: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 185

of whether they were parent or child vectors. In this case, one can alsocreate more than one child per parent vector. This enhances the speedwith which the algorithm converges into the minimum, yet increasesthe chance of refining into a local minimum.

Finally, one can mix the concept of the differential evolution withstandard evolutionary algorithms. In this case some of the childrenare generated just by a (Gaussian) distribution around the individualparent vector. If the current trial vectors are widely distributed, mostdifference vectors will search at a different section of parameter spacerather than close to the respective parent. This search is the strengthof the differential evolutionary algorithm, since it allows the algorithmto move easily from one local minimum to a global minimum. On theother hand, a local search allows us to refine faster within the imme-diate surrounding of a minimum. As with any refinement algorithm,parameter constraints can easily be taken into account.

A refinement process should terminate, once the global minimumhas been reached. Unfortunately, for real world problems there is usu-ally no way of knowing when the true global minimum has been reached.Several different termination criteria have been reported for evolution-ary algorithms [23].

• Objective function has been metThis termination criterion can be applied if the global minimumis known. In this case the refinement can stop once the calculatedcost function falls within a defined threshold close to the value ofthe global minimum.

• Maximum number of refinement cycles or computing timeThis criterion may be used to stop a refinement that does not im-prove for a given number of generations. It may also be applied tofind good values for the scale factor f , the cross-over probabilityor the population size. The refinement is run with fixed numberof cycles, respectively time, for different values of the control vari-ables. The goal is to find values that quickly improve the R value.These values can then be used for an extensive refinement or beused as guidelines for further refinements.

• Population statisticsIf the input data consist of diffraction data only, it is straightfor-ward to calculate an expected R value. The refinement could thenbe stopped, once the actual R value is close to the expected Rvalue. Such an R expected is more difficult to determine withgood justification if several different functions are optimizes si-multaneously. This could be the case if the standard R value is tobe combined with chemical information such as the relative pro-portion of different atoms, or bond valence aspects. Other criteriarelated to population statistics are to stop the refinement once thespread of the R values throughout the population falls below apredefined value, or if the spread of the refined parameters be-comes less than such a predefined value. One has to be awarethat these last two criteria do not necessarily mean that the true

Page 197: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

186 Refining disordered structures

global minimum has been found. The parameter values may havetemporarily clustered and unfortunately it is impossible to knowwhether they will improve after a few more generations.

• Monitoring by the operatorThe refinement of disordered structures still takes quite a bit ofcomputing time. This allows the user to follow the refinementand to manually compare the R value, the population statistics,the improvement of the fit, etc. This monitoring also allows youto add new parameters once the refinement has reached a givenquality. The examples in this book use this criterion. The refine-ments were interrupted manually once the quality of the fit wassufficient and the parameter spread did not change for many gen-erations.

In a least-squares algorithm, the partial derivatives of the objective func-tion with respect to the refined parameters allow one to calculate indi-vidual uncertainties for each parameter and to determine correlationsbetween the parameters. These values are not as clearly defined forevolutionary algorithms. As measure for the uncertainties a plot of theR value versus the parameter value gives an indication as to the spreadof a parameter that gives sufficiently similar R values. Figures 11.11dand e provide examples later in this chapter. Short of a full statisticalanalysis, a scatter plot of the population (Fig. 11.11f) gives a good in-dication of correlations between two parameters. Each member of thepopulation is shown as a dot in a two-dimensional plot. The abscissaand ordinate are the respective parameter values of this member. If theparameters are correlated, the dots will fall onto a line, although notnecessarily a straight line.

The DIFFEV program accompanies the DISCUS program and uses thesame command language. In our usual setup, DIFFEV sets up the searchparameters, which are transferred to DISCUS, which simulates the dif-fuse scattering or PDF. Once the R values have been calculated for allsimulated structures, DIFFEV compares these new R values to those ofthe previous generation, determines the surviving members and gen-erates new trial parameters. Another option is the simultaneous refine-ment of several data sets. DIFFEV expects for each child the value ofthe cost function. It does not put any restriction on the computation ofthis cost function. Thus, you could for example simulate a disorderedstructure and calculate an X-ray or neutron diffraction pattern, an EX-AFS spectrum etc. Since DIFFEV passes the structure simulation on toan external program, in our case DISCUS, other programs like EXAFSprograms may also be involved. The individual cost functions for eachdata set have to be combined to a single overall cost function.

11.3.2 Required size of the simulated structure

In this section we will discuss the influence of the size of the simulatedstructure on the R value. The size can either be understood as the size ofone simulated crystal or the combined size of several simulated crystals

Page 198: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 187

whose intensity is averaged. No absolute rule can be given that fitsall simulations, but the considerations in this section shall serve as aguideline.

Every simulated structure in which at least part of the structure is cre-ated by a some kind of random distribution is always one of the manydifferent configurations. Except for trivially small crystals, it is beyondthe present computing power to calculate every possible configuration,and even if this were possible, it would not really do us any good. Af-ter all, the actual structure of a real sample at hand is never completelyknown. The crystals in the sample may be subject to a distribution overall possible configurations with unknown distribution function. Ad-ditionally, the disorder parameters may be subject to spatial variationthroughout a single crystal or be subject to a distribution between dif-ferent crystals in a polycrystalline sample. Thus we have to assess thelikelihood that the model structure is a good representation of the ac-tual structure. In order to do so, we need to determine how much theintensity varies from one simulation to another. Only if any two simu-lations, either as individual simulations or as average of an ensemble,do not deviate significantly from one another, can the correspondingparameters that were used to simulate the structure be considered sig-nificant. A measure to estimate the required number of simulations isto calculate in a first step a fairly large number of simulations. The re-sults of all these simulations are then averaged and this averaged dataset serves as the data set of the statistical tests that follow. Randomlychosen subsets of simulated data sets are drawn from the total num-ber, averaged, and the R values between these subsets and the full dataset are calculated. The process should be allowed to choose a partic-ular data set more than once. By drawing a large number, if feasibleall subsets, one obtains an estimate of the expected spread of R valuesand the average R value. As the number of simulated data sets in thesubset, is increased, the average R value and its spread decreases. Atfirst, the average R value and its spread, will decrease rapidly and thenlevel off and decrease much more slowly. The average value shouldreach this saturation at a subset size that is considerably smaller thanthe total number of data sets. For the given simulation, you should con-sequently average a number of simulations that is a slightly larger thanthis saturation value. Any further increase will mostly cost computa-tional time and offer limited increase in reliability.

0 10 20 30 40 50 60 70 80 90

Subset size

15

10

5

0

R–v

alue

(%

)

Fig. 11.9 Estimation of required popula-tion size. The illustration show the dis-tribution of R values for subsets of sizeN = 1 to N = 100. The dots at each sub-set size correspond to independent calcu-lations. The continuous lines connect theworst and best R values of each subsetsize.

Figure 11.9 illustrates this approach for the ZnSe nanoparticles usedin Section 9.2 and in the refinement example in the following section.The powder patterns were simulated for ellipsoidal nanoparticles of 40Å diameter along the c-axis, which corresponds to 12 layers. The stack-ing fault probability was set to 0.65 and 5 000 individual particle pow-der pattern were generated. All of these powder pattern were averagedto give the data for the statistical analysis. A number N of individualpowder pattern were drawn at random and averaged to one sampledata set. The R value between the average data of all 5 000 powderpattern and this sample data set was calculated. For each number N ,

Page 199: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

188 Refining disordered structures

this process was repeated 20 times. Figure 11.9 shows the calculated Rvalues for subset sizes N = 1, 5, 10, . . . , 100. For N = 1, i.e. the R valuebetween a single individual powder pattern and the average of all 5 000powder patterns, the R values scatter from 2.5 to 20%. With increas-ing subset size this spread drops and levels off for subset sizes aroundN = 20–30. A further increase of N does not improve the spread signif-icantly, except of course for N almost equal to 5 000! For the refinementin the following section N was chosen to be 25.

11.3.3 Example: Simple disordered structure0 0.5 1 1.5 2 2.5 3 3.50

0.5

1

1.5

2

2.5

3

3.5

[H 0 0]

[0 0

L]

2×10

44×

104

6×10

48×

104

105

Inte

nsity

Fig. 11.10 Data set for the first example.

In this first refinement example, the short-range order parameters ofa two-dimensional structure are determined via the differential evolu-tion algorithm. The input diffraction pattern in Fig. 11.10 shows broaddiffuse maxima at positions h +0.5, k + 0.5, where h,k are integer num-bers. Additionally a weaker diffuse background exists that increases inintensity with |h|. Only one quarter of reciprocal space is reproduced;we will assume that the other quarters are symmetrical with an overallsymmetry in space group Pm3m. The Bragg reflections have been sub-tracted from the diffraction pattern. The diffraction pattern is based ona simulated structure and thus is free of experimental errors.File: refine/ref.ex0.diffev.mac

1 set prompt,redirect2 set error,exit3 #4 variable integer,status5 #6 status = -17 fopen 1,CONTINUE8 fformat 1, i49 fput 1,status

10 fclose 111 #12 @ref.ex0.diffev.setup13 #14 init15 #16 do while(status.eq.-1)17 sys discus < ref.ex0.dis.diffev.mac18 sys kuplot < ref.ex0.kup.diffev.mac19 sys kuplot < ref.ex0.kup.select.mac20 compare21 fopen 1, CONTINUE22 fget 1,status23 fclose 124 enddo25 exit

Although the input structure is known, the refinement starts with-out any information beyond what can be directly determined from thediffraction pattern, i.e. mainly the average structure. The structurefrom which this diffraction pattern was generated consists of a prim-itive structure with Fe and C at position 0, 0, 0 and Fe:C=3:1. The av-erage isotropic atomic displacement parameter is U = 0.0006 Å. Theintensity of the diffuse maxima is basically independent of hk, exceptfor an overall increase with increasing |h|. The position of the maximais right at h = 0.5, k = 0.5. This indicates that the main reason for thediffuse scattering is chemical short-range order probably with preferredopposite neighbors along [100] and [010] and identical neighbors along[110], respectively [110]. Additionally independent thermal disordermay be present. Since the diffuse maxima are of simple shape, and theoverall symmetry is cubic, we will start with a simple model that refineschemical short range order parameters along these two directions. Asa first start, the isotropic atomic displacement parameter is taken fromthe average structure. Thus, two parameters are to be refined, a SROparameter along [100]/[010] and a second along [110]/[110]. The mainrefinement macro is given in the margin. It starts in lines 4 through 10with the definition of a status variable, which will later on be used toterminate the refinement. In line 12, the refinement parameters and thecontrol parameters are defined in a separate macro. After initializingthe refinement process in line 14, the main refinement loop follows inlines 16 through 24. This loop continues until the value of the statusvariable, read from file CONTINUE, is no longer equal to −1. This al-lows the user to manually terminate the refinement process. Within themain refinement loop, DIFFEV starts DISCUS, which simulates the dis-

Page 200: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 189

ordered structure and KUPLOT, which calculates the corresponding Rvalue. The second KUPLOT statement is used to archive the calculatedintensities that represent the current best solution. This step is entirelyoptional, since the best parameter values are archived separately byDIFFEV. These archived parameter values may always be used to cal-culate the final diffraction pattern once the fit is finished. If the currentbest results are archived, it is just more convenient to compare the fitstatus, since the current best calculated diffraction pattern are alwaysavailable for display. File: refine/ref.ex0.diffev.setup.mac

1 pop_gen[1] = 02 #3 pop_n[1] = 204 pop_c[1] = 205 pop_dimx[1] = 26 #7 # order parameter [100]8 #9 pop_name 1,a100

10 type real,111 pop_xmin[1] = -1.00012 pop_xmax[1] = 1.00013 pop_smin[1] = -1.0000014 pop_smax[1] = 1.0000015 pop_sig[1] = 0.10016 pop_lsig[1] = 0.010017 adapt sigma, 1,0.218 adapt lsig , 1,0.0219 #20 # order parameter [110]21 #22 pop_name 2,a11023 type real,224 pop_xmin[2] = -1.00025 pop_xmax[2] = 1.00026 pop_smin[2] = -1.0000027 pop_smax[2] = 1.0000028 pop_sig[2] = 0.10029 pop_lsig[2] = 0.010030 adapt sigma, 2,0.231 adapt lsig , 2,0.0232 #33 diff_cr[1] = 0.934 diff_f[1] = 0.8135 diff_lo[1] = 0.236 diff_k[1] = 1.037 #38 refine none39 refine 1,240 #41 donor random42 #selection compare43 selection best,all44 #45 trialfile DIFFEV/Trials46 restrial DIFFEV/Results47 logfile DIFFEV/Parameter48 summary DIFFEV/Summary49 #

The setup in macro diffev_setup.mac starts by setting the current gen-eration number pop_gen[1] to zero. Next the number of parametersets that constitute one generation, pop_n[1] and the number of newparameter sets to be tried within each new generation, pop_c[1] areboth set to 20. Thus each generation has 20 members surviving into thenext generation, after 20 new children have been tested. The number ofchildren may be larger than that of the members; this will increase theevolutionary pressure, since many children are tried but fewer mem-bers survive. This will in general speed up the convergence into a min-imum, but increase the chance of refining into a local minimum. Thedimension of the current problem, pop_dimx[1] is two, since we wantto refine two parameters, the correlation along 〈100〉 and the correlationalong 〈110〉.

For both of these parameters appropriate names and data types aredefined (lines 9–10 and 22–23). Next, the starting value and hard bound-ary conditions are defined. The hard boundary limits are set to the in-terval [−1 : 1] for both order parameters (lines 11–12 and 24–25). Thestarting range for both parameters is also set to the interval [−1 : 1](lines 13–14 and 26–27). The parameter values in the initial generationare generated as random values evenly distributed within this startinginterval. Unless one has a good estimate for the expected parametervalue, the starting range should be as large as the hard boundary inter-val. This prevents the refinement algorithm being limited to a subjec-tive guess, which may turn out to be wrong. In the current example,the position of the diffuse maxima indicates that the order parameteralong 〈100〉 should be negative and the order parameter along 〈110〉 bepositive. Here, we will not limit ourselves, to show that the process willconverge quickly nevertheless.

The next set of control variables is used to deal with boundary is-sues and for the local search. Since differential evolution adds the dif-ference vector to a donor, chances are that the trial vector lies outsideone or more boundary conditions. DIFFEV then sets the parameter thatis outside the boundary condition to a Gaussian distributed randomvalue with mean at the boundary point. Of course, only that half ofthe Gaussian distribution is chosen that generates points inside the al-lowed parameter range. Variable pop_sig contains the starting widthof this Gaussian distribution. Optionally, this width can be adjusted asthe refinement proceeds. In line 17, the value is defined as a fraction 0.2of the whole parameter spread of the first refinement parameter. This

Page 201: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

190 Refining disordered structures

adjustment is especially necessary if the minimum is close to or at thehard boundary. Those trial vectors that do not participate in the differ-ential evolution, but are varied locally only, are modified by a Gaussiandistributed random value centered at the parent trial vector. The lo-cal width is started as an absolute value of 0.02 and then adjusted to afraction of 0.02 of the parameter spread in each new generation.

In lines 33 through 36 the main control parameters for the differen-tial evolution are defined. The length of the difference vector is scaledby the factor diff_f to 0.81 of its original length. The best choice ofthis fraction depends on the refinement problem at hand, see Price et al.[23] for a detailed discussion on this and the other control parameters.A value around 0.8 seems to work fine for the refinement of disorderedstructured. The cross-over probability defines how likely a parametervalue is taken from the donor rather than the parent vector. A highcross over probability works better for disordered structures. As vari-ation of the original differential evolution, the scaled difference vec-tor can be added to any point along a line between the parent vector,diff_k = 0, and the donor base vector, diff_k = 1. This last valuecorresponds to the original algorithm. Finally, diff_lo defines theprobability for a given parent vector to be modified by a Gaussian dis-tribution centered around the parent vector instead of the differentialevolution. This probability should be low, especially if the dependencyof the R value on the parameter value is a smooth distribution. If, onthe other hand, the R value has many narrow minima, a high proba-bility helps to refine within such a minimum, while hoping that thisis the global minimum and not a local minimum. In the original algo-rithm, the donor base is a randomly chosen member of the population(line 41). Alternatively, taking the currently best member as fixed donorbase has been proposed.

The selection of the parameter sets that survive into the next gener-ation has to be chosen carefully. The original algorithm always com-pares only the parent vector and the immediate child vector. The betterof these two survives, even if other members or other children existwith even better R values. This is a robust choice, that avoids prema-ture convergence into a local minimum. Alternatively one can combineall members and all children into one group. In this case only the bestpop_n parameter sets of this combined group survive, irrespective oftheir status as parent of children. This will enhance the convergencespeed.File: refine/Trials.0001

1 # generation members children parameters2 361 20 20 23 # current member4 15 # parameter list6 -0.9746144414E+007 0.2930167019E+00

Finally four file names are defined. All files are stored in a directoryDIFFEV. The trial files are going to be called Trials.xxxx, where xxxx isa four digit number with leading zeros. This number refers to the indi-vidual members of the population. DIFFEV generates a new version ofthese files at each refinement cycle and always adds a four digit end-ing to the file name. The file header lists the current generation, thenumber of members, children, parameters, and the current child num-ber, which is always identical to the file number xxxx. At the end, a listof all current trial parameter values follows. The next definition sets

Page 202: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 191

the file name Results.xxxx that shall contain the cost function values foreach child. This file is to be generated by the program that evaluatesthe cost function and contains just the number of the child and the costfunction value in a single line. The two files Parameters and Summarycontain a full listing and a summary of the cost function, and the refinedparameters and are updated by DIFFEV after each refinement cycle. Inaddition to these files, DIFFEV generates a file with fixed file name GEN-ERATION located in the current directory. Its header lists the current File: refine/GENERATION.dat

1 # generation members children parameters2 361 20 20 23 # trial file4 DIFFEV/Trials5 # result file6 DIFFEV/Resultats7 # log file8 DIFFEV/Parameter9 # summary file

10 DIFFEV/Summary

generation number, number of members, children, and parameters justlike the individual trial files. With the exception of the GENERATIONfile, the file names and use of subdirectories is entirely up to individualtaste and do not affect the simulation. Here, we sorted the input andoutput data into the following directories listed in Table 11.1.

File: refine/ref.ex0.dis.diffev.mac1 set prompt,redirect2 set error,exit3 #4 variable integer,generation5 variable integer,member6 variable integer,children7 variable integer,parameters8 variable integer,kid9 variable integer,indiv

10 #11 fopen 1,GENERATION12 fget 1,generation,member,children,parameters13 fclose 114 #15 do kid =1,children16 @ref.ex0.discus.main17 enddo18 #19 exit

The actual refinement uses the DISCUS macro ref.ex0.dis.diffev.mac tocreate our disordered structure. This macro is a short, very generic filethat we use in a number of different refinements. This macro just readsthe current generation number, the number of members, children, andparameters. It then runs a loop over all children, where the actual sim-ulation takes place in macro ref.ex0.discus.main.mac. The advantage ofthis split is simply that the same main file may be used for a numberof different refinement by just replacing the main simulation macro.Another advantage is more subtle. In this simulation, the main refine-ment program DIFFEV starts DISCUS, which in turn runs a serial loopover all children. This serial step may, of course, be run in parallelon several computers. In this case, DIFFEV should call the appropri-ate distribution program, which in turn starts parallel runs of DISCUSon all computers in your cluster. The actual implementations of par- File: refine/JOB.dat

1 #!/bin/csh2 #3 cd /home/neder/refine/example04 /usr/local/bin/discus << EOF > /dev/null5 set prompt,redirect6 @ref.ex0.dis.diffev $17 EOF

allel processing are too dependent on the actual configuration of yourcluster to be detailed here. In our implementations, DIFFEV starts a dis-tributor program based on MPICH. The master program starts copies

http://www-unix.mcs.anl.gov/mpi/mpich

of itself on the slave computers, which in turn each executes a UNIXshell script JOB, with one parameter, which is the current child num-

Table 11.1 List of Directories used by DIFFEV.

Directory Contents

DIFFEV Trial and result files.CELL Input unit cell.CALC Calculated diffuse intensities. Temporary files

created in each generation for the current trialparameters.

DATA Experimental data.FINAL Calculated diffuse intensities. Best solutions

at current generation.

Page 203: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

192 Refining disordered structures

ber. This shell script switches to the current directory (line 3) and exe-cutes DISCUS (line 4). Input is read until the end of file marker EOFFile: refine/ref.ex0.discus.main.mac

1 variable integer,dimen2 dimen = 503 #4 # Read the parameters from DIFFEV/Trials5 #6 fopen 2,"DIFFEV/Trials.%4D",kid7 fget 28 fget 29 fget 2

10 fget 211 fget 212 do i[3] = 1,parameters13 fget 2,r[200+i[3]]14 enddo15 fclose 216 #17 read18 cell CELL/fec.cell, dimen,dimen,119 #20 replace fe,c,all,0.2521 therm22 #23 @ref.ex0.sort.mac r[201],r[202]24 @ref.ex0.fourier kid

File: refine/ref.ex0.sort.mac1 #2 mmc3 rese4 set neig, rese5 set vec, 1, 1,1, 1, 0, 06 set vec, 2, 1,1, -1, 0, 07 set vec, 3, 1,1, 0, 1, 08 set vec, 4, 1,1, 0,-1, 09 set vec, 5, 1,1, 1, 1, 0

10 set vec, 6, 1,1, -1,-1, 011 set vec, 7, 1,1, 1,-1, 012 set vec, 8, 1,1, -1, 1, 013 #14 set neig, vec, 1, 2, 3, 415 set neig, add16 set neig, vec, 5, 6, 7, 817 #18 set mode, 1.0, swchem,local19 #20 set target,1,corr,fe,c , $1 ,-1.*$1,CORR21 set target,2,corr,fe,c , $2 , 1.*$1,CORR22 #23 set temp, 1.024 set cycl, n[1]*10025 set feed, n[1]* 1026 show27 run28 exit29 #

File: refine/ref.ex0.fourier.mac1 fourier2 neut3 ll 0.0, 0.0,0.04 lr 4.0, 0.0,0.05 ul 0.0, 4.0,0.06 na 2017 no 2018 abs h9 ord k

10 temp ign11 disp off12 lots box, 10,10,1,10,yes13 set aver, 10.14 show15 run16 exit17 output18 outfile "CALC/calc.%4D",$119 value inte20 form stan21 run22 exit

is encountered, while all output is written into a non-existing device/dev/null or alternatively to an appropriate log file. The DISCUS macroref.ex0.discus.main.mac is executed and one parameter handed down,which is again the child number. All that you have to change in themacro ref.ex0.dis.diffev.mac is the loop, which should then be replacedby a single call to ref.ex0.discus.main.mac, once the child variable kid hasbeen set to the current number, i.e. the value of $1.

The main simulation in this example first has to read the actual pa-rameter values from the trial file (lines 6–15). Here, only two param-eters are read, the short-range order correlations along the 〈100〉 andthe 〈110〉 directions, and stored in variable r[201] and r[202]. Themacro continues to read the asymmetric unit and to expand this to asuitable size. The crystal size is a parameter that is not immediatelyconnected to the refinement but rather depends on the actual disorderproblem. In this current simulation, a larger crystal will ensure bet-ter averaging of the short-range order and thus allow us to calculatesmoother diffuse scattering but the crystal size will directly increasethe computation time required.

As pointed out in the beginning of this section, the structure is com-posed of two atoms, Fe and C. The diffuse scattering indicates a short-range order problem and thus we replace the initial Fe atoms by an ap-propriate number of C atoms. For a refinement of an actual unknowndisorder problem, the information from the average structure refine-ment will have given you an isotropic atomic displacement parame-ter. Since the diffuse scattering background in Fig. 11.10 increases with|h|, we randomly displace all atoms according to the atomic displace-ment parameter (line 21). The sorting process assumes short-range or-der correlations along the 〈100〉 and 〈110〉 directions. This is the easiestassumption that may be appropriate for the diffuse scattering in Fig.11.10. More complex disorder may be tried if this simple model shouldprove insufficient. For details of the sorting process, refer to Chapter5. The number of cycles (line 24) should be high enough to achieve thedesired correlations. This, in combination with the crystal dimension,will affect the refinement time, but should otherwise not influence theresult.

Contrary to the sorting process, the calculation of the Fourier trans-form in this example will have a direct influence on the goodness of fitthat we can expect. The size and grid in reciprocal space has, of course,to match the experimental data. Computational time will be gained ifthe experimental data are modified to a coarser grid and a smaller sec-tion of reciprocal space. Whether this will affect the results dependson the disorder problem. The Fourier mode must match the experi-mental conditions as well. Here, lots are appropriate but we are freeto adjust the lot size and number of lots, as long as the size is largerthan the longest correlation. By choosing few, small lots, we speed upthe calculation considerably, yet the calculated diffuse scattering will

Page 204: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 193

show more noise, since these few lots are not necessarily a true rep-resentation of the short-range order parameter. Accordingly, we haveto expect that the uncertainty of the refined short-range order parame-ters will be higher compared to a simulation with many and larger lots.Note, that the Fourier calculation is carried out with the switch of thetherm command set to ignore. The effect of the atomic displacementparameter is not calculated analytically, since the atoms were movedby the therm command in the main macro as discussed in Chapter 4.The calculation of the R values is undertaken by the plotting programKUPLOT, which is part of the DISCUS distribution. File: refine/ref.ex0.kup.diffev.mac

1 set prompt,redirect2 set error,exit3 #4 rese5 #6 #7 variable integer,generation8 variable integer,member9 variable integer,children

10 variable integer,params11 variable integer,kid12 #13 fclose all14 #15 fopen 1,GENERATION16 fget 1,generation,member,children,params17 fclose 118 #19 #20 do kid=1,children21 rese22 load ni, DATA/experimental.inte23 load ni, "CALC/calc.%4D",kid24 match all,1,225 rval 1,2,ONE26 fopen 1, "DIFFEV/Results.%4D",kid27 fformat 1,i528 fformat 2,f15.929 fput 1,kid,res[2]30 fclose all31 enddo32 exit

Basically any program that can compare two data sets is suited forthis task. The macro loops over all children (lines 20–31) and each timeloads the experimental (line 22) and calculated data (line 23). The lat-ter are scaled and a constant background is added by the match com-

0.3 0.35 0.4

22.5

23

23.5

22.5

23

23.5

R–v

alue

(%

)

R–v

alue

(%

)

0 10 20 30 40 50 60 70 80 90 –1 –0.8 –0.6 –0.4 –0.2Generation

0 10 20 30 40 50 60 70 80 90Generation

0 10 20 30 40 50 60 70 80 90Generation

0

0.02

0.4

–1 –0.8 –0.6 –0.4

c <10

0>

(f)(e)

–1

–0.5

0

0.5

1

–1

–0.5

0

0.5

1

25

30

35

40

R–v

alue

(%

)

(a) (b)

(c) (d)

c <11

0>

c <11

0>

c<100>

c<100>c<110>

Fig. 11.11 (a) Change of R values as a function of refinement generation. (b) Change ofthe correlation c〈100〉 and (c) c〈110〉 . The figure shows the best, average, and worst valueat each generation. (d) Correlation between c〈100〉 short-range order parameter and Rvalue. The current best value is shown as the large dot; the light dots at the bottom of thefigure show the trial values for the next generation. (f) Same for c〈110〉 . (f) Correlationbetween the two short-range order parameters.

Page 205: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

194 Refining disordered structures

mand (line 24). Once the R value has been calculated (line 25) this valueis written to a file called DIFFEV/Results.xxxx, where xxxx is the childnumber. The original calculation of the diffuse scattering by DISCUSdid not include any experimental background and the intensity scaledepends on the lot or crystal size. Since the experimental data in Fig.11.10 were calculated in the same manner, a pure scale factor is suffi-cient in this example. In an actual example, a careful background cal-culation will usually be necessary as well.

Figure 11.11a shows the progress of the refinement. Within the firstfew generations, the R values of the population decrease considerably.After generation 100 the refinement does not improve much more un-der the current conditions. As reflected by the improved R values, theshort-range order parameters converge to the correct solution as wellas can be seen in Fig. 11.11b and Fig. 11.11c. Although inspection ofthe experimental data suggested negative correlation along the 〈100〉directions and positive correlations along 〈110〉, the initial starting val-ues were chosen from the full interval [-1:1]. The short-range order pa-rameters quickly converge to the correct sign and magnitude. Beyondgeneration 100, the range of the two parameters does not converge anyfurther.

00

0.5

1

1.5

2

2.5

3

3.5

0.5 1 1.5 2 2.5 3 3.5[H 0 0]

[0 0

L]

200

400

600

800

1000

Inte

nsit

y

Fig. 11.12 Final calculated diffraction pat-tern.

The reason for this apparent lack of convergence is more obvious,if we also have a look at the best solution, Fig. 11.12 and the Fouriersettings as well. The diffuse maxima in the calculated diffraction pat-tern are much coarser and the noise level is much higher that in theexperimental diffraction pattern. To speed up the calculation, the lotsin macro ref.ex0.fourier.mac were chosen very small (10 by 10 unit cells)and the intensity was calculated from just 10 lots. These two numbersare somewhat too small for the current refinement problem. Such a lotcontains just 100 atoms and any individual lot will not be a very goodsample close to the average structure. The individual atomic displace-ments as well as the short-range order vary considerably from lot to lot.If we increase the lot size, the number of lots, and possibly the crystaldimensions, the convergence improves considerably.

The last three figures in this section show the correlations betweenthe individual parameter values. Figures 11.11d and e show the R valueas a function of the currently best parameter values. There is no largedifference between the best and worst R value, despite the fairly largeparameter range. This holds especially for the 〈100〉 correlation. Withlarger lot size and number, this situation improves considerably. Theseillustrations, however, allow you to estimate the current parameter un-certainties. Finally, it is important to check for correlations betweenthe parameters. In this example, we have to deal with two parametersonly, thus a full statistical cluster analysis is not necessary. Figure 11.11fshows the distribution of the two parameter values. The independentspread of the two parameters shows that no correlation between thetwo parameter values is present, which would otherwise be reflectedby the parameter values more or less aligned along a line.

Page 206: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 195

11.3.4 Example: ZnSe Nanoparticles

The simulation of ZnSe nanoparticles has been described in Chapter 9. File: refine/ref.znse.diffev-1.setup.mac1 #2 pop_gen[1] = 03 #4 pop_n[1] = 705 pop_c[1] = 706 pop_dimx[1] = 137 #8 # lattice constant a9 #

10 pop_name 1,lata11 pop_xmin[1] = 3.90012 pop_xmax[1] = 4.02013 pop_smin[1] = 3.9750014 pop_smax[1] = 3.9800015 pop_sig[1] = 0.00116 pop_lsig[1] = 0.000117 type real,118 adapt sigma, 1,0.219 adapt lsig , 1,0.0220 #21 # Structural parameter omitted22 #23 # Scale factor for Background fit24 #25 pop_name 8,ba_scale26 pop_xmin[8] = 0.00027 pop_xmax[8] = 1000.00028 pop_smin[8] = 7.0E-329 pop_smax[8] = 7.0E-330 pop_sig[8] = 0.031 pop_lsig[8] = 0.032 type real ,833 adapt sigma, 8,no34 adapt lsig , 8,no35 #36 # constant Background37 #38 pop_name 9,ba_const39 pop_xmin[9] = 0.00040 pop_xmax[9] = 2000.00041 pop_smin[9] = 200.0000042 pop_smax[9] = 400.0043 pop_sig[9] = 0.044 pop_lsig[9] = 0.045 type real ,946 adapt sigma, 9,no47 adapt lsig , 9,no48 #49 # linear Background50 #51 pop_name 10,ba_linear52 pop_xmin[10] =-9999.00053 pop_xmax[10] = 9999.00054 pop_smin[10] = -10.000055 pop_smax[10] = 10.000056 pop_sig[10] = 0.057 pop_lsig[10] = 0.058 type real ,1059 adapt sigma, 10,no60 adapt lsig , 10,no61 #62 # square background63 #64 pop_name 11,ba_square65 pop_xmin[11] =-9999.00066 pop_xmax[11] = 9999.00067 pop_smin[11] = 0.0000068 pop_smax[11] = 0.2000069 pop_sig[11] = 0.070 pop_lsig[11] = 0.071 type real ,1172 adapt sigma, 11,no73 adapt lsig , 11,no74 #75 # cubed background76 #77 pop_name 12,ba_cube78 pop_xmin[12] =-9999.00079 pop_xmax[12] = 9999.00080 pop_smin[12] = 0.00081 pop_smax[12] = 0.01082 pop_sig[12] = 0.083 pop_lsig[12] = 0.084 type real ,1285 adapt sigma, 12,no86 adapt lsig , 12,no

Here, we will describe the refinement process , especially the possibilityto mix the refinement of some structural parameters via an evolution-ary algorithm with a least-squares fit for other parameters. Wheneverthis is possible, one should do so, since a least-squares fit is faster byorders of magnitude compared to an evolutionary algorithm.

In Section 9.2 the main emphasis had been on the simulation of thenanoparticle PDF. Here, we will focus on the refinement of the pow-der diffraction data, since these easily allow us to illustrate the mixedrefinement. The powder pattern in Section 9.2 was described by twoparts, the powder pattern calculated via the Debye equation and a back-ground function. Since the nanoparticles were simulated with ran-domly placed stacking faults, several calculated powder patterns hadto be averaged in order to obtain a powder pattern that is a good rep-resentation of the stacking fault parameter, see Fig. 9.17. By averagingthe powder pattern of several nanoparticles that had each been simu-lated using random number generators to create the stacking faults, theanalytical derivative of the intensity with respect to the stacking faultparameter is lost. For this reason, we use an evolutionary algorithm torefine the structural parameters. All those structural parameters thatare used to simulate the particles will have to be refined via the evolu-tionary algorithm. In the case of the ZnSe nanoparticle powder patternthese seven parameters are: lattice constants, position parameter of Zn,an overall isotropic atomic displacement parameter, the stacking faultprobability, the size in the ab-plane and the size along the c-axis. Asnon-structural parameters we shall refine an overall scale factor, and abackground that is described as third order polynomial:

Iback =

3∑j=0

pj(2Θ − 2Θmin)j (11.4)

where Θmin is the minimum 2Θ value of the experimental data set.Thus the total calculated intensity is:

Icalc = s × IDebye + Iback (11.5)

where s is the refined scale factor and IDebye is the intensity calculatedvia the Debye equation.

The main refinement macro is identical to the macro ref.ex0.diffev.macused for the refinement in the previous example. Most parts of therefinement setup in ref.znse.diffev.setup.mac are also very similar. Notethat this macro was split for inclusion in the manuscript. The completefile, however, can be found on the CD-ROM (see Appendix A.1). Sincewe have to refine seven structural parameters, the population size isset to 70 (lines 4–5). A population size of ten times the number of re-fined parameters should be considered the minimum population size.Although only seven parameters are refined via the differential evo-lutionary algorithm, 13 parameters are defined (line 6). Parameter 8

Page 207: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

196 Refining disordered structures

is the scale factor and parameters 9 through 13 are the background pa-rameters. Here, a third-order background polynomial is sufficient, thus

87 # parameter 13 omitted!88 diff_cr[1] = 0.989 diff_f[1] = 0.8190 diff_lo[1] = 0.291 diff_k[1] = 1.092 #93 refine none94 refine 1,2,3,4,5,6,795 #96 donor random97 selection compare98 #99 trialfile DIFFEV/Trials

100 restrial DIFFEV/Results101 logfile DIFFEV/Parameter102 summary DIFFEV/Summary

File: refine/ref.znse.kup.diffev-1.mac1 variable integer,generation2 variable integer,member3 variable integer,children4 variable integer,parameters5 variable integer,kid6 variable integer,nindiv7 variable integer, indiv8 nindiv = 259 #

10 fopen 1,GENERATION11 fget 1,generation,member,children,params12 fclose 113 #14 do kid=1,children15 fopen 2,"DIFFEV/Trials.%4D",kid16 fget 2,generation,member,children,params17 fget 2,i[1]18 fget 219 do i[3] = 1,parameters20 fget 2,r[200+i[3]]21 enddo22 fclose 223 sys "cp INDI/indi.%4D.000124 .. CALC/calc.%4D",kid,kid25 do indiv=2,nindiv26 rese27 load xy,"CALC/calc.%4D",kid28 load xy,"INDI/indi.%4D.%4D",kid,indiv29 kcal add,1,230 ksav 331 outf "CALC/calc.%4D",kid32 run33 enddo34 rese35 load xy,"CALC/calc.%4D",kid36 ccal mul,wy,1,1./nindiv37 ksav 138 outf "CALC/calc.%4D",kid39 run40 #41 load xy, DATA/null.tth42 spline 1,243 skal xmin[2],xmax[2]44 ksav 345 outfile "TEMP/calc.%4D",kid46 run47 #48 rese49 load xy, DATA/znse-mn.limited50 load xy,"TEMP/calc.%4D",kid51 #52 fit 153 func ba,2,554 para 1,1,r[208]55 para 2,1,r[209]56 para 3,1,r[210]57 para 4,1,r[211]58 para 5,1,r[212]59 urf 1060 cycle 10061 run62 show63 exit64

parameter 13 is unused. It could be used in a later refinement step tochange the background or to refine the 2Θ zero point as well.

As example for the structural parameters, only the settings for the alattice parameter are reproduced (lines 10–19). The other parametersare omitted in the margin and can be found on the CDROM. The hardboundaries for the lattice constant a are set fairly close around the liter-ature values for bulk ZnSe (lines 11–12). No purely physical boundaryexists for the lattice constants, other than that higher or lower valueshave not been observed, even under high pressure. Here, the hardboundary conditions rather serve to draw attention, if the computa-tion should go wrong. If the lattice constant were to refine to either ofthese boundary values, something is seriously wrong, and the calcu-lations need to be checked very carefully. In order not to waste muchcomputational time, we choose a narrow window. The atomic displace-ment parameter, on the other hand has a lower hard boundary condi-tion B ≥ 0. Similarly, the stacking fault probability is limited to theinterval [0:1]. Other physical boundary conditions will exist accordingto the problem at hand.

The requirements for the setup of the other parameters is quite dif-ferent. Since these parameters are to be refined via a least-squares al-gorithm, there is no need to define these as parameters in the macrofile ref.znse.diffev.setup.mac. The main advantage of doing so is that therefined values from the previous refinement cycle can now be used asstarting values of the next refinement cycle. As for the structural pa-rameters, we define suitable hard boundary conditions (lines 26–27 forthe scale factor) for each of these parameters. The initial interval, de-fined by the values of pop_smin[i] and pop_smax[i], however, arenot important at all, except to give reasonable starting values for theleast-squares fit. The initial interval could even be set to a single value,as for the scale factor (lines 28–29). To do so, the results of the least-squares fit have to be fed back into the trial files DIFFEV/Trials.xxxx.The flags for the sigmas are of no consequence for the fit. The simu-lation of the ZnSe nanoparticles had already been described in Section9.2, and will not be repeated here, except for a few details regarding therefinement process.

Since these particles are built by stacking layers with random growthfaults, two particles built using identical parameters may end up beingdifferent. For this reason, several individual particles have to be cre-ated for each population member. The calculated powder pattern ofall these particles will be averaged, and thereafter the scale factor andthe background determined by least-squares fit. For the ZnSe particles,the individual powder patterns were stored in a subdirectory INDI andcalled indi.xxxx.yyyy, where xxxx is a four digit number with leadingzeros that refers to the population member, and yyyy refers to the indi-vidual particles for each member. The simulation process thus includedan outer loop over all 70 population members, and an inner loop over

Page 208: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 197

all individual particles. 25 particles were averaged for each member.See Section 11.3.2 for a discussion of the number of individual parti-cles/crystals to average.

This averaging, background fit, and calculation of the R value istaken care of by the KUPLOT macro ref.znse.kup.diffev.mac. Once themacro has read the GENERATION file, a loop over all children follows(lines 14–96). Within this loop the corresponding trial files are read

65 #66 ksav 367 outf "TEMP/calc.%4D",kid68 run69 rval 1,3,one70 fopen 1, "DIFFEV/Results.%4D",kid71 fformat 1,i572 fformat 2,f15.973 fput 1,kid,res[2]74 fclose 175 #76 do i[0]=1, 577 r[207+i[0]] = p[i[0]]78 enddo79 fopen 1, "DIFFEV/Trials.%4D",kid80 fput 1,’# generation members children params’81 fformat 1,i882 fformat 2,i1083 fformat 3,i1084 fformat 4,i1085 fput 1,generation,member,children,paras86 fput 1,’# current member’87 fformat 1,i588 fput 1,kid89 fput 1,’# parameter list’90 fformat 1,e20.1091 do i[0]=1,parameters92 echo " Wrote %3d ; %20.10f",i[0],r[200+i[0]]93 fput 1,r[200+i[0]]94 enddo95 fclose 196 enddo97 exit

(lines 15–22), and the current trial parameter values are stored in thevariable r[i] entries 201 to 213. This step is necessary only if youwant to use some of the parameter values as starting values for a least-squares fit, here the scale factor and background.

Next, the individual powder diffraction patterns are averaged (lines23–39). The first pattern is copied to a new file (line 23), and the patternnumber two to nindiv are successively added to this file (line 25–33).Finally the files are averaged by dividing the intensity by the numberof individual particles (line 36). It is not necessary to average the in-dividual powder pattern instead of just keeping the sum. Taking theaverage has the advantage that the scale factor remains independent ofthe number of individual particles. Saving the file (lines 37–39) is notnecessary, here it is added to ease the search for erroneous code whiledeveloping such a procedure.

The calculation of the powder pattern via the Debye equation pro-duces a powder pattern that is equidistant in reciprocal space, either insteps of h = 2 sin(Θ)/λ or of Q = 4π sin(Θ)/λ. DISCUS allows you tosave this powder pattern with h, respectively Q, converted to 2Θ. The2Θ scale will, however, reflect the equidistant Q steps and thus will notbe on an equidistant 2Θ scale. Unless the data have been measured ona 2Θ scale that corresponds to equidistant Q steps, we need to convertthe calculated powder pattern into an equidistant 2Θ scale. This con-version is done in lines 41–46. A file null.tth with evenly spaced 2Θsteps identical to the actual experimental data is read. The 2Θ scale ofour calculated powder pattern is converted by fitting a spline functionthrough the calculated intensity values and calculating the intensity atthe 2Θ steps found in null.tth (line 42). To avoid systematic errors, theQ step size should be smaller than the 2Θ scale throughout the entirediffraction pattern:

ΔQ < 4π(sin(Θnp)/λ − sin(Θnp−1)/λ) (11.6)

where Θnp is the highest Θ value of the diffraction pattern, and Θnp−1

the last but one. Next, the background is determined via a least-squaresfit (lines 48–63). The experimental data and the averaged calculatedpowder pattern are read (lines 49–50). The subsequent fit calculates theintensity at each point as:

Ifit = p1Icalc +

3∑j=0

pj+1(2Θ − 2Θmin)j (11.7)

The fit minimizes the sum over all squared differences (Iexp − Ifit)2,

summed over all data points. The parameter on the fit command in

Page 209: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

198 Refining disordered structures

line 52 indicates the number of the experimental data set, here num-ber 1, since the experimental data were read first in line 49 after thereset command in line 48. The parameters on the func command, line53, indicate that a background polynomial is fitted with data set num-ber 2 as calculated data and five refinable parameters. These five pa-rameters are the scale factor, parameter number one, initialized to thevalue of r[208] in line 54, and the four parameters for the third-orderbackground polynomial. The scale factor and background correctedintensity Ifit is saved as the next data set number 3 and stored in fileTEMP/calc.xxxx. Lines 69–73 calculate the R value using unit weights,and save the R value into file DIFFEV/Results.xxxx, which will be readand evaluated by DIFFEV.

05

10

5

5.2

5.4

5.6

15

20

25

R–V

alue

(%

)

R–V

alue

(%

)30

10 20 30 40

20 30 40 50 60 70

50 60 70Generation

Generation

Fig. 11.13 Change of R values as a func-tion of refinement generation. The fig-ure shows the best, average, and worstR value at each generation.

To preserve the scale and background parameters, the dummy vari-ables r[208] through r[213] are updated with the fit parametersp[1] through p[5] (lines 76–78) and the trial file DIFFEV/Trials.xxxxis replaced by a new version that includes these values. This last stepis, of course, only needed if any of the trial parameters were modified,or if it is necessary to store the fit parameters, either as input for thenext fit or to be available for later analysis. In our current example, itis necessary to calculate the final background function, and to compareits shape to the calculated and the experimental data. Since the peaksin the experimental diffraction pattern are broad and of low intensity,especially in the high 2Θ region, we need to ensure that the fitted back-ground function has not been misused to describe any of the significant

(a) (b)

(c) (d)

0

3.9756.51

6.54

6.574.005

a la

ttice

con

stan

t

c la

ttice

con

stan

t

3.99

10

3.975

4.8

4.9

R–v

alue

(%

)

R–v

alue

(%

)5

3.98 3.985 3.99 6.5

4.8

4.9

5

6.51 6.52 6.53 6.54 6.55a lattice constant c lattice constant

20

Generation

30 40 50 60 70 0 10 20

Generation

30 40 50 60 70

Fig. 11.14 Change of lattice constants a (a) and c (b) as a function of refinement generation.The figure shows the smallest, average, and highest value at each generation. Correlationbetween a (c) and c (d) lattice constants and R value in the final refinement generation.The current best value is shown as the large dot; the light dots at the bottom of the figureshow the trial values for the next generation.

Page 210: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.3 Refining parameters of a disorder model 199

experimental features. To enable this comparison, the averaged intensi-ties were saved into directory CALC separate from the final scale factorand background corrected intensities in directory TEMP.

Figure 9.17 shows the good agreement that was reached after the re-finement. Figure 11.13 shows the development of the R value duringthe refinement cycles. As selection mode, best was selected, i.e. the70 parents and 70 children at each generation were combined into onegroup of 140 members. From this group, those 70 members with thebest R values were taken as parent members for the next generation,irrespective of their status as parents or children of the current gener-ation. This greedy approach is justified since good parameter estimatescan be obtained and the probability of false minima is insignificant.Good estimates for the lattice constants and the size of the particle canbe estimated from the diffraction pattern. The z-position of Zn can beexpected to be close to the corresponding value of cubic bulk ZnSe, i.e.0.375 in the hexagonal metric. This leaves the initial guesses for theB value and the stacking fault parameter as less well defined. Theseparameters are, however, sufficiently independent of the other param-eters so that a large initial interval is advisable. As a consequence ofthe best mode, the worst R values quickly go down. After generation80 the best R value hardly improves significantly and the worst R valueis insignificantly worse than the best R value. Further generations, notreproduced here, did not improve the fit significantly.

(a)

(b)

(c)

0 10 20 30 40 50 60 70

Generation

0 10 20 30 40 50 60 70

Generation

0 10 20 30 40 50 60 70

Generation

0.375

0.5

0

0.2

0.4

0.6

0.8

1

1

1.5

2

2.5

0.39

0.405

Zn

z po

sitio

n

Isot

ropi

c B

val

ueSt

acki

ng f

ault

Prob

.Fig. 11.15 Change of the Zn z position (a),isotropic B value (b) and stacking faultprobability (c) as function of refinementgeneration. The figure shows the small-est, average, and highest value at eachgeneration.

Table 11.2 Refined structuralparameters for ZnSe nanopar-ticles. Estimated uncertaintiesare given in brackets.

Parameter Refined value

a 3.985(5) Åc 6.541(25) Åz(Zn) 0.374(3)B 2.00(15) Å2

stack 0.67(6)radiusa−b 13.8(2) Åradiusc 20.(1) Å

The lattice constants a and c were initially set to a very small interval.Figures 11.14a and b show the development of the lattice parameters aand c during the refinement. Figures 11.14c and d show the correlationsof these lattice parameters with the R value. It shows that the differen-tial evolutionary algorithm nevertheless is able to move to the correctsolution. Compared to the other parameters, the lattice constants take along time to converge, since the maxima in the powder pattern are verywide. All other structural parameters refine nicely as well (see Figs.11.15 and 11.16). In particular, the confidence interval for the size in theab-plane and along the c-axis is very small and shows the significantellipsoidal shape of the nanoparticles. Table 11.2 lists the refined struc-tural parameters. The uncertainties were estimated from plots of the Rvalue versus the parameter. A range of 0.2% for the R value above thebest R value was considered for the estimate. Figure 11.16d merits fur-ther comments. The refinement population apparently is split into twoseparate populations that nevertheless have similar R values, althoughthe size is not refined as a variable with discrete parameter space. Keepin mind that the particle is very small. Along the c-axis, the structure isbuilt up out of wurtzite layers that are c/2 = 3.27 Å apart. Even if weconsider the individual layers of Zn and Se, they are 2.24 Å, and 0.81 Åapart. Thus, an increase of the radius will not change the particle aslong as the diameter is varied within an interval that corresponds tointeratomic distances. This means that the two populations at diame-ters 19.9 Å and 21.0 Å correspond to particles that differ by one shell ofatoms. Thus, for this small particle size, the continuous radius affects

Page 211: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

200 Refining disordered structures

0

13.5 14 14.5Diameter a–b Diameter c

15 19 20 21 22

12

4.8 4.8

4.9

5

4.9

5

15

20

25

30

15

18

21

24

(a) (b)

(c) (d)

Dia

met

r a–

bR

–val

ue (

%)

R–v

alue

(%

)D

iam

etr

c

20 30Generation

40 50 60 7010 0 20 30Generation

40 50 60 7010

Fig. 11.16 Change of particle radius in a− b (a) and c (b) plane as a function of refinementgeneration. The figure shows the smallest, average, and highest value at each generation.Correlation between size in a − b (c) and c (d) plane and R value in the final refinementgeneration. The current best value is shown as the large dot; the light dots at the bottomof the figure show the trial values for the next generation.

the particle only in discrete steps. In later generations the populationmerged to a single one.

Finally, we will check the shape of the background. Figure 11.17shows the calculated background together with the experimental data,and the difference between the experimental and calculated intensity.The background forms a very smooth line, which fits the data well ex-cept for small 2Θ values. This is actually a hint that the background atthis 2Θ range is not just a pure background but rather due to scatteringby the organic ligand. This observation can then be taken to improvethe model.

20 40 60 80 100 120

0

500

1000

1500

2000

2500

Inte

nsity

20

Fig. 11.17 Experimental powder pattern,background line and difference Iexp −Icalc curve. The figure actually containsthe calculated intensity as well, yet thispattern is hidden in the noise of the ex-perimental pattern.

In the refinement presented in this section, the radius of all individ-ual particles whose powder pattern were averaged was identical. Thismodel can be expanded to allow a size distribution as well. This wouldbe achieved, by defining the σ of the size distribution. Each individ-ual particle would then have an individual size, which is defined by asuitable distribution, for example a log-normal distribution. Since thisincreases the differences between the individual particles, the numberof such particles needs to be increased considerably. Such a refinementwas applied to the ZnS shell particles that form the outer shell of theCdSe/ZnS core–shell particles simulated in Section 9.4.

Page 212: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.4 Bibliography 201

11.4 Bibliography

[1] T. R. Welberry, Th. Proffen, M. Bown, Analysis of single crystaldiffuse X-Ray scattering via automatic refinement of a Monte Carlomodel, Acta Cryst. A54, 661 (1998).

[2] S.C. Mayo, Th. Proffen, M. Bown, T.R. Welberry, Diffusescattering and Monte Carlo simulations of cyclohexane-perhydrotriphenylen (PHTP) inclusion compounds,C6H12/C18H30, J. Appl. Cryst. 32, 464 (1999).

[3] R.L. McGreevy, L. Pusztai, Reverse monte carlo simulation: a newtechnique for the determination of disordered structures, Mol.Simul. 1, 359 (1988).

[4] V.M. Nield, D.A. Keen, R.L. McGreevy, The interpretation of sin-gle crystal diffuse scattering using reverse Monte Carlo modelling,Acta Cryst. A51, 763 (1995).

[5] Th. Proffen, T.R. Welberry, An improved method for analysing sin-gle crystal diffuse scattering using the reverse Monte Carlo Tech-nique, Z. Krist. 212, 764 (1997).

[6] Th. Proffen, T.R. Welberry, Analysis of diffuse scattering via re-verse Monte Carlo technique: a systematic investigation, ActaCryst. A53, 202 (1997).

[7] T.R. Welberry, Th. Proffen, Analysis of diffuse scattering from sin-gle crystals via reverse Monte Carlo: I. comparison with directMonte Carlo, J. Appl. Cryst. 31, 309 (1998).

[8] Th. Proffen, T.R. Welberry, Analysis of diffuse scattering from sin-gle crystals via reverse Monte Carlo: II. the defect structure of cal-cium stabilised zirconia, J. Appl. Cryst. 31, 318 (1998).

[9] M.G. Tucker, M.T. Dove, D.A. Keen, Application of the reverseMonte Carlo method to crystalline materials, J. Appl. Cryst. 34, 630(2001).

[10] M.G. Tucker, M.P. Squires, M.T. Dove, D.A. Keen, Dynamic struc-tural disorder in cristobalite: neutron total scattering measure-ment and reverse Monte Carlo modelling, J. Phys. Cond. Matt. 13,403 (2001).

[11] Th. Proffen, V. Petkov, S.J.L. Billinge, T. Vogt, Chemical short rangeorder obtained from the atomic pair distribution function, Z. Krist.217, 47 (2002).

[12] Th. Proffen, S. J. L. Billinge, PDFFIT, a program for full profilestructural refinement of the atomic pair distribution function, J.Appl. Cryst. 32, 572 (1999).

[13] C.L. Farrow, P. Juhas, J.W. Liu, D. Bryndin, J. Bloch, Th. Prof-fen, S.J.L. Billinge, PDFfit2 and PDFgui: Computer programs forstudying nanostructure in crystals, J. Phys.: Condens. Matter 19,335219 (2007).

[14] Th. Proffen, K.L. Page, Obtaining structural information from theatomic pair distribution function, Z. Krist. 219, 130 (2004).

[15] X. Qiu, Th. Proffen, J.F. Mitchell, S.J.L. Billinge, Orbital correlationsin the pseudo-cubic O and rhombohedral R phases of LaMnO3,Phys. Rev. Lett. 94, 177203 (2005).

Page 213: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

202 Refining disordered structures

[16] J.H. Holland, Outline for a logical theory of adaptive systems,Journal of the Asscociation for Computing Maschinery 3, 297 (1962).

[17] D.E. Goldberg, Genetic algorithms in search optimization and maschinelearning, Addison-Wesley, Reading, 1989.

[18] I. Rechenberg, Evolutionsstrategie, Frommann-Holzboog, Stuttgart,1973.

[19] H.-P. Schwefel, Evolution and optimum seeking, Wiley, New York,1994.

[20] T. Bäck, Evolutionary Algorithms in Theory and Practice, OxfordUniversity Press, Oxford, 1996.

[21] H.M. Cartwright, An introduction to evolutionary computationand evolutionary algorithms, Structure and Bonding 110, 1 (2004).

[22] B. Kost, Optimierung mit Evolutionsstrategieen, Verlag HarriDeutsch, 2003.

[23] Keneth V. Price, Rainer M. Storn, Jouni A. Lampinen, Differen-tial Evolution; A Practical Approach to Global Optimization, Springer,Berlin, 2005.

[24] K. Shankland, W.I.F. David, T. Csoka, Crystal structure determina-tion from powder diffraction data by the application of a geneticalgorithm, Z. Krist. 212, 550 (1997).

[25] B.M. Kariuki, H. Serrano-González, R.L. Johnston, K.M.D. Harris,The application of a genetic algorithm for solving crystal struc-tures from powder diffraction data, Chem. Phys. Lett. 280, 189(1997).

[26] K.M.D. Harris, R.L. Johnston, B.M. Kariuki, The genetic algorithm:Foundations and applications in structure solution from powderdiffraction data, Acta Cryst. A54, 632 (1998).

[27] K.M.D. Harris, R.L. Johnston, S. Habershon, Applications of evo-lutionary computation in structure determination from diffractiondata, Structure and Bonding 110, 55 (2004).

[28] J.R. Helliwell, M. Helliwell, R.H. Jones, Ab initio structure deter-mination using dispersive differences from multiple-wavelengthsynchrotron-radiation powder diffraction data, Acta Cryst. A61,568 (2005).

[29] A. Altomare, C. Cuocci, C. Giacovazzo, A.G.G. Moliterni, R. Rizzi,The combined use of patterson and Monte Carlo methods for thedecomposition of powder diffraction pattern, J. Appl. Cryst. 39, 146(2006).

[30] W. Paszkowicz, Properties of a genetic algorithm extended by arandom self-learning operator and asymmetric mutations: A con-vergence study for a task of powder-pattern indexing, Anal. Chim.Acta 566, 81 (2006).

[31] E. Landreeee, C. Collazo-Davila, L.D. Marks, Multi-solution ge-netic algorithm approach to surface structure determination usingdirect methods, Acta Cryst. B53, 916 (1997).

[32] M. Wormington, C. Panaccione, K.M. Matney, K. Bowen, Char-acterization of structures from X-ray scattering data using geneticalgorithms, Philos. Trans. R Soc. London A 357, 2827 (1999).

Page 214: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

11.4 Bibliography 203

[33] A. Ulyanenkov and. K. Omote, J. Harada, The genetic algorithmrefinement of X-ray reflectivity data from multilayers and thinfilms, Physica B 283, 237 (2000).

[34] K. Knorr, F. Mädler, The application of evolution strategies to dis-ordered structures, J. Appl. Cryst. 32, 902 (1999).

[35] Th. Weber, H.-B. Bürgi, Determination and refinement of disor-dered crystal structures using evolutionary algorithms in combi-nation with Monte Carlo methods, Acta Cryst. A58, 526 (2002).

[36] R.B. Neder, V.I. Korsunskiy, Ch. Chory, G. Müller, A. Hofmann,S. Dembski, Ch. Graf, E. Rühl, Structural characterisation of II-VIsemiconductor nanoparticles, Phys. Stat. Sol. C 4, 3221 (2007).

Page 215: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

This page intentionally left blank

Page 216: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Appendix AA.1 Contents of the CD-ROM

Fig. A.1 Contents of CD-ROM.

If you open the CD-ROM included with this book, you will see a di-rectory view similar to the one shown in Fig. A.1. The two text files,README and COPYRIGHT contain information about the contents ofthe CD-ROM as well as copyright information. The contents of this CD-ROM is subject to the same copyright as the DISCUS package itself. Letus now have a closer look at the four directories found on the CD:

• Programs: This directory contains the DISCUS package as binarydistribution for the Windows operating system as well as a sourcecode distribution for UNIX based operating systems. More infor-mation about program installation is given in Appendix A.2.

• Exercises: This directory contains the solution macro files to mostof the exercises in this book (see Appendix A.4). The files are or-ganized by chapter, i.e. the solutions to exercises of Chapter 3 arein the directory Chapter_03.

• Macros: Here are all the macro files used throughout the book.You might have noticed that a filename is given at the beginningof each macro. Again the files are organized by chapter.

• Tools: This directory contains the utility programs dos2unix andunix2dos needed to convert text files from Windows type to UNIX.Unfortunately the way lines in text files are terminated are not thesame for Windows and UNIX. All DISCUS package programs ex-pect UNIX type files and one can use the dos2unix file commandto convert these files.

A.2 Installation

In this section we will briefly describe the installation process for theDISCUS program package. The programs can be found on the CDROMincluded with this book or the current version of the software can bedownloaded from the DISCUS homepage. Since the program DISCUS http://discus.sourceforge.netis still actively developed, readers are encouraged to check the home-page for updates and subscribe to the DISCUS announcements mailing

205

Page 217: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

206 Appendix

list. Refer to the section corresponding to your operating system forinstallation information.

Windows

The Windows version of the DISCUS package is distributed as a self-extracting installer. This makes the installation very easy. Simply ob-tain the file Diffuse-win32-YYMMDD.exe either from the included CD-YYMMDD specifies the date of the dis-

tribution. Make sure you download themost recent one.

ROM or from the Internet. Run the installer by double clicking on thecorresponding file icon. This will start the installation process and thedialog shown in Fig. A.2 will appear. Follow the instructions on thescreen and that is all, you are ready to use any of the programs that arepart of the DISCUS package. Look in the START - Programs menu forlinks to the programs as well as the documentation.

Fig. A.2 Windows installer for DISCUSpackage

UNIX / LINUX

For UNIX or LINUX operating systems, the DISCUS package is dis-tributed as source code and needs to be compiled before the programscan be used. We give a brief tutorial here how to do that, more de-tails can be found in the INSTALL file which is part of the distribu-tion. You might also check the DISCUS homepage for available binarydistributions for Linux. First copy or download the file Diffuse-source-YYMMDD.tar.gz. Next unpack the archive using the command

tar -xvof Diffuse-source-YYMMDD.tar.gz

This will create a directory diffuse, containing the distribution. Withinthis directory there are separate directories discus, kuplot, diffev and pdf-fit containing the four different programs as well as a directory lib_f77which contains command language related routines common to all threeprograms. In each program directory, you will find the following direc-tory structure:

./prog : Contains the source code

./doc : Contains documentation

After proceeding to the discus/prog directory, you need to edit the fileMakefile and alter the location where the program(s) shall be installeddefined by the variable BINDIR. Read the comments in the file to se-lect the appropriate compiler switches for your platform. Finally editconfig.inc and adjust array sizes to suit your needs. An explanation ofthe variables is found in the header of the file config.inc. Keep the mem-ory size of your computer in mind when adjusting those array sizes!Run the script LINK to create links to common files in lib_f77. Next theprogram is compiled and linked by executing the command make fol-lowed by make install if all went well. Make sure an appropriate pathfor the binaries to be installed is set in the Makefile. After that you canperform a make clean to remove the binary and the object files from thesource directory. If you want to install the program manually you haveto put the files discus and discus.hlp in the same directory.

Page 218: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.3 Functional list of commands 207

Before you can actually use the online help of the program, an en-vironment variable DISCUS has to be set to the path where the pro-gram is installed in. This can be done, e.g. in the .login or .cshrc fileusing the command setenv DISCUS /path/to/discus for the csh of set DIS-CUS=/path/to/discus; export DISCUS if you are using the bourne shell. Ifthis path is also included in your search path you can start the programsimply by entering discus. Similarly, the other programs are started byentering their respective names. In the directory diffuse you will alsofind a script INSTUNIX that will install all programs once you haveproperly edited the Makefiles.

A.3 Functional list of commands

In this appendix, we list all top level commands of DISCUS. Each com-mand marked with a * will branch into a module. Each module has itsown set of commands. The most important command is help or helpcmd which will display the online help for command. The program dis-tribution also contains a complete command reference.

Program controlCommand Description@ Execution of a macrofile= Assigns the value of an expression to a variablebreak Interrupts a loop or conditional statementcontinue Continues DISCUS after ’stop’ commanddo Start of a do loopelse Default block in an if constructionelseif Alternative block in an if constructionenddo End of a do loopendif End of an if constructionexit Ends the DISCUS programif Begin of an if constructionlearn Starts a learn sequencelend Ends a learn sequenceseed Initialize the random number generatorset Set various parameterssleep Suspend program execution for a defined timestop Stops DISCUS macro, resume with ’cont’system Executes a shell commandvariable Define user supplied variable nameswait Wait for user input

Crystallographic calculationsCommand Descriptiond2r Converts a vector from real to reciprocal spaceproj Project a vector onto another or onto a planer2d Converts a vector from reciprocal to real spacevprod Calculates the vector product

Page 219: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

208 Appendix

Modification of individual atomsCommand Descriptionappend Appends an atom or molecule, if location is not occupiedcopy Copies an atominsert Inserts an atom, molecule or domainkick Deletes atom/molecule and inserts a new oneremove Deletes an atom from the crystalswitch Switches the position of two atoms or moleculesb[j]=<exp> Change isotropic B of atom j to value of expressionm[j]=<exp> Change scattering type of atom j to value of expressionx[j]=<exp> Change x position of atom j to value of expressiony[j]=<exp> Change y position of atom j to value of expressionz[j]=<exp> Change z position of atom j to value of expression

Structure modificationsCommand Descriptionboundary Removes atoms outside a specified boundarymmc * Switches to the Monte Carlo simulation moduledomain * Switches to the domain module of DISCUSpurge Deletes empty lines from the crystalreplace Replaces atom/molecule with given probabilityrmc * Switches to the Reverse Monte Carlo module of DISCUSshear * Switches to deformation module of DISCUSstack * Switches to stacking fault module of DISCUSsymm * Switches to symmetry calculation module of DISCUSthermal Displace atoms according to temperature factortrans * Switches to the unit cell transformation segmentwave * Switches to the wave generating module of DISCUS

Fourier and PDF modulesCommand Descriptiondiff * Switches to the Difference Fourier module of DISCUSfourier * Switches to the Fourier module of DISCUSinverse * Switches to the Inverse Fourier module of DISCUSpatterson * Switches to the Patterson module of DISCUSpdf * Switches to the PDF module of DISCUSpowder * Switches to the powder diffraction module of DISCUS

Input and OutputCommand Descriptionaddfile Adds the contents of two filesfclose Close file opened with fopenfexist Checks the existence of a filefget Read information from filefopen Open file for fget or fputfput Write information to fileimport * Switches to the import module of DISCUSoutput * Switches to the output module of DISCUSplot * Writes the structure in a format ready for displayread * Switches to the reading module of DISCUSsave * Saves the the structure saving module of DISCUS

Page 220: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.3 Functional list of commands 209

Information and crystal analysisCommand Description# Comment, the rest of the line will be ignoredasym Shows the content of the asymmetric unitchem * Switches to the chemistry module of DISCUSecho Echoes a stringeval Evaluates an expression for interactive displayeval cdim[i,j] Displays the crystal dimensionseval n[1] Displays the number of atoms within the crystaleval n[2] Displays the number of different atoms within the crystaleval n[3] Displays the number of atoms in (original) unit celleval n[4] Displays the number of molecules within the crystaleval n[5] Displays the number of different molecule types within the crystaleval n[6] Displays the number of molecules in (original) unit celleval m[i] Displays atom type of atom < i >eval x[i] Displays x-coordinate of atom < i >, similar for y and zfind Finds the environment around an atomhelp Gives on line helpset Set various parametersshow Displays various DISCUS settings and results

Page 221: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

210 Appendix

A.4 Answers to exercises

This appendix contains the answers to the exercises given at the endof most chapters. For most of the exercises the corresponding DISCUSmacro files have been included on the CD-ROM as described in Ap-The associated files are in the direc-

tory exercises in subdirectories ac-cording to the chapter, e.g. Chapter_04.The main DISCUS macro is then calledex_02.mac for a given exercise, herenumber two. In some cases a KUPLOTmacro named kex_02.mac used to plotthe results is included as well. The direc-tory might contain other files needed forthe simulations. Refer to the main DIS-CUS macro for the corresponding details.

pendix A.1.

Answers Chapter 3

Exercise 3.1 : The exercise left a bit of freedom regarding the position of therow of atoms in space. For the sake of simplicity let us assume that thecoordinates of the carbon atoms in the row should start at 0, 0, 0, and thatthe row should be parallel to the x-axis. In cartesian space the distancebetween two positions x1, y1, z1 and x2, y2, z2 is

d =√

(x1 − x2)2 + (y1 − y2)2 + (z1 − z2)2 (A.1)

The carbon atoms should thus be simulated at 0, 0, 0, 3, 0, 0, 6, 0, 0, etc.No stipulation was made about the length of the chain and you are freeto experiment. To obtain the oxygen positions we simply have to add thevectors [0.9, 1.1, 0.0] and [−0.9,−1.1, 0.0] to each of the carbon positions.The length of this vector is 1.42 Å. The solution consists of the followingsteps:

• Write a loop that runs N times to generate N atoms.• Calculate the x-coordinate from the loop counter.• Insert a carbon atom at the coordinates x, 0, 0.• Insert an oxygen at x + 0.9, 1.1, 0.0 and at x − 0.9,−1.1, 0.0.

Exercise 3.2 : To create this set of atoms you have to create atoms whose x po-sition are on regular intervals as in the previous exercise. The y positionis calculated by a sine function as: y = a sin(bx + c), where a, b, and c arefree variables. The solution consists of the following steps:

• Define a cartesian space.• Write a loop that runs N times to generate N atoms.• Calculate the x-coordinate from the loop counter.• Calculate the y-coordinate.• Insert an atom at this position.

Exercise 3.3 : The generators of space group P2/c (No. 13) are 2 0, y, 1/4 and1 0, 0, 0. These generate the following general positions: x, y, z, x, y, z+1/2, x, y, z, and x, y, z + 1/2. In matrix form the two generators areshown here.⎛

⎜⎝−1 0 0 0.0

0 1 0 0.00 0 −1 0.50 0 0 1

⎞⎟⎠

⎛⎜⎝

−1 0 0 0.00 −1 0 0.00 0 −1 0.00 0 0 1

⎞⎟⎠

2 0, y, 1/4 1

(A.2)

Page 222: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.4 Answers to exercises 211

Note that the translational part of the two fold axis is solely due to theshift of origin from 0, y, 0 to 0, y, 1/4. To generate a unit cell from theasymmetric unit these two generators have to be applied to each atomin the asymmetric unit. If either of the two generators copies the atomonto itself the generator must be omitted. Note that for this special spacegroup you always get at least two atoms, since the 1 is not located on thetwo-fold axis. The main steps for each atom in the asymmetric unit andall generators of the space group are:

• Apply generator to first atom.• Shift atom into unit cell.• Compare new position to all previous positions.• If new, apply generator to all other previously created atoms.

Exercise 3.4 : The CaF2 structure crystallizes in space group Fm3m, lattice con-stants 4.5 Å, Ca at 4a 0, 0, 0, F at 8b 1/4, 1/4, 1/4. The generators of thespace group are t(0, 1/2, 1/2), t(1/2, 0, 1/2), 2 0, 0, z, 0, y, 0, 3 x, x, x,2 x, x, 0, and 1 0, 0, 0. With the exception of the centering vectors, allgenerators copy the Ca onto itself, and you obtain the four positionsas listed in the International Tables: 0, 0, 0, 0, 1/2, 1/2, 1/2, 0, 1/2, and1/2, 1/2, 0. We will apply the two centering generators last and startwith the generator 2 0,0,z which copies the F to −1/4,−1/4, 1/4. Thegenerator 2 0, y, 0 copies these two atoms to −1/4, 1/4, −1/4 and 1/4,−1/4, −1/4. The threefold axis copies the original F onto itself is is con-sequently omitted from the list of generators. Finally, the generator 2x,x,0 copies the atoms to 1/4, 1/4,−1/4, −1/4, −1/4, −1/4, 1/4, −1/4,1/4, and −1/4, 1/4, 1/4. The generator 1 0, 0, 0 copies the original Fatom to −1/4, −1/4, −1/4 which is the same position as one copied bythe 2 x, x, 0 generator. The chemistry is quickly calculated to Ca4F8. Thesymmetry of this atom cluster is 3m. The fourfold axis 4 x, 0, 0, 4 0, y, 0,and 4 0, 0, z all move the atoms into neighboring unit cells, which arepresently empty.

To simulate the second crystal, limited to 0 ≤ x, y, z ≤ 1, you need to addthe Ca atoms at the other seven corners of the unit cell and the three Caatoms at the other faces which yields the Ca positions shown here. No F Ca positions:

0,0,0 0, 12

, 12

1

2,0, 1

2

1

2, 12

,0 1, 12

, 12

1

2,1, 1

2

1

2, 12

,1 1,0,0 0,1,0

0,0,1 1,1,0 1,0,1

0,1,1 1,1,1

atoms need to be added, and the chemistry of this crystal is Ca14F8. Thesymmetry of this cluster is 4/m32/m. All symmetry elements have theirorigin at 1/2, 1/2, 1/2 though! As an example, the fourfold axis parallelto [001] is to be described as 4 1/2, 1/2, z or in matrix form:

⎛⎜⎝

0 −1 0 11 0 0 00 0 0 00 0 0 1

⎞⎟⎠ (A.3)

The translational part (1, 0, 0) results from the shift of the symmetry op-eration from 0, 0, z to 1/2, 1/2, z.

Exercise 3.5 : This exercise might sound difficult, but it is actually quite easy. File: sim/simul.ex2.cll1 title Low-T Cristobalite2 spcgr P412123 cell 4.998, 4.998, 7.024, 90.0, 90.0, 90.04 atoms5 SI 0.2942, 0.2943, 0.0000, 0.16 O 0.2403, 0.0933, 0.1731, 0.2

As a fist step, create the DISCUS unit cell file shown here to create thestructure. Next the transmodule is used. From the exercise, we quicklyfind the following relations: anew = (1, 1, 0), bnew = −1, 1, 0), cnew =0, 0, 1 and the new origin is (1/4,1/4,0).

Page 223: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

212 Appendix

Exercise 3.6 : The first step, as with most other exercises, is to create the start-ing structure. From the information given in the exercise, a DISCUS unitcell file can easily be created and a 3 x 3 x 3 unit cell crystal created. Note,creating more than one unit cells will make sure we do not have unsatis-fied bonds at the edge of the unit cell. The following steps will need tobe carried out for each silicon atom in the structure:

• Find all oxygen neighbors around each silicon using the find envcommand.

• Determine the direction of the Si-O(2) bond.• Rotate all other oxygens around this direction using the DISCUS

symm module.

The solution macro file will save the original and rotated structure as aCIF file, so the structure can be viewed in 3D using one’s favorite struc-ture plotting program.

Exercise 3.7 : First one needs to create the file with information about the asym-metric unit that is shown here. Next, this file is read and a model crystalFile: sim/simul.ex.cll

1 title ZrO2 cubic structure2 spcgrp Fm-3m3 cell 5.14, 5.14, 5.14, 90.0,90.0,90.04 atoms5 Zr 0.00, 0.00, 0.00, 0.406 O 0.25, 0.25, 0.25, 0.607

of the desired size is made, in our case 10 x 10 x 10 unit cells. DISCUS isdoing all the work of creating the symmetrically equivalent atoms andexpanding the unit cell to the desired size. Now the generated ZrO2

structure needs to be "doped": The command replace allows us to re-place a specified fraction of one atom type by another one. The stoi-chiometry of ZrO2 doped with CaO is Zr1−xCaxO2−x. Thus, we haveto replace 15% of the zirconium atoms by calcium and 7.5% of the oxy-gen atoms by the atom type void. The oxygen vacancies are needed tomaintain charge balance.

Answers Chapter 4

Exercise 4.1 : First one needs to generate a structure and expand it to the de-sired size. We used the simple structure file with a single zirconium atomon (0, 0, 0) and then used the read command of DISCUS to generate rowsof atoms (one-dimensional crystal) of the desired length. Inspecting theintensity along the h direction, one can quickly see that the ripples be-tween the Bragg peaks have n − 1 nodes with n being the number ofatoms used. Try extending the macro to three dimensions with a differ-ent number of unit cells in each direction.

Exercise 4.2 : The questions can easily be answered by changing the macrosused in Exercise 4.1 and modifying the structure file. The correct gridfor avoiding finite size effect contributions is 1/n (generally it is i/n but1/n gives the smallest grid) where n is the number of unit cells. As aresult, changing the lattice parameter will not require one to change thecalculation grid at all. If, however, we half the size of the crystal from20 to 10 unit cells, our grid size must double from 1/20 = 0.05 r.l.u. to1/10 = 0.1 r.l.u.

Exercise 4.3 : Let us start with the comparison of the calculated PDFs for nickel.As it turns out, the PDFs calculated for X-rays and neutrons are identical.This might seem surprising, since the diffraction patterns for X-rays andneutrons are clearly different due to the atomic formfactor for X-rays. Toobtain S(Q) in case of X-rays, the data are actually divided by the form-factor before G(r) is obtained. As a result, the S(Q) in this case would

Page 224: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.4 Answers to exercises 213

be the same as well. Below we repeat the equation used to calculate G(r)from a structural model.

Gc(r) =1

r

∑i

∑j

[bibj

〈b〉2δ(r − rij)

]− 4πrρ0 (A.4)

The type of radiation affects the weight bibj/〈b〉2. However, this term is

one if only one atom type is present as in the case of our nickel example.In case of LaMnO3, on the other hand, we see differences reflecting thedifferent weights. The first peak corresponds to Mn-O and it is negativein the neutron case. This is due to the fact that manganese has a nega-tive neutron scattering length, b, causing a negative weight. We also seethat the magnitude of this first Mn-O peak is much lower in the case ofX-rays. This is due to the small X-ray scattering powder of oxygen com-pared to lanthanum whereas the scattering power in case of neutronsis comparable. In this case, Mn-O and O-O correlations in the G(r) arebetter observed in a neutron scattering experiment.

Answers Chapter 5

Exercise 5.1 : The solution macro is similar to the one presented in Section 5.5and the input correlations used to generate the two structures are shownin Table A.1. First let us discuss structure A. The dominating feature are

Table A.1 Input correlations.

Model A B

c10 −0.30 0.30c11 −0.30 0.30c20 −0.30 −0.30c30 0.80 −0.30

rows of two vacancies in the x and y direction. This points to a positivecorrelation in 〈30〉 neighbors. This also forces a slight positive correla-tion for 〈10〉 and 〈20〉 neighbors, otherwise no rows of vacancies wouldbe observed. Not surprisingly, there are certain sets of correlations thatcannot be simultaneously fulfilled as in this example. Run the macroand check the achieved correlations after the MC simulation. In the caseof structure B, the dominant feature are long vacancy chains along the〈11〉 directions, indicating a positive correlation as indicated in the ta-ble. However, one also notices that these chains appear in pairs of two,accounting for the positive correlation in 〈10〉. The negative values for〈20〉 and 〈30〉 prevent longer range clustering of these chains. Again oneshould check the achieved correlations after the MC run has finished.

Exercise 5.2 : Simulated annealing is achieved by reducing the temperature, orkT , as the MC simulation progresses. This is done by encapsulating theMC simulation (see earlier exercises) in a loop that decreases kT in somefashion. In the solution macro, kT is decreased linearly, but it is an easychange to other functional forms.

Exercise 5.3 : The modification of the macro used in Example 2 of this chapter(Section 5.6) is quite simple. Run the simulation at different values of kTand save the results in different files. As one might expect, a larger valueof kT or a larger temperature leads to a broader bond length distributionand vice versa. One can also note that even at kT = 0, the distributionhas a finite width. This is due to the distortions themselves. An extensionof the exercise would be to explore the bond length distribution at kT = 0for desired distortions of different magnitudes.

Exercise 5.4 : Basically, this exercise is a combination of the simulations creat-ing chemical SRO (Section 5.5 and the examples of creating distortions(Section 5.6). In most cases the chemical ordering is a separate first step,

Page 225: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

214 Appendix

followed by the relaxation of neighboring atoms to create the desireddistortions. This approach of course is not attempting in any way to sim-ulate the true formation of the disordered structure. The diffuse scatter-ing pattern can then be understood as the diffuse scattering originatingfrom the chemical ordering, modified by the size-effect shift of scatter-ing intensity as we discussed in Section 5.6. The solution macro file willproduce the diffraction pattern from the undistorted chemically orderedstructure as well as from the distorted structure, so this can be easily ob-served. Feel free to change the target correlations in the macro file andexplore the resulting diffuse scattering.

Answers Chapter 6

Exercise 6.1 : The presence of two harmonic density waves can be describedby simply extending equation 6.1 resulting in the expression shown here.Using equation 4.18 we can easily calculate the Fourier transform and get

ρd(r) = ρ + A1 cos(2π

[k1r

λ1

+ φ1

])+ A2 cos

(2π

[k2r

λ2

+ φ2

])an independent set of satellites for both waves according to 6.2. Thus thesatellite positions are given by ± 1

λi

ki around the Bragg peaks with anintensity of Isat

i ≈ 1

4ρ2 A2

i , (i = 1, 2).

For the demonstration simulation to this exercise we chose the follow-ing parameters: A1 = A2 = 0.25, ρ = 0.5, λ1 = 50Å, λ2 = 35Å andφ1 = φ2 = 0.0. The wave vectors are k1=[100] and k2=[110]. Since thewave segment of DISCUS can only create one wave at a time, the two den-sity waves must be introduced separately as done in part A of the demon-stration macro. Note that the each wave must only oscillate between 0.0and 0.5 as defined by the commands plow and phigh. However, theresulting simulation shows in addition to the expected satellites aroundeach Bragg peak, weak intensity spots that can be described as satellitesof the "main" satellite positions. This can be seen as a modulation by thesecond wave of the already modulated structure. The resulting struc-ture created by introducing both density waves separately correspondsto the product of the two probability distributions rather than the sum.This is also reflected by the fact that the resulting satellite intensities andthe average density are different from their expected values. In order tosimulate exactly what we want here, we need to use the variables andcommand language of DISCUS rather than the wave tool and introduceboth density waves simultaneously. This is done in part B of the demon-stration macro. Now we observe only satellites at the expected positionswith the expected intensity (small differences might remain, see Section6.4).

Exercise 6.2 : First we will derive the analytical expression using the same no-tation for the density wave as in Section 6.1. Additionally the two sitesshall be separated by a vector ±b, in our case b = (0, 0.125, 0) from themidpoint between both sites. The scattering amplitude can be written as

F (h) =∑

atoms

fzr

(1

2+

1

2cos

(2π

kr

λ

))exp(2πih(r + b))

+∑

atoms

fzr

(1

2−

1

2cos

(2π

kr

λ

))exp(2πih(r − b)) (A.5)

Page 226: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.4 Answers to exercises 215

The two sums represent the two modulated sites. By performing themultiplication and ordering the terms one quickly gets:

F (h) ={

1

2exp(2πihb) +

1

2exp(−2πihb)

}·∑

atoms

fzr exp(2πihr)

+{

1

2exp(2πihb) −

1

2exp(−2πihb)

}·∑

atoms

fzr cos(2π

kr

λ

)exp(2πihr)) (A.6)

Note that the product of fzr and the cos term in the second sum resultsin the convolution of the individual Fourier transforms as discussed inSection 6.1. This gives the result shown in the margin. In contrast to the

F (h) = cos(2πhb) · G(h)

+i

2sin(2πhb) · G

(h ±

1

λk

)result for the density wave operating on a single site, here the intensityof the Bragg peaks is modulated by cos2(2πhb). Again we observe onlyone pair of satellites at positions ± 1

λk, but their intensity is modulated

by 1

4sin2(2πhb). Note that their are no satellites for Bragg peaks with

k = 0 since the projection down the y-axis gives the perfect structure. Tosimulate this situation using DISCUS we start off with the same densitywave operating on a single site (0, 0, 0) as in the example in Section 6.1.As a second step we replace all created vacancies by zirconium and add1

4to the corresponding y-coordinate as done in the demonstration macro

for this exercise.

Exercise 6.3 : All that needs to be changed are the parameters of the commandvect in the example in Section 6.2 to the new wavevector k. The satel-lites will appear in the [11] direction around the Bragg peaks. Since theoscillation direction a of the displacement wave determines the intensitydependence of the Bragg and satellite intensities, their behavior along kis identical to the example in section 6.2 since we have not changed thevalue of a. Because the satellite vector now has a k component as well,satellites at positions ±hs have different intensities similar to our obser-vation for longitudinal displacement waves.

Exercise 6.4 : Here we have the Fourier transform of a square box convolutedwith F (h) rather than the circular boundary discussed in Section 6.3.Thus we have a finite size effect contribution similar to the one discussedin detail in Section 4.1.1. The demonstration macro allows the user tospecify the size of the limiting box interactively and readers are encour-aged to really try different sizes. Note that the finite size contributions inthe h direction might overlap and produce rather strange looking scat-tering between the satellites.

Exercise 6.5 : In contrast to the Gaussian used in Section 6.3, the usage of thetanh function allows us to simulate large domains with a dampeningeffect only near the domain boundary. A possible dampening functionwould look like this:

D(r) =1

2+

1

2tanh(αr − π) (A.7)

Here r is a radial variable giving the distance from the boundary of thedomain and the factor α allows one to determine how "sharp" the damp-ening will be. The resulting diffraction pattern is similar to the one using

Page 227: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

216 Appendix

the Gaussian dampening function, however, some weak residual scatter-ing around the Bragg peaks and the satellites caused by D(r) remains.For more details refer to the demonstration example.

Answers Chapter 7

Exercise 7.1 : The required macros are essentially identical to those listed in themargin of Section 7.5. Take macro stack.h0l.mac as a template.In this exercise the intensity is calculated only along hkL rods with in-teger h and k values. Thus it is not necessary to expand hexagonal.cell toa full layer. Within the stacking fault setup the file hexagonal.cell can beused directly instead of hexagonal.layer. The other settings for the stack-ing fault remain unchanged.To calculate the intensity along hkL rods with different h and k, modifylines 44 through 51 of this macro. An outer loop should run over a num-ber of simulations to average the results. Within this loop create a list oflayer origins. Add two nested loops over h and k, each running from 0 toan upper limit, 3 is sufficient. Within this loop call the fourier menu anddefine a one-dimensional calculation parallel to L with the current h andk. Then call the stacking fault menu and execute the Fourier transform.Finally the individual intensities are saved. Use KUPLOT to average thediffraction pattern. This loop may look like:

File: stack/stack.ex1.mac

1 do indiv=1,naver #2 stack3 create4 exit5 #6 do hh = hmin, hmax7 do kk = kmin, kmax8 four9 ll hh , kk, -0.5

10 lr hh , kk, 2.511 ul hh , kk, -0.512 exit13 #14 stack15 four16 exit17 #18 output19 outfile "INDI/growth.%1D%1Dl_%4.2F_%4D",hh,kk,prob,indiv20 value inte21 run22 exit23 enddo24 enddo25 enddo

A systematic survey through the different hk shows that the rods withh − k = 3n are free of diffuse scattering.

Exercise 7.2 : The macros from the first exercise can be used for the calcula-tions. The loop over k should be limited to k = 0. To verify the state-ments on width and position of the peaks along the h0l reflections theirpositions and width should be determined from a least-squares fit; thetools for this are part of KUPLOT . In order to obtain reliable data on po-sition and FWHM, many crystals should be averaged. It is more efficientto average many smaller crystals than a few large crystals.

Page 228: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.4 Answers to exercises 217

Exercise 7.3 : Again, the macros from Section 7.6 may be used. As for Exercise7.2, it is advisable to average a large number of crystals. Their individualsize may be reduced compared to the macro in the margin of Chapter 7.

Exercise 7.4 : The first simulation algorithm in Section 7.8 started out with anequal amount of A, B, and C atoms. This is appropriate to simulate acrystal in which all 4H segments are equally likely. The perfect 4H struc-ture, however, consists of 25% A layers, 50% B layers and 25% C lay-ers. To create a crystal that predominantly consists of just one of the 4Hsequences, the initial crystal should reflect this relative proportion. Inaddition, longer interactions like the [008] vector should be used.

The second algorithm is not suited for the task of this example! Here, thepseudo-atoms represent the vector between two adjacent layers ratherthan the absolute position of these layers. The relative vector betweenadjacent layers is, however, identical for all ABCB, BCAC, etc. sections.Thus this algorithm cannot distinguish the different segments at a localscale. If you add longer interactions, the sorting will introduce larger seg-ments that are well sorted. After a fault, another segment will establishwith equal probability.

Answers Chapter 8

Exercise 8.1 : This exercise is very similar to the example given in Section 8.3.Three files need to be created: The structure file for the host structure,the structure file for the domain structure and a file containing the originfor the domain, here (3, 4, 0). Assuming the lattice parameters of the hostand domain structures to be the same, the orientation matrix is simplythe identity matrix and the shape matrix is Tii = 5 to create a domainwith a radius of five unit cells. Refer to the comments in the solutionmacro for an example, where the lattice of the domain and host are notthe same.

Exercise 8.2 : This exercise is an extension of the previous one. The shape ma-trix to create the rotated ellipsoid is shown here:

Tij =

(4.0 cos(45) 8.0 sin(45) 0.0

−4.0 sin(45) 8.0 cos(45) 0.00.0 0.0 10.0

)(A.8)

This will create the 4 x 8 x 10 elliptical domain, rotated 45◦ in the ab-plane. So far we have only transformed the shape of the domain but onecan also transform the structure inside if desired.

Exercise 8.3 : There are two solutions to this exercise. One approach is to createa domain structure file as discussed in the second example in Section 8.3.Here position, shape and orientation of all ten domains can be encoded.DISCUS then reads this file and creates the desired domain structure. Thealternate approach is to create a loop around creation of a single domainand adjust the origin and shape for each iteration. Refer to the solutionmacro for details.

Page 229: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

218 Appendix

Answers Chapter 9

Exercise 9.1 : The solution to this exercise involves two steps to create the par-ticle. First, we expand the regular asymmetric unit of silicon to a fullcrystal, whose diameter is sufficiently large. The required number ofunit cells can be calculated from the diameter and lattice constant a0 as:

dimen = INTEGER(diameter/a0) + 2 (A.9)

Then all atoms outside a sphere with given diameter are removed. DIS-CUS provides the boundary command to do this task. It is advisable topurge all atoms outside this sphere. Prior to calculating the powder pat-tern via the Debye equation, you should transform the metric to carte-sian space, since this speeds up the calculation considerably. Since wecalculate the PDF of a finite object, we need to tell DISCUS to correct the−4πρ0r line according to the shape of the nanoparticle. For our sphericalparticle it is best to choose the envelope function for a spherical particle:

fe(r, d) =

[1 −

3

2

r

d+

1

2

(r

d

)3]

Θ(d − r) (A.10)

The PDF section of DISCUS provides a command set finite,sphereto set this correction. The number density should be set to about 1/3 ofthe theoretical number density of silicon since a powder of nanoparticlesis much less densely packed.

Exercise 9.2 : The initial simulation of a spherical particle, and the calculationof the powder pattern and PDF, are identical to the previous exercise.Both relaxation models need a bit more clarification than was given inthe original question. If you want to change the interatomic distances,you need to think in which direction these changes shall shift the atoms.For the extreme value of a large crystal with flat surfaces, you cannotrelax all interatomic distances in the same manner. If the whole surfaceshifts inwards the distances parallel to the surface normal change, whilethe distances parallel to the atoms remain the same. This is the mostsimple model usually encountered in surface structures. In this exercisewe do not have a flat surface but a spherical particle. Thus the relaxationshould occur for all atoms parallel to the surface normal, i.e. parallel tothe vector from the center of the sphere to the atom itself.We will define a few handy variables:

• D, the diameter of the particle.• rcore the radius of the core, which is half the diameter minus the

thickness of the outer shell.• F the relative relaxation, i.e. for F = 1 we have the original dis-

tances and for F =1.02 a 2% increase.

Once the spherical particle is created you must run a loop over all atomsand calculate the distance of the atom from the origin. Only those atomswhose distance is larger than rcore will be relaxed. The radial relaxation isachieved by shifting all shell atoms along a radial vector. For both mod-els, the shift is: Δr = (r − rcore)×F , where r is the distance of the atomfrom the center. Atoms close to the core are shifted by small amounts,atoms close to the surface by larger amounts. For the first model F isconstant throughout the shell, and thus the radial distance between shell

Page 230: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.4 Answers to exercises 219

atoms is constant at a factor F compared to the original distance. Giventhe shift Δr = (r − rcore) × F , the total distance of the atom from theorigin is now r0 = rcore + (r − rcore) × F , which gives the total relativedistance change by dividing this distance by the original distance of theatom from the origin:

r0/r = (rcore + (r − rcore) ∗ F )/r (A.11)

The radial shift of the shell atoms is achieved by multiplying their orig-inal positions, x,y,z by this factor. The solution to the second relaxationmodel is essentially identical. The only change is that the relative relax-ation F is now a linear function of the distance to the core. At the coresurface the effective relaxation Fe is to be 1, and at the particle diameterit is to be equal to F . This gives the linear equation:

Fe = 1 −r − rcore

D/2 − rcore(1 − F ) (A.12)

This effective relaxation factor has to replace F in eqn A.11

Exercise 9.3 : The answer to this exercise is surprisingly simple. All you haveto do is to change the unit cell file hexagonal.cell that was used for thecarbon nanotubes to a file boronnitride.cell with a few changes. Change

title Boron Nitridespcgr P1cell 2.46,2.46,3.00,90.0,90.0,120.0atomsB 0.3333333 0.6666667 0.0000 0.50N 0.6666667 0.3333333 0.0000 0.50

the symmetry from P6 to P1, and adjust the unit cell dimensions. Thenchange the carbon atom to a boron atom and add the nitrogen at position3/2, 1/3, 0. This should give you a file as shown in the margin. Finally,in the macros that write the atom coordinates for plotting, create suitabledefinitions for boron and nitrogen.

Exercise 9.4 : To find the unit cell of a nanotube, the two vectors within thegraphene sheet that build this unit cell must be determined as a functionof (m,n). The first vector is obviously the equatorial vector ma1 + na2 =mah − nbh. The second vector is parallel to the axis vector and thusthese two vectors form a 90◦ angle. To determine analytically the secondvector, remember that the scalar product of two vectors that form a 90◦

angle is zero. Using a reduced form of the two-dimensional hexagonalmetric tensor, where the lattice constant is 1, one obtains:

0 =(

m n)( 1 −1/2

−1/2 1

)(xy

)(A.13)

where (x, y) are the sought components of the vector along the axis. Thisresolves to:

y =n − m/2

n/2 − mx (A.14)

Since both, x and y must be integer numbers, begin by setting x to oneand increment x until y is integer as well.The simulation presented in the main text generated the graphene sheetsymmetrically around the origin large enough to fit the full nanotube.Here the length of one unit cell along the axis is sufficient. The maxi-mum dimension was calculated in the main body of the book from thecoordinates of ±e/2 ± caxis, where the length of the vector caxis was halfthe nanotube axis. For the present exercise, we just take caxis as the trans-lation period along the nanotube and can use the otherwise identical cal-culation. The transformation to cartesian space and the wrap processare also identical. Once the unit cell content is wrapped into a ring we

Page 231: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

220 Appendix

transform cartesian space to a unit cell that encloses the ring. Along thenanotube axis, the unit cell length is exactly the translation period. In themacros, the cartesian b is parallel to the nanotube axis. The unit cell di-mensions normal to the nanotube axis can be chosen flexibly, as long asthe nanotube fully fits into one unit cell. One could even choose a non-orthogonal cell. In the macros the unit cell dimension was set to 1.1 timesthe nanotube diameter d, which gives the transformation from cartesianto the nanotube unit cell axis as:

au

bu

cu

===

d ∗ 1.1 ∗ e1 + 0 ∗ e2 + 0 ∗ e3

0 ∗ e1 + h ∗ e2 + 0 ∗ e3

0 ∗ e1 + 0 ∗ e3 + d ∗ 1.1 ∗ e3

(A.15)

where h is the translation period along the nanotube axis. In order tokeep all atoms within this new unit cell, the old origin should be at (1/2,1/2, 1/2) with respect to the new unit cell vectors. This structure is thensaved as the nanotube unit cell. It can be read and expanded along itsb-axis to a nanotube of any length.

Exercise 9.5 : The major part of the simulation is almost identical to the simu-lation presented in the body of the book and the solution to exercise 9.4.The main differences concern the wrapping of a plane graphene sheetinto the spiral. The radius of a spiral that increases linearly can be writ-ten as:

r = r0 + Δrα

2π(A.16)

where r0 is the initial smallest radius.The length of the circumference of such a spiral is calculated from theintegral along the spiral:

length =

∫ αx

α0

r0 + Δr/α

2πdα (A.17)

=

[r0α + 1/2Δr/

α2

]αx

αx=0

(A.18)

Without loss of generality, the starting angle αx=0 can be set to zero, andthe angle α is calculated as a function of the length:

α = − 2πr0

Δr+

√(2π

r0

Δr

)2

+ 22π length

Δr(A.19)

For each full layer, the angle α increases by 2π, which gives the totallength around the equator of the nanotube as:

length = r02πNL + 1/2Δr2πN2

L (A.20)

Once the graphene layer has been cut to contain one unit cell along thenanotube axis and the full length around the equator, the graphene sheetshould be shifted to start at x=0 and be transformed into cartesian space.In equation A.19, the x-coordinate of each atom replaces length, since theequatorial vector is along the cartesian x-axis. The value of α is then usedto calculate the current radius according to A.16. The x and z coordinatesof each atom are then replaced by:

x = rx sin(αx) (A.21)

z = rx cos(αx) (A.22)

Page 232: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.4 Answers to exercises 221

From here the simulation continues as for Exercise 9.4 The diameter forthe transformation of the current cartesian space into one nanotube unitcell is twice the highest radius of any atom.

Answers Chapter 10

Exercise 10.1 : First when reading the structure, the output on the screen tellsus that we are dealing with a cubic structure with a lattice parameterof a = 2.5 Å. Two simple commands in the chem module of DISCUS

answer this exercise: The command elem determines a crystal size of 20x 20 x 20 containing one atomic site per unit cell. This site is occupiedby copper with a probability of 70% which translates to 30% vacanciesbeing present. The command aver finally determines the average siteposition to be nearly (0, 0, 0) with a standard deviation of 0.08 Å in allthree directions.

Exercise 10.2 : Calculating correlations was discussed in Section 10.5.1. Theonly part that needs some thought is defining the correct neighbors.Calculating correlationsAtom types : A = CU and B = VOIDNeig. AA AB BB # pairs correlation-----------------------------------------------------------------

1 56.14 % 27.80 % 16.06 % 16000 0.33762 55.77 % 28.53 % 15.70 % 16000 0.32033 61.58 % 16.92 % 21.50 % 16000 0.59674 46.59 % 46.90 % 6.51 % 16000 -0.11755 46.19 % 47.70 % 6.11 % 16000 -0.13656 51.40 % 37.28 % 11.32 % 16000 0.11197 51.81 % 36.45 % 11.74 % 16000 0.13158 50.69 % 38.70 % 10.61 % 16000 0.07799 50.95 % 38.17 % 10.88 % 16000 0.0904

10 57.83 % 24.42 % 17.75 % 48000 0.418211 49.60 % 40.87 % 9.53 % 96000 0.0263

The output of DISCUS is shown above. Neighbors 1–3 are the [100], [010]and [001] neighbors respectively. All show a strong positive correlationwith some differences between the symmetrically equivalent directions.Neighbor definitions 4–9 are all the different 〈110〉 directions and herewe can see significant differences, in other words the symmetry of thechemical correlations is not cubic. Neighbors 10 and 11 are all 〈100〉 and〈110〉 directions, respectively. These definitions were used when gener-ating the mystery structure. Here only an overall correlation for near-est and second nearest neighbors was defined resulting in the observedanisotropy of the correlations. This could of course be changed, by usingindividual neighbor definitions as done here.

Exercise 10.3 : There is no higher level function in DISCUS to achieve this task,but use of the command language allows one to perform this task. Thesteps need are as follows:

• Loop over all copper atoms.• Find all nearest neighbors.• Count how many of these are copper atoms.• Change the central atom to a new type as a function of the coordi-

nation.• Export structure for plotting.

When plotting a section of the structure, keep in mind that the coordina-tion or color of the atom will also depend on the neighbors perpendicularto the plotted section.

Page 233: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

222 Appendix

Exercise 10.4 : The solution to this problem is identical to Exercise 10.2, exceptthat rather than calculating correlations, we need to calculate displace-ments. This is done by replacing the command corr in the earlier exer-cise with the command disp. The result is shown here:Calculating distortionsAtom types : A = void and B = cuNeig. Atom A Atom B distance sigma # pairs------------------------------------------------------------

1 VOID(0) CU(1) 2.578 0.071 22242 VOID(0) CU(1) 2.577 0.069 22823 VOID(0) CU(1) 2.564 0.073 13544 VOID(0) CU(1) 3.580 0.328 37525 VOID(0) CU(1) 3.578 0.335 38166 VOID(0) CU(1) 3.570 0.330 29827 VOID(0) CU(1) 3.572 0.326 29168 VOID(0) CU(1) 3.580 0.323 30969 VOID(0) CU(1) 3.580 0.321 3054

10 VOID(0) CU(1) 2.575 0.071 586011 VOID(0) CU(1) 3.577 0.327 19616

The neighbors are defined in the same way as in the answer to Exercise10.2. We observe nearly isotropic displacements in the different direc-tions around vacancies. However, a significant larger standard deviationoccurs in 〈110〉 directions compared to 〈100〉. In our case this is due tothe fact that only 〈100〉 neighbors were used in the simulation to gener-ate this structure, allowing the atoms to distort in other directions (shear)without penalty. Similar information can be extracted for the other atompairs.

Exercise 10.5 : Again we need to use the command language to perform thistask. The steps needed are as follows:

• Loop over all copper atoms.• Calculate the displacement from an average site.• If the displacement is larger than a threshold, change the atom type

and enlarge the displacement by changing its atoms coordinates.• Export structure for plotting.

When plotting a section of the structure, keep in mind that the total dis-placement also has a component perpendicular to the plotted section.This view of the structure amplifies the problem with unrestricted dis-placements in 〈110〉 directions discussed in the last answer.

A.5 DISCUS bibliography[1] J. Breger, K. Kang, J. Cabana, G. Ceder, C.P. Grey, NMR, PDF and RMC study of the

positive electrode material Li(Ni0.5Mn0.5) O-2 synthesized by ion-exchange meth-ods, J. Mat. Chem. 17, 3167 (2007).

[2] Y. P. Chernenkov, N. V. Ershov, V. A. Lukshina, V. I. Fedorov, B. K. Sokolov, An X-raydiffraction study of the short-range ordering in the soft-magnetic Fe-Si alloys withinduced magnetic anisotropy, Physica B 396, 220 (2007).

[3] N. V. Ershov, A. K. Arzhnikov, L. V. Dobysheva, Y. P. Chernenkov, V. I. Fedorov, V. A.Lukshina, Lattice distortions near impurity atoms in alpha-Fe1−xSix alloys, Phys.Solid State 49, 67 (2007).

[4] C. Fan, Y. F. Gao, H. Q. Li, H. Choo, P. K. Liaw, A. Inoue, C. T. Liu, Mechanicalbehavior of a Zr-based bulk metallic glass and its composite at cryogenic tempera-tures, J. Mater. Res. 22, 445 (2007).

[5] L. W. Finger, M. Kroeker, B. H. Toby, DRAWxtl, an open-source computer programto produce crystal structure drawings, J. Appl. Cryst. 40, 188 (2007).

[6] I. E. Grey, N. C. Wilson, Titanium vacancy defects in sol-gel prepared anatase, J.Solid State Chem. 180, 670 (2007).

Page 234: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.5 DISCUS bibliography 223

[7] Q. Hui, M. T. Dove, M. G. Tucker, S. A. T. Redfern, D. A. Keen, Neutron totalscattering and reverse Monte Carlo study of cation ordering in CaxSr1−xTiO3, J.Phys. Condens. Matter 19, 35214 (2007).

[8] S. Kaneko, K. Akiyama, T. Ito, Y. Hirabayashi, K. Seo, H. Funakubo, M. Yoshimoto,Satellite peaks amplified by modulation in bismuth cuprate thin film, Physica C463-465, 935 (2007).

[9] M. Kauffmann, P. Roussel, New oxybromide cobaltites with layered perovskitere-lated structures: 18R-Ba6Co5BrO14 and 14H-Ba7Co6BrO17, Acta. Cryst. B 63, 589(2007).

[10] A. R. Kuznetsov, Y. N. Gornostyrev, N. V. Ershov, V. A. Lukshina, Y. P. Chernenkov,V. I. Fedorov, Atomic diisplacements and short-range order in the FeSi soft magneticAlloy: Experiment and Ab initio calculations, Phys. Solid State 49, 2290 (2007).

[11] M. A. M. Martinez-Inesta, R. F. Lobo, Investigation of the structure of platinumclusters supported in zeolite beta using the pair distribution function, J. Phys. Chem.C 111, 8573 (2007).

[12] A. S. Masadeh, E. S. Bozin, C. L. Farrow, G. Paglia, P. Juhas, S. J. L. Billinge,A. Karkamkar, M. G. Kanatzidis, Quantitative size-dependent structure and straindetermination of CdSe nanoparticles using atomic pair distribution function analy-sis, Phys. Rev. B 76, 115413 (2007).

[13] M. Pasciak, M. Wolcyrz, A. Pietraszko, Interpretation of the diffuse scattering inpb-based relaxor ferroelectrics in terms of three-dimensional nanodomains of the <110 >-directed relative interdomain atomic shifts, Phys. Rev. B 76, 014117 (2007).

[14] V. Petkov, T. Ohta, Y. Hou, Y. Ren, Atomic-scale structure of nanocrystals by high-energy x-ray diffraction and atomic pair distribution function analysis: study offe<sub>x</sub>pd<sub>100-x</sub> (x=0, 26, 28, 48) nanoparticles, J. Phys. Chem.C 111, 714 (2007).

[15] V. I. Simonov, E. M. Burova, B. M. Shchedrin, Determination of nanoparticle struc-ture from diffuse scattering, Crystallography Reports 52, 743 (2007).

[16] D. L. Zeng, J. Cabana, J. L. Breger, W. S. Yoon, C. P. Grey, Cation ordering inLi[NixMnxCo(1-2x)]O-2-layered cathode materials: A nuclear magnetic resonance(NMR), pair distribution function, X-ray absorption spectroscopy, and electrochem-ical study, Chem. Mater. 19, 6277 (2007).

[17] F. Zhang, P. J. Chupas, S. L. A. Lui, J. C. Hanson, W. A. Caliebe, P. L. Lee, S. W.Chan, In situ study of the crystallization from amorphous to cubic zirconium oxide:Rietveld and reverse Monte Carlo analyses, Chem. Mater. 19, 3118 (2007).

[18] A. Aebischer, M. Hostettler, J. Hauser, K. Kramer, T. Weber, H. U. Gudel, H. B.Buergi, Structural and spectroscopic characterization of active sites in a familyof light-emitting sodium lanthanide tetrafluorides, Angew. Chem. Int. Ed. 45, 2802(2006).

[19] N. V. Ershov, Y. P. Chernenkov, V. A. Lukshina, V. I. Fedorov, B. K. Sokolov, Thestructural origin of induced magnetic anisotropy in α-Fe1−xSix (x=0.05-0.08) alloys,Physica B 372, 152 (2006).

[20] C. Fan, P. K. Liaw, V. Haas, J. J. Wall, H. Choo, A. Inoue, C. T. Liu, Structuresand mechanical behaviors of Zr55Cu35Al10 bulk amorphous alloys at ambient andcryogenic temperatures, Phys. Rev. B 74, 014205 (2006).

[21] C. Fan, P. K. Liaw, T. W. Wilson, H. Choo, Y. F. Gao, C. T. Liu, T. Proffen, J. W.Richardson, Pair distribution function study and mechanical behavior of as-castand structurally relaxed Zr-based bulk metallic glasses, Appl. Phys. Lett. 89, 231920(2006).

[22] C. Fan, P. K. Liaw, T. W. Wilson, W. Dmowski, H. Choo, C. T. Liu, J. W. Richardson,T. Proffen, Structural model for bulk amorphous alloys, Appl. Phys. Lett. 89, 111905(2006).

[23] C. Fan, T. W. Wilson, W. Dmowski, H. Choo, J. W. Richardson, E. R. Maxey, P. K.Liaw, Quenched-in quasicrystal medium-range order and pair distribution functionstudy on Zr55Cu35Al10 bulk metallic, Intermetallics 14, 888 (2006).

Page 235: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

224 Appendix

[24] I. K. Jeong, J. K. Lee, Local structure and medium-range ordering in relaxor ferro-electric Pb(Zn1/3Nb2/3)O3 studied using neutron pair distribution function analy-sis, Appl. Phys. Lett. 88, 262905 (2006).

[25] S. Kaneko, K. Akiyama, H. Funakubo, M. Yoshimoto, Strain-amplified structuralmodulation of Bi-cuprate high-Tc superconductors, Phys. Rev. B 74, 054503 (2006).

[26] S. Kaneko, K. Akiyama, Y. Shimizu, Y. Hirabayashi, S. Ohya, H. Funakubo, M. Yoshi-moto, Structural modulation in bismuth cuprate superconductor observed by X-rayreciprocal space mapping, J. Cryst. Growth 287, 483 (2006).

[27] V. A. Lukshina, B. K. Sokolov, N. V. Ershov, Y. P. Chernenkov, V. I. Fedorov,Anisotropy of the local atomic structure in Fe-(5-6 at. crystals as the cause of for-mation and stability of induced magnetic anisotropy, Phys. Solid State 48, 314 (2006).

[28] T. Proffen, Analysis of disordered materials using total scattering and the atomicpair distribution function, Neutron Scattering in Earth Sciences 63, 255 (2006).

[29] V. I. Simonov, E. M. Burova, B. M. Shchedrin, One possibility of determining theatomic structure of nanosized particles using diffuse-scattering data, Jetp Letters 84,73 (2006).

[30] B. Sing, T. R. Welberry, Deformed model sets and distorted Penrose tilings, Z. Krist.221, 621 (2006).

[31] D. Brandell, A. Liivat, A. Aabloo, J. O. Thomas, Molecular dynamics simulation ofthe crystalline short-chain polymer system LiPF6 center dot PEO6 (M-w similar to1000), J. Mat. Chem. 15, 4338 (2005).

[32] J. Breger, N. Dupre, P. J. Chupas, P. L. Lee, T. Proffen, J. B. Parise, C. P. Grey, Short-and long-range order in the positive electrode material, Li(NiMn)0.5O2: A joint X-ray and neutron diffraction, pair distribution function analysis and NMR study, J.Am. Chem. Soc. 127, 7529 (2005).

[33] H. B. Burgi, J. Hauser, Supramolecular architecture in a disordered perhydrotriph-enylene inclusion compound from diffuse X-ray diffraction data, Cryst. Growth Des.5, 2073 (2005).

[34] K. W. Chapman, P. J. Chupas, C. J. Kepert, Direct observation of a transverse vi-brational mechanism for negative thermal expansion in zn(cn)2: An atomic pairdistribution function analysis.

[35] I. K. Jeong, T. W. Darling, J. K. Lee, T. Proffen, R. H. Heffner, J. S. Park, K. S. Hong,W. Dmowski, T. Egami, Direct observation of the formation of polar nanoregionsin Pb(Mg1/3Nb2/3)O3 using neutron pair distribution function analysis, Phys. Rev.Lett. 94, 147602 (2005).

[36] S. Kaneko, K. Akiyama, Y. Shimizu, H. Yuasa, Y. Hirabayashi, S. Ohya, K. Saito,H. Funakubo, M. Yoshimoto, Structural modulation on multilayered bismuthcuprate observed by X-ray reciprocal space mapping, J. Appl. Phys. 97, 103904 (2005).

[37] V. I. Korsunskiy, R. B. Neder, Exact model calculations of the total radial distribu-tion functions for the X-ray diffraction case and systems of complicated chemicalcomposition, J. Appl. Cryst. 38, 1020 (2005).

[38] T. Mehaddene, Inverse Monte Carlo calculation of the effective pair interactions inFePd, J. Phys. Condens. Matter 17, 485 (2005).

[39] T. Mehaddene, O. Adjaoud, R. Kozubski, K. Tanaka, H. Numakura, J. M. Sanchez,C. Issro, W. Pfeiler, V. Pierron-Bohnes, Atomic migration and ordering energies inFePd: Measurement and modeling, Scripta Mater. 53, 435 (2005).

[40] Y. S. Pan, G. Chapuis, Molecular dynamics investigations of modulated phases inorganic materials, Acta. Cryst. A 61, 19 (2005).

[41] S. Bruhne, R. Sterzel, E. Uhrig, C. Gross, W. Assmus, Medium range real atomicstructure of face-centred icosahedral Ho9Mg26Zn65, Z. Krist. 219, 245 (2004).

[42] S. Kaneko, Y. Shimizu, K. Akiyama, T. Ito, M. Mitsuhashi, S. Ohya, K. Saito, H. Fu-nakubo, M. Yoshimoto, Modulation derived satellite peaks in x-ray reciprocal map-ping on bismuth cuprate superconductor film, Appl. Phys. Lett. 85, 2301 (2004).

Page 236: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

A.5 DISCUS bibliography 225

[43] L. Kienle, V. Duppel, A. Simon, M. Schlosser, O. Jarchow, Real structure of KInS2

polytypes, J. Solid State Chem. 177, 6 (2004).

[44] A. Pietraszko, B. Hilczer, C. Caranoni, The space group symmetry of PSN, PST andPSNT ferroelectric relaxors in the superparaelectric phase, Ferroelectrics 298, 235(2004).

[45] T. Proffen, K. L. Page, Obtaining structural information from the atomic pair distri-bution function, Z. Krist. 219, 130 (2004).

[46] C. Schumacher, A. S. Bader, T. Schallenberg, N. Schwarz, W. Faschinger, L. W.Molenkamp, R. B. Neder, X-ray diffraction study and Monte Carlo simulation ofthe relaxation behavior of epitaxially grown wire structures, J. Appl. Phys. 95, 5494(2004).

[47] M. Gardon, C. B. Pinheiro, G. Chapuis, Structural phases ofhexamethylenetetramine-pimelic acid (1/1): a unified description based on astacking model, Acta. Cryst. B 59, 527 (2003).

[48] O. Grassman, R. B. Neder, A. Putnis, P. Lobmann, Biomimetic control of crystalassembly by growth in an organic hydrogel network, Am. Mineral. 88, 647 (2003).

[49] L. Kienle, O. Oeckler, H. Mattausch, V. Duppel, A. Simon, C. Reiner, M. Schlosser,K. Xhaxhiu, H. J. Deiseroth, Real structure of partially ordered crystals, Mater. Sci.Semicond. Process. 6, 393 (2003).

[50] V. I. Korsounski, R. B. Neder, K. Hradil, C. Barglik-Chory, G. Muller, J. Neue-feind, Investigation of nanocrystalline CdS-glutathione particles by radial distri-bution function, J. Appl. Cryst. 36, 1389 (2003).

[51] J. Krawczyk, A. Pietraszko, R. Kubiak, K. Lukaszewicz, Diffuse scattering and short-range order in uranium iodine phthalocyanine [U1−xPc2I2−y and the X-ray struc-ture analysis of crystals with diffuse superstructure reflections, Acta. Cryst. B 59, 384(2003).

[52] N. Masciocchi, S. Brenna, S. Galli, A. Maspero, Ab-initio XRPD structural charac-terization of coordination polymers: the case of [Ag(C3H3N2Cs2], Z. Krist. 218, 450(2003).

[53] R. L. McGreevy, Reverse Monte Carlo modeling, Journal de Physique IV 111, 347(2003).

[54] Y. S. Pan, D. Brown, G. Chapuis, Molecular dynamics simulation of hexamine andsuberic acid, Mol. Simul. 29, 509 (2003).

[55] T. Proffen, S. J. L. Billinge, T. Egami, D. Louca, Structural analysis of complex mate-rials using the atomic pair distribution function - a practical guide, Z. Krist. 218, 132(2003).

[56] L. Vouyovitch, D. Brown, S. Neyertz, B. Gallot, Prediction of the crystalline structureof a novel polythiophene using molecular dynamics simulations, Soft Materials 1, 93(2003).

[57] M. Honal, T. R. Welberry, Monte Carlo study of the quasicrystal-to-crystal trans-formation using an approach based on the Gummelt covering, Z. Krist. 217, 109(2002).

[58] J. Krawczyk, A. Pietraszko, K. Lukaszewicz, Diffuse X-ray scattering and reverseMonte Carlo simulation of the short-range order in ytterbium iodine phthalocyanine[YbPc2]I2, Acta. Cryst. B 58, 622 (2002).

[59] Y. S. Pan, D. Brown, G. Chapuis, Molecular dynamics study of commensurate-incommensurate phases in hexamethylenetetramine suberate, Mater. Res. Soc. Symp.Proc. 731, 261 (2002).

[60] Y. S. Pan, G. Chapuis, D. Brown, Mechanism of the incommensurate phase inhexamethylene-tetramine suberate: A molecular-dynamics study, Phys. Rev. B 65,184205 (2002).

[61] T. Proffen, V. Petkov, S. J. L. Billinge, T. Vogt, Chemical short range order obtainedfrom the atomic pair distribution function, Z. Krist. 217, 47 (2002).

Page 237: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

226 Appendix

[62] B. H. Torrie, O. S. Binbrek, M. Strauss, I. P. Swainson, Phase transitions in solidmethanol, J. Solid State Chem. 166, 415 (2002).

[63] T. Weber, H. B. Burgi, Determination and refinement of disordered crystal structuresusing evolutionary algorithms in combination with Monte Carlo methods, Acta.Cryst. A 58, 526 (2002).

[64] T. R. Welberry, M. Honal, ’Size-effect’-like distortions in quasicrystalline structures,Z. Krist. 217, 422 (2002).

[65] H. B. Burgi, T. Weber, Disorder and motion in crystal structures: Nuisance andopportunities, Chimia 55, 510 (2001).

[66] I. K. Jeong, F. Mohiuddin-Jacobs, V. Petkov, S. J. L. Billinge, S. Kycia, Local structureof InxGa1-xAs semiconductor alloys by high-energy synchrotron X-ray diffraction,Phys. Rev. B 63, 205202 (2001).

[67] T. Malcherek, C. Paulmann, M. C. Domeneghetti, U. Bismayer, Diffuse scatteringanisotropy and the P2(1)/a <-> A2/a phase transition in titanite, CaTiOSiO4 , J.Appl. Cryst. 34, 108 (2001).

[68] R. L. McGreevy, Reverse Monte Carlo modelling, J. Phys. Cond. Mat. 13, R877 (2001).

[69] V. Petkov, S. J. L. Billinge, Local structure of random InxGa1−xAs alloys by full-profile fitting of atomic pair distribution functions, Physica B 305, 83 (2001).

[70] T. Proffen, R. B. Neder, S. J. L. Billinge, Teaching diffraction using computer simula-tions over the Internet, J. Appl. Cryst. 34, 767 (2001).

[71] I. Kaiser, H. Boysen, F. Fery, M. Lerch, D. Hohlwein, R. Schneider, Diffuse scatteringin quaternary single crystals in the system Zr-Y-O-N, Z. Krist. 215, 437 (2000).

[72] T. Proffen, Analysis of occupational and displacive disorder using the atomic pairdistribution function: a systematic investigation, Z. Krist. 215, 661 (2000).

[73] M. Worle, R. Nesper, Infinite, linear, unbranched borynide chains in LiBx - Isoelec-tronic to polyyne and polycumulene, Angew. Chem. Int. Ed. 39, 2349 (2000).

[74] O. Zaharko, A. Cervellino, M. Estermann, P. Schobinger-Papamantellos, Structureof the microdomain boundaries in RFe6Ge6 (R=Tb, Ho or Er) crystals from diffuseX-ray scattering, Phil. Mag. A 80, 27 (2000).

[75] S. Esmaeilzadeh, J. Grins, A. K. Larsson, An electron and X-ray powder diffractionstudy of the defect fluorite structure of Mn0.6Ta0.4O1.65 , J. Solid State Chem. 145, 37(1999).

[76] T. Proffen, S. J. L. Billinge, PDFFIT, a program for full profile structural refinementof the atomic pair distribution function, J. Appl. Cryst. 32, 572 (1999).

[77] W. Sauer, M. Streibl, T. H. Metzger, A. G. C. Haubrich, S. Manus, A. Wixforth, J. Peisl,A. Mazuelas, J. Hartwig, J. Baruchel, X-ray imaging and diffraction from surfacephonons on GaAs, Appl. Phys. Lett. 75, 1709 (1999).

[78] T. Proffen, T. R. Welberry, Analysis of diffuse scattering of single crystals usingMonte Carlo methods, Phase Transitions 67, 373 (1998).

[79] T. R. Welberry, T. Proffen, Analysis of diffuse scattering from single crystals viathe reverse Monte Carlo technique. I. Comparison with direct Monte Carlo, J. Appl.Cryst. 31, 309 (1998).

[80] H. Boysen, Suppression of subsidiary maxima in computer simulations of diffrac-tion intensities, Z. Krist. 212, 634 (1997).

[81] T. Proffen, Analysis of the diffuse neutron and X-ray scattering of stabilised zirconiausing the reverse-Monte-Carlo method, Physica B 241/243, 281 (1997).

[82] T. Proffen, T. R. Welberry, An improved method for analysing single crystal diffusescattering using the reverse Monte Carlo technique, Z. Krist. 212, 764 (1997).

Page 238: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

Index

Acoustic modes, 79Asymmetric unit, 14

Bond angles, 57Bond length distribution, 167Bond valence, 171

Carbon nanotubesMulti walled, 160Single walled, 156

CIF files, 161Cluster, 113Convolution theorem, 48Coordinates

Cartesian, 10Fractional, 9

Correlations, 53Chemical, 55, 57, 168Displacements, 170Fields, 171

Cubic closed packing, 87

Debye formula, 41, 139, 144Debye-Waller factor, 69Deformation faults, 89, 95, 101Discus

Command language, 3Intrinsic functions, 5Macro files, 3Online help, 3Parameters, 3

Domain, 113Shape, 114Type, 114

Electron density, 7Evolutionary algorithms, 181

Differential, 183Uncertainties, 186

Fourier TransformCalulation, 35Coherence, 38FFT, 36Finite size effect, 36Properties, 48

Fuzzy boundary, 116

Growth faults, 88, 94, 97Guest structure, 114

Heptadecane-urea, 128Hexagonal closed packing, 87Hooke’s law, 56Host stucture, 114

Inclusion compounds, 128Intensities

Chemical short range order,62

Powder, 40Single crystals, 35

Ising model, 55

Kinematic approximation, 35

Lattice units, 35Lennard-Jones potential, 56, 122Longitudinal wave, 75, 79

Metric tensor, 26Microdomain, 113Modulations, 69

Commensurate, 69Incommensurate, 69Density, 70Displacive, 75Finite, 80Propagation vector, 75

Molecules, 26, 27227

Page 239: Diffuse Scattering and Defect Structure Simulations_ a Cook Book Using the Program DISCUS

228 INDEX

Monte Carlo Simulations, 54Cycle, 55Temperature, 55

Nanoparticles, 41, 139Core-Shell, 140, 150Tubes, 140, 156

Neighbor definitions, 58

Occupancies, 8, 33, 165Optical modes, 79

Pair Distribution Function, 43R dependent refinement, 178Calculation, 43Correlated motion, 45Experimental, 43Thermal motion, 45

Penrose tiling, 13Periodic boundaries, 62Perovskite, 29, 124Powder diffraction, 39

Quasicrystal, 13

Reciprocal lattice units, 35Refinement

Nanoparticles, 195Short range order, 188

Reverse Monte Carlo, 54

Satellite reflections, 71Scherrer equation, 141Simulated annealing, 55, 67Size effect, 62Space group, 16Stacking fault notations, 90Stacking faults, 142, 145Structure plotting, 161Superstructure, 70Switch displacements mode, 65Symmetry generators, 16Symmetry operators, 15

Teaching aids, 2Thermal diffuse scattering, 69Total scattering, 39Transversal wave, 75, 77

Unit cell, 14

Unit cell transformations, 21

Warren-Cowley parameter, 62,169

Wurtzite structure, 103

Zincblende structure, 103