-
Notifications
You must be signed in to change notification settings - Fork 0
/
thesis.typ
3260 lines (2794 loc) · 185 KB
/
thesis.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#import "@preview/whalogen:0.2.0": ce
#import "@preview/glossarium:0.4.1": make-glossary, print-glossary, gls, glspl
#import "@preview/hydra:0.4.0": hydra
#import "@preview/fletcher:0.4.5" as fletcher: diagram, node, edge
#import "@preview/tablem:0.1.0": tablem
#import "@preview/physica:0.9.3": *
#show: make-glossary
// For glossarium links
#show link: set text(fill: blue.darken(60%))
#let title = "Properties of molecular crystals using machine learning potentials"
#set document(title: title, author: "Mariano Mollo")
#set text(font: "New Computer Modern", size: 12pt)
// Justify paragraphs but not code blocks
#set par(justify: false, first-line-indent: 1em)
#show raw.where(block: true): set par(justify: false)
#set page(
paper: "a4",
margin: (right: 3cm, left: 3.5cm, top: 4.5cm, bottom: 3.5cm),
numbering: "i",
footer: [],
)
#[ // Title page
#set align(center)
#text(1.5em, [*UNIVERSITÀ DEGLI STUDI DI NAPOLI \ "FEDERICO II"*])
#v(3mm)
// University Logo
#image("thesis/imgs/University_Federico_II_Logo.svg", width: 25%)
#v(1cm)
*Scuola Politecnica e delle Scienze di Base*
*Area Didattica di Scienze Matematiche Fisiche e Naturali*
#v(8mm)
*Dipartimento di Fisica "Ettore Pancini"*
#v(20mm)
_Laurea Magistrale Sperimentale in Fisica_
#v(5mm)
#text(1.5em, title)
#v(25mm)
#grid(
columns: 2,
align: (left, right),
column-gutter: 1fr,
row-gutter: 2.5mm,
[*Relatori*], [*Candidato*],
[Prof. Dario Alfè], [Mariano Mollo],
[Prof. Andrea Zen], [Matr. N94000618],
)
#v(5.5mm)
#text(1.2em, "Anno Accademico 2023/2024")
#pagebreak() ]
#place(bottom)[
Mariano Mollo: #emph(title), analyzing water systems with MACE, #sym.copyright October 2024
]
#pagebreak()
#set page(
paper: "a4",
margin: (right: 3cm, left: 3.5cm, top: 3.5cm, bottom: 3.5cm),
numbering: "i",
footer: none,
)
#par(justify: true, first-line-indent: 0pt)[
= Abstract
Molecular crystals play an important role in the field of materials science,
particularly in drug development, electronics, and renewable energy sectors.
In this work, we will use recently developed #glspl("mlp") to model the structure and dynamics of molecular crystals along with their thermodynamic stability, using water as a showcase system.
Water is ubiquitous in nature and of fundamental relevance to physics, biology, geology, materials science and engineering.
Its numerous anomalies, arising from the delicate interplay of hydrogen bonding and dispersion forces, make it a hard test for computational approaches.
Traditional approaches often grapple with the trade-off between computational
expense and accuracy. The application of #glspl("mlp") captures
complex intermolecular interactions with the accuracy of ab initio approaches but at a much cheaper computational cost.
In this work, we will test different @mlp models for the prediction of properties of molecular crystals, including lattice energy, phonons dispersion, and finite temperature dynamics.
#heading(outlined: false, [Sommario])
I cristalli molecolari svolgono un ruolo importante nel campo della scienza dei materiali,
in particolare nello sviluppo di farmaci, nell'elettronica e nelle energie rinnovabili.
In questo lavoro, utilizzeremo #gls("mlp", long: true) sviluppati di recente per modellare la struttura e la dinamica dei cristalli molecolari insieme alla loro stabilità termodinamica, utilizzando l'acqua come caso studio.
L'acqua è ubiquitaria in natura e di fondamentale importanza per la fisica, la biologia, la geologia, la scienza dei materiali e l'ingegneria.
Le sue numerose anomalie, derivanti dalla delicata interazione tra il legame a idrogeno e le forze di dispersione, la rendono un duro banco di prova per gli approcci computazionali.
Gli approcci tradizionali sono spesso alle prese con il compromesso tra costi computazionali e accuratezza.
L'applicazione di #glspl("mlp") cattura le interazioni intermolecolari complesse con l'accuratezza degli approcci ab initio, ma a un costo computazionale molto più basso.
In questo lavoro, testeremo diversi modelli @mlp per la previsione delle proprietà dei cristalli molecolari, tra cui l'energia reticolare, la dispersione dei fononi e la dinamica a temperatura finita.
]
#pagebreak()
#[#show outline.entry.where(level: 1): it => {
v(12pt, weak: true)
strong(it)
}
#outline()
]
#[
// Vorrei troncare le entry troppo lunghe
#show outline.entry: it => {
it
}
#outline(
title: [List of Figures],
target: figure.where(kind: image),
)
]
#outline(
title: [List of Tables],
target: figure.where(kind: table),
)
#outline(
title: [List of Code Blocks],
target: figure.where(kind: raw),
)
#heading(numbering: none, outlined: false, [Glossary])
#print-glossary(
(
(
key: "ase",
short: "ASE",
long: "Atomic Simulation Environment",
),
(key: "md", short: "MD", long: "Molecular Dynamics"),
(key: "dft", short: "DFT", long: "Density Functional Theory"),
(key: "vdw", short: "vdW", long: "van der Waals"),
(key: "mae", short: "MAE", long: "Mean Absolute Error"),
(key: "ml", short: "ML", long: "Machine Learning"),
(key: "mlp", short: "MLP", long: "Machine Learning Potential"),
(key: "pi", short: "PI", long: "Path Integral"),
(key: "pbe", short: "PBE", long: "Perdew-Burke-Ernzerhof"),
(key: "dmc", short: "DMC", long: "Diffusion Monte Carlo"),
(key: "paw", short: "PAW", long: "Projector-Augmented plane Wave"),
(key: "zpe", short: "ZPE", long: "Zero Point Energy"),
(key: "tnqn", short: "T&QN", long: "Thermal and Quantum Nuclear"),
(key: "xdm", short: "XDM", long: "Exchange-hole Dipole Moment"),
(key: "gga", short: "GGA", long: "Generalized Gradient Approximation"),
(key: "csp", short: "CSP", long: "Crystal Structure Prediction"),
(key: "pes", short: "PES", long: "Potential Energy Surface"),
(key: "qti", short: "QTI", long: "Quantum Thermodynamic Integration"),
(key: "vasp", short: "VASP", long: "Vienna Ab initio Simulation Package"),
(key: "xc", short: "XC", long: "Exchange–Correlation"),
(key: "rdf", short: "RDF", long: "Radial Distribution Function"),
(
key: "ccsdt",
short: "CCSD(T)",
long: "coupled cluster theory with singlets, doublets, and perturbative triplets",
),
(key: "cbs", short: "CBS", long: "complete basis set"),
(
key: "hdnnp",
short: "HDNNP",
long: "high-dimensional neural network potential",
),
(key: "mpnn", short: "MPNN", long: "Message Passing Neural Network"),
(key: "gnn", short: "GNN", long: "Graph Neural Network"),
(
key: "ibisco",
short: "IBiSCo",
long: "Infrastructure for BIg data and Scientific Computing",
),
(key: "cnn", short: "CNN", long: "Convolutional Neural Network"),
(key: "adaline", short: "Adaline", long: "ADAptive LInear Neuron"),
(key: "nn", short: "NN", long: "Neural Network"),
(key: "ks", short: "KS", long: "Kohn-Sham"),
(key: "lda", short: "LDA", long: "Local Density Approximation"),
(key: "dos", short: "DOS", long: "Density of States"),
),
show-all: true,
)
#pagebreak()
// https://github.com/typst/typst/discussions/3122
// New first level headings will appear on the right page
// and there will be absolutely nothing on the blank pages
#let find-labels(name) = {
return query(name).map(label => label.location().page())
}
#let page-header = context {
let empty-pages = find-labels(<empty-page>)
let new-chapters = find-labels(<new-chapter>)
if new-chapters.len() > 0 {
if new-chapters.contains(here().page()) [
// _a new chapter starts on this page_
#return
]
// get the index of the next <new-chapter> label
let new-chapter-index = new-chapters.position(page => page > here().page())
if new-chapter-index != none {
let empty-page = empty-pages.at(new-chapter-index)
if empty-page < here().page() [
// _this is an empty page to make the next chapter start on an odd page_
#return
]
}
}
context {
if calc.odd(here().page()) {
align(right, hydra(1))
} else {
align(left, hydra(2))
}
// line(length: 100%)
}
}
#let page-footer = context {
// since the page breaks in chapter-heading() are inserted after the <empty-page> label,
// the selector has to look "before" the current page to find the relevant label
let empty-page-labels = query(selector(<empty-page>).before(here()))
if empty-page-labels.len() > 0 {
let empty-page = empty-page-labels.last().location().page()
// look back at the most recent <new-chapter> label
let new-chapter = query(
selector(<new-chapter>).before(here()),
).last().location().page()
// check that there is no <new-chapter> label on the current page
if (new-chapter != here().page()) and (empty-page + 1 == here().page()) [
// _this is an empty page where the page number should be omitted_
#return
]
}
let page-display = counter(page).display(here().page-numbering())
h(1fr) + page-display + h(1fr)
}
#show heading.where(level: 1): it => [
#[] <empty-page>
#pagebreak(to: "even", weak: true)
#[] <new-chapter>
#pagebreak(to: "odd", weak: true)
#set text(font: "Neo Euler")
#grid(
columns: 2,
inset: (x: 5mm, y: 2mm),
align: horizon + center,
grid.vline(position: end),
[
#set text(size: 48pt)
#counter(heading).display()
],
upper(it.body),
)
#v(2em)
]
#show heading.where(level: 2): it => upper(it)
#show heading.where(level: 3): it => [
#it
#v(4mm)
]
#show heading.where(level: 4): it => [
#it
#v(3mm)
]
#show outline.entry.where(level: 1): it => {
// reverse the results of the label queries to find the last <empty-page> label for the targeted page
// the method array.position() will always return the first one...
let empty-pages = find-labels(<empty-page>).rev()
let new-chapters = query(<new-chapter>).rev()
let empty-page-index = empty-pages.position(page => page == int(it.page.text))
let new-chapter = new-chapters.at(empty-page-index)
link(
new-chapter.location(),
)[#it.body #box(width: 1fr)[#it.fill] #new-chapter.location().page()]
}
#set page(header: page-header, footer: page-footer, numbering: "1")
#counter(page).update(1)
// Qui iniziano i contenuti della tesi
#set heading(numbering: "1.1")
#set par(justify: true)
#set math.equation(numbering: "(1)")
#let large_figure(content, caption: none) = figure(
box(width: 125%, content),
caption: caption,
)
#let large_box(content) = align(
center,
box(
width: 125%,
content,
),
)
= Introduction
Molecular crystals represent a significant area of study within materials science due to their diverse applications in fields such as pharmaceuticals, electronics, and renewable energy.
Computational approaches play an important role in molecular crystals research, as their application can aid experiments toward prediction of stable phases with targeted properties.
In drug development, for instance, the properties of molecular crystals directly influence the effectiveness and delivery of medications, as exemplified in @fig:paracetamol-tableting. @blagdenCrystalEngineeringActive2007
Beyond pharmaceuticals, these materials are key to advancing technologies involving semiconductors and energy storage systems, given their tunable electronic and optical properties. @reddyMechanicalPropertiesMolecular2010 @martinsTemperaturePressureInducedProton2009 @karkiImprovingMechanicalProperties2009 @reillyUnderstandingRoleVibrations2013
#figure(
image("thesis/imgs/karki2009_graphical_abstact.jpg", width: 50%),
caption: [
Poor mechanical properties of paracetamol are improved through the strategy of cocrystal formation.
Graphical Abstract taken from @karkiImprovingMechanicalProperties2009.
],
) <fig:paracetamol-tableting>
Despite the critical importance @priceComputationalPredictionPharmaceutical2004 of understanding and predicting the properties of molecular crystals, traditional computational approaches face challenges in balancing accuracy with computational cost.
Methods such as @dft offer accurate insights into molecular interactions but are prohibitively expensive for large-scale simulations.
Conversely, classical force field methods scale well but often lack the precision needed for complex systems.
This trade-off has driven the exploration of alternative methods that combine the best of both worlds.
#figure(
image("thesis/imgs/images_large_cr0c00868_0001.jpeg", width: 80%),
caption: [
From @behlerFourGenerationsHighDimensional2021[Figure 1].
Pyramid of potentials for atomistic simulations illustrated for the example of water and aqueous systems.
Using high-level wave function-based methods as represented by Ψ only the geometries of small systems such as water clusters in vacuum are accessible, while DFT is the standard method to determine simple properties such as RDFs of liquid water in ab initio molecular dynamics simulations.
Very large-scale simulations of complex systems such as electrolytes or solid−liquid interfaces, or the determination of complex thermodynamic properties, can only be carried out using atomistic potentials such as forcefields.
Also MLPs allow the study of these systems.
],
)
Recently, #glspl("mlp") have emerged as a promising solution.
These approaches leverage on advanced neural network architectures to model the potential energy surfaces of molecular systems with a level of accuracy comparable to ab initio methods but at a fraction of the computational cost.
By training on existing quantum mechanical data, #glspl("mlp") can predict intermolecular interactions and dynamic behaviours with high fidelity, making them suitable for studying complex systems like molecular crystals.
@batatiaFoundationModelAtomistic2023
@schranMachineLearningPotentials2021
@bjorneholmWaterInterfaces2016
@kapilCompleteDescriptionThermodynamic2022
Since their introduction about 25 years ago, #glspl("mlp") have become an important tool in the field of atomistic simulations.
After the initial decade, in which neural networks were successfully used to construct potentials for rather small molecular systems, the development of #glspl("hdnnp") in 2007 opened the way for the application of ML potentials in simulations of large systems containing thousands of atoms.
@behlerFourGenerationsHighDimensional2021
Depending on the specific task it has been estimated that mixed ab initio and @mlp calculations require between three and ten times less the core hours of purely ab initio methods @kapilCompleteDescriptionThermodynamic2022[p. 5], while state of the art #glspl("mpnn", long: true) achieve speedups of up to $10^5$ times less the compute time on the prediction of physical properties of molecules (see @fig:mpnn-speedup).
#figure(
image("thesis/imgs/gilmerNeuralMessagePassing2017_Figure1.png"),
caption: [
A Message Passing Neural Network predicts quantum properties of an organic molecule by modeling a computationally expensive DFT calculation.
Image taken from @gilmerNeuralMessagePassing2017.
],
) <fig:mpnn-speedup>
This thesis investigates the capabilities of #glspl("mlp"), with a specific focus on modeling the properties of water as a molecular crystal.
Water is ubiquitous in nature and, as stated above, of fundamental relevance to physics, biology, geology, materials science, and engineering, that serves as an ideal test case due to its well-documented polymorphic behaviours and the wealth of literature available for benchmarking. @schranMachineLearningPotentials2021 @chengInitioThermodynamicsLiquid2019
Studying its numerous anomalies---arising from the delicate interplay of hydrogen bonding and dispersion forces---is a challenge for computational approaches, and allows us to discover new physics and advance various scientific applications.
The research primarily explores the accuracy of #glspl("mlp") in predicting molecular structural stabilities, lattice energies of different ice polymorphs, and dynamical properties of crystals, such as phonon spectra.
// TODO kapil 29 : V. Kapil, E. Engel, M. Rossi, M. Ceriotti, Assessment of approximate methods for anharmonic free energies. J. Chem. Theory Comput. 15, 5845–5857 (2019).
Despite significant advancements, state-of-the-art #glspl("mlp") still suffer from several limitations, such as the large amount of data needed for training and the limited number of chemical species that can be included in the model.
However, extremely recent @mlp architectures, such as MACE, have made overcoming these limitations possible, leading to the development of foundational models for chemistry and materials science. @batatiaFoundationModelAtomistic2023 @dengCHGNetPretrainedUniversal2023 @liKohnShamEquationsRegularizer2021 @cheonDatasetRandomRelaxations2023
The following chapters will introduce the theoretical foundations and the tools needed to pursue this question.
@sec:theory briefly describes the physical priciples and the algorithms on which #glspl("mlp") like MACE are built onto.
@sec:results-1 and @sec:results-2 show the results obtained through the test of the new MACE calculator on known atomic configurations and discuss its performances.
@sec:tools details the tools employed to run the computer simulation experiments;
the algorithms section, @sec:mace, mirrors and details the practical implementation of the objects first outlined in @sec:gnn.
= Theory <sec:theory>
In this chapter, we explore the theoretical background and methodologies that underpin the analysis of molecular crystals using #glspl("mlp", long: true).
The study of molecular crystals involves various computational and physical models that allow us to predict their structure, dynamics, and thermodynamic stability.
The chapter is orgnanized into several key areas:
#let threed-harmonic-solids-title = "Three dimensional harmonic crystalline solids"
#let dft-title = "Density Functional Theory"
#let md-title = "Molecular Dynamics"
#let thermodynamics-crystal-stability-title = "Thermodynamics of crystal stability"
#let machine-learning-title = "Machine Learning"
#let gnn-title = "Graph Neural Networks"
- #strong(threed-harmonic-solids-title), @sec:3d-harmonic-solids:
We introduce the harmonic approximation for crystalline solids and explain its relevance to modelling vibrational properties through normal modes, focusing on phonons and their contribution to the Helmholtz energy.
- #strong(dft-title), @sec:dft:
@dft serves as the core quantum mechanical approach used to compute the electronic properties and structural optimizations of materials.
Here, we describe its formulation and the Kohn-Sham method for solving the many-body Schrödinger equation.
- #strong(md-title), @sec:md:
This section covers the simulation of atomic and molecular motion using classical mechanics.
We explain the Verlet algorithm, thermostats for temperature control, and how these methods help model the dynamic behaviour of molecular systems at finite temperatures.
- #strong(thermodynamics-crystal-stability-title), @sec:thermodynamics-crystal-stability:
We detail the calculation of lattice energy, which measures the stability of crystals, and discuss the important role of dispersion interactions, including methods like DFT-D3, in capturing non-covalent forces in crystalline systems.
- #strong(machine-learning-title), @sec:machine-learning:
Machine Learning techniques, particularly neural networks, are introduced as modern tools for predicting molecular properties with reduced computational cost.
We explore single-layer and multi-layer neural network architectures and their training processes.
- #strong(gnn-title), @sec:gnn:
As an advanced form of neural networks, #glspl("gnn") are discussed, with emphasis on how they enable message-passing architectures for modelling molecular systems.
We describe how #glspl("gnn") can be employed to capture atomic interactions in a computationally efficient manner.
Each section provides the necessary theoretical foundation for understanding the subsequent results and discussions, with a focus on applying these methods to study the properties of molecular crystals and, specifically, ice polymorphs.
The content found from @sec:3d-harmonic-solids to @sec:md, is significantly based upon the lecture notes on Statistical and Computational Physics, by D. Alfè, studied during my masters degree. @alfeNotesStatisticalComputational2023
== #threed-harmonic-solids-title <sec:3d-harmonic-solids>
The crystal can be described by a collection of independent harmonic oscillators with potential energy:
$
U = U_0 + sum_(i=1)^(3N) 1 / 2 M omega_i^2 q_i^2,
$ <eq:termcomp-7.1>
where $M$ is the mass of the particles, $q_i$ a set of _normal coordinates_, and $U_0$ the energy of the system in its ground state.
This approximation is known as the _harmonic approximation_.
The Newton's equations of motion for the normal coordinates are:
$
M dv(q_i, t, 2) = - pdv(U, q_i) = - M omega_i^2 q_i.
$
Consider a three dimensional system made of particles arranged on a _periodic lattice_, at equilibrium positions ${va(r^0)} := va(r_1^0), dots, va(r_N^0), dots$.
This _Bravais lattice_ is completely defined by a set of three _lattice vectors_, $va(a_1), va(a_2), va(a_3)$, and every point on the lattice can be obtained as:
$
va(r_j^0) = n va(a_1) + m va(a_2) + l va(a_3),
$
where $j$ is a shorthand for the three integers $n, m, l$.
We also define the _reciprocal lattice vectors_:
$
va(b_1) := 2 pi (va(a_2) times va(a_3)) / V, quad
va(b_2) := 2 pi (va(a_3) times va(a_1)) / V, quad
va(b_3) := 2 pi (va(a_1) times va(a_2)) / V,
$
where $V := (va(a_1) times va(a_2)) dot va(a_3)$ is the volume of the _primitive cell_.
This is the smallest unit of volume that can be periodically repeated to fill the whole space, and clearly it can be constructed in multiple (infinite) ways.
A convenient construction is the _Wigner-Seitz_ primitive cell, which is the locus of points in space closer to a particular lattice point than to any other lattice point;
this procedure is the application of Voronoi decomposition to a crystal lattice.
The reciprocal lattice vectors span the _reciprocal space_, which is also a periodic lattice with points at positions:
$
va(g) := n' va(b_1) + m' va(b_2) + l' va(b_3),
$
with $n', m', l'$ integer numbers.
The Wigner-Seitz cell in reciprocal space is called the _first Brillouin zone_.
The reciprocal vectors and the lattice vectors satisfy the orthogonality relations:
$
va(b_i) dot va(a_j) = 2 pi delta_(i j).
$
Each lattice site does not need to be occupied by just one particle; indeed, the generalization to crystals with more than one particle per lattice site is straightforward.
Let $U_({va(r^0)}) ({va(r)})$ be the potential energy function, defined by the interacting particles when they are in their equilibrium positions ${va(r^0)}$.
With this we mean that if we displace the particles by amounts $va(u_i) := va(r_i) - va(r_i^0)$, we assume that these displacements are not changing the functional form of the potential, but only the computed value changes.
This assumption can only be valid if the displacements ${va(u)}$ are small.
An extreme case where this cannot possibly hold is when the atoms move so much that the crystal assumes a different crystal structure, or it melts.
For zero displacements, when all particles are in their equilibrium positions, the potential energy can be computed from knowledge of the lattice vectors only, i.e., one only needs information about the primitive cell.
If instead the particles are displaced from their equilibrium positions, then we need the positions of all of them.
For small enough displacements ${va(u)}$ the potential energy can be expanded around its minimum, where all particles are in their equilibrium positions ${va(r^0)}$:
$
U({va(r)})
= U_0
+ 1 / 2 sum_(i,j) va(u_i) dot Phi (
va(r_i^0) - va(r_j^0)
) dot va(u_j) + cal(O)(u^3),
$
where $U_0 := U({va(r^0)})$, and the linear term is absent because we are expanding around the minimum of the potential.
The _force constants matrix_ $Phi$ is defined as:
$
Phi (va(r_i^0) - va(r_j^0)) := (
pdv(U({va(r)}), va(r_i), va(r_j))
)_(va(r_i) = va(r_i^0) \ va(r_j) = va(r_j^0))
= mat(
phi_(i j)^(x x), phi_(i j)^(x y), phi_(i j)^(x z);
phi_(i j)^(y x), phi_(i j)^(y y), phi_(i j)^(y z);
phi_(i j)^(z x), phi_(i j)^(z y), phi_(i j)^(z z);
) \
phi_(i j)^(alpha beta) = pdv(U({va(r)}), alpha_i, beta_i),
$ <eq:force-constants-matrix>
where $alpha_i$ and $beta_j$ run over the three cartesian components of $va(r_i^0)$ and $va(r_j^0)$.
If the displacements are not too large and the $cal(O)(u^3)$ terms can be ignored, the force acting on particle at position $va(r_i^0)$ due to the displacements $va(u_j)$ of all particles in the system, including $va(u_i)$, is:
$
va(f_i) = -sum_j Phi(va(r_i^0) - va(r_j^0)) dot va(u_j).
$
The dependence of the force constants matrix on the difference $va(r_i^0) - va(r_j^0)$ rather than on $va(r_i^0)$ and $va(r_j^0)$ separately is due to translational invariance.
The force constants matrix satisfies other important properties:
+ $Phi(va(r_i^0) - va(r_j^0)) = Phi(va(r_j^0) - va(r_i^0))$, which is implied by the fact that the double derivative in @eq:force-constants-matrix is invariant upon changing the order of differentiation.
+ $sum_j Phi(va(r_j^0)) = 0$. This property can be understood by imagining to displace the whole crystal rigidly by some vector $va(c)$.
Clearly, such a displacement cannot affect the forces acting on the particles, because the relative differences between them are unaffected by the translation, and so we must have $va(f_i) = -sum_j Phi(va(r_i^0) - va(r_j^0)) dot va(u_j) = -sum_j Phi(va(r_i^0) - va(r_j^0)) dot (va(u_j) + va(c))$.
Therefore, $sum_j Phi(va(r_i^0) - va(r_j^0)) dot va(c) = 0$.
Since this is independent on the particular choice of $va(r_i^0)$ and $va(c)$, we must have $sum_j Phi(va(r_j^0)) = 0$.
We can obtain the normal modes of the system and show that the potential energy is given by the sum of squares of the normal modes.
To obtain the dispersion relation, consider the Newton's equation of motion for a particle at one particular lattice position, $va(r_i^0)$:
$
M dv(va(u_i), t, 2) = va(f_i).
$ <eq:termcomp-7.54>
The motion of the particle around its equilibrium position can be described by the form:
$
va(u_i)(t) prop va(epsilon) e^(i (va(q) dot va(r_i^0) - omega t)),
$ <eq:termcomp-7.55>
where $va(epsilon)$ is a _polarization vector_, which defines the direction of oscillation of the particle, and $va(q)$ is a _wave vector_.
The physical motion of the particles is obtained by taking the real part of @eq:termcomp-7.55.
Substituting @eq:termcomp-7.55 into @eq:termcomp-7.54 we obtain:
$
M omega^2 va(epsilon)
= sum_j e^(i va(q) dot (
va(r_j^0) - va(r_i^0)
)) Phi(va(r_i^0) - va(r_j^0)) dot va(epsilon).
$ <eq:termcomp-7.56>
The sum over $j$ runs over all lattice sites, and so it is independent on our choice of $va(r_i^0)$.
We can therefore choose $va(r_i^0) = va(0)$ and replace the difference $va(r_j^0) - va(r_i^0)$ simply with $va(r_j^0)$.
=== Phonons
If we introduce
the _dynamical matrix_:
$
D(arrow(q)) :=
1 / M sum_j e^(i arrow(q) dot arrow(r)_j^0) Phi(arrow(r)_j^0)
$ <eq:dynamical-matrix>
we can rewrite @eq:termcomp-7.56 as:
$
omega^2 arrow(epsilon) = D(arrow(q)) dot arrow(epsilon)
$ <eq:dynamical-matrix-eigenvalue-problem>
The transformation in @eq:dynamical-matrix is also known as a _lattice Fourier transform_.
Note that it is sufficient to define the dynamical matrix in the first Brillouin zone, because any vector in reciprocal space can be written as the sum of a vector in the Brillouin zone plus a reciprocal lattice vector.
We have:
$
e^(i (va(q) + va(g)) dot va(r_j^0))
= e^(i va(q) dot va(r_j^0)) e^(i va(g) dot va(r_j^0))
= e^(i va(q) dot va(r_j^0)),
$
because:
$
va(g) dot va(r_j^0) = (n n' + m m' + l l') 2 pi,
$
and so the dynamical matrix has the same periodicity of the reciprocal lattice.
The property $sum_j Phi(va(r_j^0)) = 0$ implies $D(va(0)) = va(0)$; therefore, the dispersion relation gives zero frequencies at zero wavevector.
This _sum rule_ is very useful as a practical sanity check of the consistency of the calculations.
To solve @eq:dynamical-matrix-eigenvalue-problem we need to solve an eigenvalue problem.
We need to find a reference frame in which the matrix $D(va(q))$ is diagonal.
The elements of the diagonal, $omega_(va(q), s)^2$, with $s in {1,2,3}$ representing the _branch number_, are the _eigenvalues_, and the three vectors $va(epsilon_(va(q), s))$, the polarizations of the normal modes, are the _eigenvectors_ that define the reference frame.
Each normal mode represents a collective oscillation of the particles in the system with frequency $omega_(va(q), s)$.
These collective oscillations are called _phonons_.
The potential energy can be written in the form in @eq:termcomp-7.1 and so the partition function has the form of either @eq:termcomp-7.7 or @eq:termcomp-7.10, depending on if the system is treated classically or quantum-mechanically:
$
Z = e^(-beta U_0) product_(i=1)^(3N) (k_B T) / (planck.reduce omega_i), quad "in the classical limit",
$ <eq:termcomp-7.7>
and
$
Z = e^(-beta U_0) product_(i=1)^(3N) Z_i, quad "in the quantum description",
$ <eq:termcomp-7.10>
with each term in the product having the form:
$
Z_i = sum_(n=0)^infinity e^(-E_n^i / (k_B T))
= sum_(n=0)^infinity e^(- (n + 1 / 2) (planck.reduce omega_i) / (k_B T))
= (e^(-1 / 2 (planck.reduce omega_i) / (k_B T))) / (1 - e^(- (planck.reduce omega_i) / (k_B T))).
$
=== The Helmholtz energy
// Da §4 relazione termodinamica computazionale
The harmonic contribution of phonons to the Helmholtz energy per atom is represented by the equation:
$
&F_"harm" (V,T) = \
=&
1 / Omega integral_Omega sum_(s=1)^3 (planck.reduce omega_(arrow(q),s)) / 2 dif q
+ k_B T 1 / Omega integral_Omega sum_(s=1)^3 ln(1-exp(-(planck.reduce omega_(arrow(q),s))/(k_B T))) dif q
$
In the high temperature limit, defined by $(planck.reduce omega_(arrow(omega), s))/(k_B T) << 1$, the harmonic term reduces to the classical expression:
$
F_"harm"^c = (k_B T) / Omega integral_Omega sum_(s=1)^3 ln((planck.reduce omega_(arrow(q),s))/(k_B T)) dif q
$
For computation efficiency purposes, the integrals above are approximated with a sum running on points sampled in the Brillouin zone, denoted by BZ in the sum:
$
1 / Omega integral dif q approx 1 / (N_(arrow(q))) sum_(arrow(q) in "BZ")
$
Using this approximation, the Helmholtz energy per atom becomes:
$
F (V,T)
&= U_0(V) \
&+ 1 / (N_va(q)) sum_(s=1)^3 sum_(va(q)) [
(hbar omega_(va(q),s) (V)) / 2
+ k_B T ln(
1 - exp(
- (hbar omega_(va(q), s) (V)) / (k_B T)
)
)
],
$ <eq:termcomp-7.63>
with $U_0$ the energy per atom of the system in its ground state.
In the classical limit, the expression becomes:
$
F_"classical" (V,T) = U_0(
V
) + (k_B T) / (N_va(q)) sum_(s=1)^3 sum_(arrow(q)) ln (
planck.reduce omega_(arrow(q),s)(V)) / ( k_B T
)
$ <eq:termcomp-7.64>
The sum over $va(q)$ runs over all vectors in the Brillouin zone, which are infinite for a Bravais lattice that contains an infinite number of sites.
Indeed, the Helmholtz energy of a crystal with an infinite number of particles would also be infinite.
The physical quantity of interest is indeed the Helmholtz energy per particle; this is the reason why the sums in @eq:termcomp-7.63 and @eq:termcomp-7.64, using a finite grid of $N_(va(q))$ points in the Brillouin zone and dividing the total Helmholtz energy by $N_(va(q))$, yield finite values.
Both the ground state energy and the frequencies explicitly depend on the volume $V$.
The relationship linking the frequencies with volume and temperature is responsible for the different temperature dependence of the Helmholtz energy at different volumes; these terms cause the phenomenon of thermal expansion in solids.
=== The small displacement method <sec:small-displacement-method>
// Vedi anche §3.4.2 Della Pia, §7.1.3 Alfè
Let us consider the crystal in the ground state and displace one particle from its equilibrium position.
Let the displacement be along the $x$ axis, $arrow(u) := (u, 0, 0)$.
The forces acting on all particles in the system, including the displaced one, are given by:
$
(f_i^x, f_i^y, f_i^z)
= -Phi(arrow(r)_i^0) dot (u, 0, 0)
= -u vec(phi_(0i)^(x x), phi_(0i)^(y x), phi_(0i)^(z x))
$
from which we obtain the first columnt of the force constant matrix:
$
phi_(0i)^(x x) = - f_i^x / u, quad
phi_(0i)^(y x) = - f_i^y / u, quad
phi_(0i)^(z x) = - f_i^z / u
$
To obtain the other columns, we need to repeat the procedure with displacements $(0,u,0)$ and $(0,0,u)$.
A set of three forces calculations is sufficient to compute the full force constants matrix.
In practical calculations, it is not possible to include all the infinite particles of a lattice;
therefore, we use a procedure that approximates the evaluation of the force constants matrix, with an error that can be systematically reduced.
We consider a _supercell_, which is an integer multiple of the primitive cell in the three spatial directions. We can define three multiplicative integers, one for each direction, $i,j,k$.
Named $arrow(a)_1, arrow(a)_2, arrow(a)_3$ the lattice vectors of the primitive cell,
the periodicity of the supercell is described by the multiplied lattice vectors:
$
arrow(A)_1 := i arrow(a)_1, quad
arrow(A)_2 := j arrow(a)_2, quad
arrow(A)_3 := k arrow(a)_3
$
The reciprocal lattice vectors of the supercell are defined as follow:
$
arrow(B)_1 := 2 pi (arrow(A)_2 times arrow(A)_3) / V, quad
arrow(B)_2 := 2 pi (arrow(A)_3 times arrow(A)_1) / V, quad
arrow(B)_3 := 2 pi (arrow(A)_1 times arrow(A)_2) / V,
$
with $V := (arrow(A)_1 times arrow(A)_2) dot arrow(A)_3$ as the volume of the supercell.
Following the periodicity of the finite supercell,
the displacement by an amount $arrow(u)$ of one particle
causes the displacement of all its periodic images too,
located at positions
$arrow(L) := n arrow(A)_1 + m arrow(A)_2 + l arrow(A)_3$,
with $n,m,l$ any three integers.
The obtained forces are:
$
arrow(f)_i
= - sum_(arrow(L)) Phi (arrow(r)_i^0 + arrow(L)) dot arrow(u)
$
where the sum runs over all possible $arrow(L)$ vectors distancing different supercells.
We do not have direct access to the elements of $Phi(arrow(r)_i^0)$,
but only to the force constants matrix of the supercell, defined as:
$
Phi_"SC" (arrow(r)_i^0)
:= sum_(arrow(L)) Phi (arrow(r)_i^0 + arrow(L)).
$ <eq:force-constants-matrix-supercell>
This also implies that it is impossible to obtain the exact dynamical matrix,
which requires knowledge of every element of the force constants matrix.
We can rewrite @eq:dynamical-matrix as:
$
D(arrow(q))
&= 1 / m sum_j sum_arrow(L) e^(i arrow(q) dot (
arrow(r)_j^0 + arrow(L)
)) Phi(arrow(r)_j^0 + arrow(L)) \
&= 1 / m sum_j e^(i arrow(q) dot arrow(r)_j^0)
sum_arrow(L) e^(i arrow(q) dot arrow(L))
Phi(arrow(r)_j^0 + arrow(L))
$
with the sum over $j$ running on the lattice sites $arrow(r)_j^0$ belonging to the supercell.
Consider now the term $sum_arrow(L) e^(i arrow(q) dot arrow(L)) Phi(arrow(r)_j^0 + arrow(L))$ and compare it with @eq:force-constants-matrix-supercell.
For every $arrow(q)$ such that $e^(i arrow(q) dot arrow(L)) = 1$ we obtain:
// TODO definisci vettori del reticolo
// TODO definisci matrice dinamica
// TODO finisci teoria
$
D(arrow(q))
= 1 / m sum_j e^(i arrow(q) dot arrow(r)_j^0) Phi_("SC")(arrow(r)_j^0)
$
Since $Phi_"SC"$ can be calculated,
at these particular $arrow(q)$ vectors the dynamical matrix is exact.
We can carachterize these special $arrow(q)$ vectors as the linear combinations of the reciprocal vectors of the supercell with integer coefficients $n',m',l'$.
We can verify this statement calculating, given $arrow(q) := n' arrow(B)_1 + m' arrow(B)_2 + l' arrow(B)_3$
and $arrow(L) := n arrow(A)_1 + m arrow(A)_2 + l arrow(A)_3$,
$arrow(q) dot arrow(L) = (n n' + m m' + l l') 2pi$,
which yields $e^(i arrow(q) + arrow(L)) = 1$.
Increasing the size of the supercell, the Brillouin zone is populated with more exact phonons;
inbetween those points we obtain a _Fourier interpolation_,
which becomes more and more accurate as we increase the size of the supercell.
Eventually, the supercell is so large that the force constants matrix is negligible at its edges;
when this happens, the only term contributing appreciably in the sum in @eq:force-constants-matrix-supercell is that with $arrow(L) = arrow(0)$;
as we increase the size of the supercell, the supercell force constants matrix asymptotically approaches the force constants matrix,
$Phi_"SC" (arrow(r)_i^0) tilde.eq Phi(arrow(r)_i^0)$.
In this limit, the Fourier interpolation is accurate everywhere.
== #dft-title <sec:dft>
#gls("dft", long: true) is in principle an exact formulation of the many-body electron problem, in terms of the ground state density of the electrons rather than the ground state wavefunction.
One of its numerous applications is the determination of structural and electronic properties of materials in solid-state physics.
In this thesis, the @dft calculations are performed with the #gls("vasp", long: true). @kresseInitioMolecularDynamics1993 @kresseEfficiencyInitioTotal1996 @kresseEfficientIterativeSchemes1996
Here, we briefly describe the underlying theory of @dft.
Given the wavefunction $Psi (va(r_1), dots, va(r_N))$ and the Hamiltonian $hat(H)$ of the time-independent many-body Schrödinger equation for a system of $N$ electrons, not including spin variables, $hat(H) Psi (va(r_1), dots, va(r_N)) = E Psi (va(r_1), dots, va(r_N))$, the Hamiltonian is given by the sum of the kinetic, external potential, and electron-electron operators, $hat(H) = hat(T) + hat(V)_"ext" + hat(V)_"ee"$, defined by:
$
hat(T) Psi (va(r_1), dots, va(r_N))
:= - 1 / 2 sum_(i=1)^N laplacian_i Psi (va(r_1), dots, va(r_N)),
$
$
hat(V)_"ext" Psi (va(r_1), dots, va(r_N))
:= sum_(i=1)^N v(va(r_i)) Psi (va(r_1), dots, va(r_N)),
$
with $v(va(r_i))$ the value of the external potential felt by electron $i$ at position $va(r_i)$, and
$
hat(V)_"ee" Psi (va(r_1), dots, va(r_N))
:= sum_(i,j=1 \ i<j) 1 / (|va(r_i) - va(r_j)|) Psi (va(r_1), dots, va(r_N)).
$
If the wavefunction $Psi$ is normalized over the volume of the system $V$,
$
integral_V dif^3 va(r_1) dots dif^3 va(r_N)
Psi^star (va(r_1), dots, va(r_N)) Psi (va(r_1), dots, va(r_N))
= 1,
$
then the energy $E$ is obtained from:
$
E =
integral_V dif^3 va(r_1) dots dif^3 va(r_N) Psi^star (
va(r_1), dots, va(r_N)
) hat(H) Psi (va(r_1), dots, va(r_N))
$
Computing the electron density gives:
$
rho(va(r)) = N integral_V dif^3 va(r_2) dots dif^3 va(r_N) |Psi(va(r), va(r_2), dots, va(r_N))|^2.
$ <eq:electron-density>
The total potential energy due to the external potential is a _functional_ of the electron density, which we indicate with the notation $V_"ext" [rho]$:
$
V_"ext" &=
integral_V dif^3 va(r_1) dots dif^3 va(r_N) Psi^star (va(r_1), dots, va(r_N))
sum_(i=1)^N v(va(r_i))
Psi (va(r_1), dots, va(r_N)) \
&= sum_(i=1)^N integral_V dif^3 va(r_1) dots dif^3 va(r_N) Psi^star (
va(r_1), dots, va(r_N)
) v(va(r_i)) Psi (va(r_1), dots, va(r_N)).
$
Since the electrons are all identical, these integrals are also all identical, each one equal to:
$
integral_V dif^3 va(r) dif^3 va(r_2) dots dif^3 va(r_N)
Psi^star (va(r_1), dots, va(r_N)) v(va(r)) Psi (va(r_1), dots, va(r_N)).
$
Since we have $N$ of them, we obtain:
// Alfè, eq. (8.11)
$
V_"ext"
= N integral_V dif^3 va(r) dif^3 va(r_2) dots dif^3 va(r_N)
Psi^star (va(r_1), dots, va(r_N)) v(va(r)) Psi (va(r_1), dots, va(r_N))
$
This shows, comparing with @eq:electron-density, that the potential energy due to the external potential is a _functional_ of the electron density:
$
V_"ext" [rho] = integral_V dif^3 va(r) rho(va(r)) v(va(r)).
$
=== The Hohenberg-Kohn theorems
In the Schrödinger approach, both $Psi$ and $rho_0 (va(r))$ are functionals of $v(va(r))$.
The *Hohenberg-Kohn theorems* @hohenbergInhomogeneousElectronGas1964 state that $V_"ext" [rho_0]$, where $rho_0$ is the ground state density, and $Psi_0$, the ground state wavefunction of the system, and thus all the physical properties of the system, are _unique_ functionals of $rho_0$.
In particular, without giving formal proof here, we say that the ground state energy, $E_0$, is a functional of $rho_0$, as well as the kinetic and electron-electron interaction contributions:
$ // Alfè, eq. (8.17)
E_0 = E[rho_0] = T[rho_0] + V_"ee" [rho_0] + V_"ext" [rho_0].
$
The functional $ F[rho] := T[rho] + V_"ee" [rho] $ does not depend on the external potential, and therefore it is a _universal_ functional of the density.
=== The Kohn-Sham method
Unfortunately, the explicit dependence of the $F[rho]$ functional with respect to $rho(va(r))$ is unknown;
so, an exact solution is not possible.
Kohn and Sham extracted from the universal functional $F[rho]$ the classical Coulombian energy, defining the functional:
$ // Della Pia, eq. 3.32
G[rho] := F[rho] - 1/2 integral (rho(va(r)) rho(va(r')))/(|va(r) - va(r')|) dif^3 va(r) dif^3 va(r'),
$
where $rho(va(r))$ is a generic electronic density.
The functional $G[rho]$ contains, according to the previous considerations, the quantum contributions of the Coulomb interaction and the kinetic energy of the interacting system of electrons.
Subsequently, for comparison with non-interacting systems of electrons, they defined the exchange-correlation energy functional as:
$ // Della Pia, eq. 3.33
E_"xc" [rho] := G[rho] - T_s [rho],
$
where $T_s [rho]$ is the kinetic energy functional of the unique non-interacting system of electrons having the same ground state electronic density as the system under consideration.
Hence, $E_"xc" [rho]$ contains the quantum contributions of the Coulomb interaction and the remaining contribution of the kinetic energy of the interacting electrons.
The *Kohn-Sham method* @kohnSelfConsistentEquationsIncluding1965 provides a working procedure to find the ground state density, defining the Kohn-Sham potential, $v_"KS" [rho] (va(r)) := v(va(r)) + integral_V (rho(va(r'))) / (|va(r) - va(r')|) dif^3 va(r') + (delta E_"xc" [rho]) / (delta rho)$, that leads to the Kohn-Sham self-consistent equations:
$ // Eq. (8.39) Alfè, (3.39) Della Pia
hat(h)_"KS" [rho] (va(r)) psi_n (va(r)) =
[-1 / 2 nabla^2 + v_"KS" [rho] (arrow(r))] psi_n (arrow(r))
= epsilon_n psi_n (arrow(r))
$ <eq:kohn-sham-equations>
The equations are coupled through the effective potential $v_"KS" [rho]$, as $rho(va(r))$ depends on all the $psi_n (va(r))$.
Since the orbitals $psi_n$ are ortho-normal, the ground state electron density of the system is obtained from the solution of @eq:kohn-sham-equations[Equations] as:
$
// Eq. (3.41) Della Pia, (8.23) Alfè
// logseq://graph/softseq?block-id=66f33133-67b5-46ea-abe5-ee9003827258
rho_0 (va(r)) = sum_(n=1)^N |psi_n (va(r))|^2.
$ <eq:ground-state-density>
// logseq://graph/softseq?block-id=66f33215-091e-46ec-bd3c-1ce9a47d0558
It is useful to recast the variation of the density in terms of variations of the single particle wavefunctions $psi_n$.
Such a variation has to be performed while keeping the wavefunctions ortho-normal, which gives a set of $M^2$ constraints:
$ // Termcomp eq. 8.28
integral_V dif^3 va(r) psi_i^star (va(r)) psi_j (va(r)) = delta_(i j).
$
To do that, we define the functional:
$ // Termcomp eq. 8.29
Omega [ { psi_n }, {epsilon_(i j)} ]
:= E[rho]
- sum_(i,j=1)^(N/2) 2 epsilon_(i j)
( integral_V dif^3 va(r) psi_i^star (va(r)) psi_j(va(r)) - delta_(i j) ),
$
where the terms $epsilon_(i j)$ are the Lagrange multipliers associated to the constraints, and we impose the condition:
$ // Termcomp eq. 8.30
delta Omega [{psi_n}, {epsilon_(i j)}] = 0.
$
// logseq://graph/softseq?block-id=66f328eb-1dc2-4e46-85f3-68f32ad31ce7
The @ks equations show that the extremes of the functional $Omega$ are obtained for any ensemble of $N/2$ eigenstates of $hat(h)_"KS" [rho]$ ($N$ eigenstates, if we ignore the spin degeneracy), and the ground state is obtained by finding its minimum of the total energy with respect to any choice of $N/2$ state.
In practice, to approximate the interacting system one always takes the lowest $N/2$ @ks states, although this may not necessarily be the correct choice (see @sec:v-representability).
One can introduce a set of $L$ basis functions, ${phi_m}_(m = 1, dots, L)$, to construct the matrix $epsilon_(i j) = braket(phi_i, hat(h)_"KS" [rho], phi_j)$, and diagonalize it.
The eigenvectors are of the type:
$ // Eq. (8.40) Alfè, (3.42) Della Pia
psi_n = sum_(i=1)^L c_i^n phi_i
$
If the basis set ${phi_m}$ is complete, the solution is exact.
However, usually this means including an infinite number of elements, which cannot be done in practice;
therefore, the solution to the @ks equations is only approximate.
By increasing the number of basis functions, one can drive the calculations to convergence, where the energy and other properties are obtained within some predefined threshold.
The usual variational principle applies, and so, by including more and more elements in the basis set, the ground state energy decreases monotonically.
The rate of decrease of the energy can be used to judge the level of convergence.
// logseq://graph/softseq?block-id=66f33452-dd0c-4443-86c6-5e64dba07f2c
Since the @ks potential depends on $rho$, @eq:kohn-sham-equations[Equations] have to be solved self-consistently.
This is typically done by iteration, in which one starts with some initial guess for the electron density $rho_1$, constructs $v_"KS" [rho_1]$ and solves @eq:kohn-sham-equations[Equations].
With those solutions construct $rho_2$ using @eq:ground-state-density or more advanced algorithms, and solve @eq:kohn-sham-equations[Equations] again, using the newly constructed $v_"KS" [rho_2]$.
The algorithm runs until the difference between $rho_(j+1)$ and $rho_j$ is below some acceptable threshold.
Multiplying @eq:kohn-sham-equations[Equations] by $psi_n^star (va(r))$, integrating over $va(r)$, summing over $n$, the total energy can be obtained from:
$ // Eq. (8.41) Alfè
E = 2 sum_(n=1)^(N / 2) epsilon_n - 1 / 2 integral_V (rho (
arrow(r)'
) rho(arrow(r))) / (|arrow(r) - arrow(r)'|) dif^3 arrow(r)' dif^3 arrow(r)
- integral_V (delta E_"xc") / (delta rho(arrow(r))) rho(arrow(r)) dif^3 arrow(r) + E_"xc" [rho].
$ <eq:termcomp-8.41>
=== v-representability <sec:v-representability>
// Da Lecture Notes di Alfè, p. 150
The condition that guarantees that the first $N/2$ states give the minimum energy in @eq:termcomp-8.41 is known as _v-representability_, that is the ground state density of the interacting system is the same as the ground state density of _some_ non-interacting system.
This also implies that the total energy, @eq:termcomp-8.41, would be exact if one had the exact form of the exchange-correlation functional, $E_"xc"$.
It is possible, however, that the ground state density of a system is not _v-representable_, i.e. there is no non-interacting system whose ground state density is the same as that of the interacting system.
In this case we need to go back to the variational principle, and the $N/2$ states in the non-interacting system that minimize the energy may not be the first $N/2$. @parrDensityFunctionalTheoryAtoms1994
=== The local density approximation
The explicit definition of the exchange-correlation energy is unknown.
We need to approximate the exchange-correlation functional in the Kohn-Sham equations.
The simplest definition of $E_"xc" [rho]$ is based on the assumption that the density in a given point in space, $va(r)$, is a smooth function around this point.
This is strictly true for a homogeneous electron gas, for which the potential $v_"xc" (va(r))$ can be seen to depend on the local density;
however, for an inhomogeneous electron gas it becomes a #gls("lda", long: true), which is equivalent to cut $E_"xc"$ at the first order of a functional Taylor expansion: @alfeCrystalStructureThermodynamic
$ // Eq. 8.42 Alfè, Eq. 3.46 Della Pia
E_"xc"^"LDA" [rho] := integral_V epsilon_"xc" [rho(va(r))] rho(va(r)) dif^3 va(r)
$ <eq:lda>
where $epsilon_"xc" (rho(va(r)))$ represents the exchange-correlation energy per particle of a homogeneous electron gas of density $rho(va(r))$.
In @eq:lda, the functional dependence has been substituted by a function dependence on the density, because $v_"xc" (va(r))$ has been assumed to depend only on the value of the density at the point $va(r)$:
$
v_"xc"^"LDA" (va(r)) = dv(, rho) [epsilon_"xc" (rho(va(r))) rho(va(r))].
$
Although @lda is based on the assumption that the real density of the interacting electron system is a slowly varying function in space, it performs satisfactory well for many materials.
One limitation of @lda is that it is blind to derivatives of the charge density.
Improvements have been proposed by developing functionals that depend not just on $rho$ but also on $grad rho$.
The functionals based on this idea are known as #glspl("gga", long: true).
They are often an improvement over the @lda, but there are cases where the @lda still performs better than @gga functionals.
A more serious limitation of the @lda, or indeed of any approximation based on a sum of _local_ contributions (including @gga functionals), i.e. terms that only depend on the value of the density at the point where they are calculated, is related to their _short-sightness_.
They cannot deal with long range interactions, such as #gls("vdw", long: true) or any other electrostatic interaction that is not already encoded in the Coulomb term.
In the particular case of London dispersive interactions, which arise from the coupling of dynamically induced dipoles, appearing when a spontaneous charge fluctuation in one region of space induces the appearance of a charge fluctuation in a different region of space, information coming only from the static value of the density is not sufficient, but one also needs to relate to how the charge density changes with time in response to external pertubations.
== #md-title <sec:md>
#gls("md", long: true) is a method that allows us to sample the phase space of a isolated system of $N$ interacting classical particles, obeying the Newton's equations of motion,
$ // Eq. 7.89 Alfè
va(f_i) = M dot.double(va(r))_i
= - pdv(U({va(r)}), va(r_i)),
$ <eq:verlet-newton>
under certain chosen conditions, and estimate an observable expectation value (which should be an ensemble average) through the means of a time average.
Integrating @eq:verlet-newton over time, one obtains a trajectory, ${va(r)(t)}$, represented by a collection of positions of all positions of all particles in the system as a function of time.
Since the forces are conservative, the total energy of the system (kinetic plus potential) is constant and the trajectory samples the microcanonical ensemble.
If, after a sufficiently long time, the trajectory passes within an arbitrary distance from _any_ state of the ensemble and with equal probability, then the system is said to be _ergodic_ and time averages are equivalent to ensemble averages.
Ergodicity is not always satisfied, and so care must be exercised when assessing the suitability of this method for sampling the phase space.
In particular, a harmonic system is a clear example of a system that is not ergodic, as energy cannot be transferred between different normal modes.
In the following section, we discuss how to generate a trajectory in a numerical simulation, through discretization of Newton's equations of motion, @eq:verlet-newton.
=== The Verlet algorithm
The Verlet algorithm is a technique to generate the trajectory of interacting particles obeying the Newton's equations of motion, @eq:verlet-newton, through their discretization. @alfeNotesStatisticalComputational2023
Let us consider the Taylor expansion of the position of particle $i$ at time $t$, $va(r_i) (t)$, computed with forward and backward differences:
$
arrow(r)_i (t + delta t)
= arrow(r)_i (t) + dot(arrow(r))_i (
t
) delta t + 1 / 2 dot.double(arrow(r))_i (t) (
delta t
)^2 + 1 / (3!) dot.triple(arrow(r))_i (t) (delta t)^3 + cal(O)((delta t)^4),
$
$
arrow(r)_i (t - delta t)
= arrow(r)_i (t) - dot(arrow(r))_i (
t
) delta t + 1 / 2 dot.double(arrow(r))_i (t) (
delta t
)^2 - 1 / (3!) dot.triple(arrow(r))_i (t) (delta t)^3 + cal(O)((delta t)^4),
$
where $delta t$ is a small time interval.
Summing the two equations side by side, we obtain:
$
arrow(r)_i (t + delta t) + arrow(r)_i (t - delta t)
= 2 arrow(r)_i + dot.double(arrow(r))_i (t) (delta t)^2 + cal(O)((delta t)^4)
$
Consider the expression of $dot.double(arrow(r))_i$ in terms of $arrow(f)_i$ from @eq:verlet-newton, $dot.double(arrow(r))_i (t) = 1/M arrow(f)_i (t)$; substituting, we obtain:
$
arrow(r)_i (t + delta t)
= 2 arrow(r)_i (t) - arrow(r)_i (t - delta t) + 1 / M arrow(f)_i (t) (
delta t
)^2 + cal(O)((delta t)^4)
$ <eq:verlet-algorithm>
@eq:verlet-algorithm is known ad the Verlet algorithm.
@verletComputerExperimentsClassical1967[Eq. (4)]
We can re-express the equation in terms of the velocities:
$
arrow(v)_i (t) = (arrow(r)_i (t + delta t) - arrow(r)_i (
t - delta t
)) / (2 delta t)
$
$
- arrow(r)_i (t - delta t)