Slide 1

Slide 1 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 King's College London / Imperial College London, UK @JarvistFrost [email protected] https://jarvist.github.io Atomistic simulation with Julia Jarvist Moore Frost Quantum Corrosion

Slide 2

Slide 2 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Why should a Julia programmer care about the physics of atoms? "The underlying physical laws necessary for the mathematical theory of a large part of physics and the whole of chemistry are thus completely known, and the difficulty is only that the exact application of these laws leads to equations much too complicated to be soluble. It therefore becomes desirable that approximate practical methods of applying quantum mechanics should be developed, which can lead to an explanation of the main features of complex atomic systems without too much computation." - PAM Dirac, 1929

Slide 3

Slide 3 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Electronic structure theory Photo credit: "CM-5", Bradley C. Kuszmaul https://people.csail.mit.edu/bradley/cm5/ All material properties: Conductivity (thermal, electrical) Colour (+ optical properties) Elastic constants Strength Defect behaviour … True solution is O(N!) scaling ⇒ must make approximations Better approximations in the theory lead to complexity in the codes.

Slide 4

Slide 4 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 UK national supercomputer utilisation … by research area

Slide 5

Slide 5 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 UK national supercomputer utilisation … by language

Slide 6

Slide 6 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 What's the problem with this? I argue: lack of abstraction. ⇒ Start with beautiful, compact, equations. ⇒ Convert them into terrifying, nested, for-loops. (+ 1980s legacy code bases, raw MPI parallelism etc.)

Slide 7

Slide 7 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Physics A simple (reductionist) view of the world, with: Functions (operators, functionals…) Representations of the world Transferable

Slide 8

Slide 8 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Julia A simple language, with: Functions Types Composability

Slide 9

Slide 9 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 The challenge in atomistic physics There are a lot of theories and approximations out there! But these methods are mostly locked away in (often quite old) papers. Implementing such methods is slow. This has resulted in two-tier research: ⇒ Method-developers implement new theories; but often on contrived and simple systems. Hardcoding and fragility of the numerical methods makes generalisation hard. This is getting worse as method complexity increases. ⇒ Downstream-users apply well-understood theories written in robust codes to complex problems; but conceptual distance from the theory and its implementation mean that applicability of the theory, and numeric failure (i.e. failure to convergence) and often not even noticed.

Slide 10

Slide 10 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 PolaronMobility.jl W

Slide 11

Slide 11 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 "Slow Electrons in a Polar Crystal", Phys. Rev. 97, Feynman 1955 Infinite quantum field of phonon excitations

Slide 12

Slide 12 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018

Slide 13

Slide 13 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 (Hellwarth et al. 1999)

Slide 14

Slide 14 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Step 1) Write down everything you know...

Slide 15

Slide 15 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Step 2) Auto-differentiate and optimise function...

Slide 16

Slide 16 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Step 3) Success! (For arbitrary Alpha and Beta) Hellwarth 1999 PRB

Slide 17

Slide 17 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Explicit contour integration of polaron self-energy on complex plane (Numerical Recipes in C, 2nd Edition.)

Slide 18

Slide 18 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Julia is a good source of golden bricks!

Slide 19

Slide 19 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 "Calculating polaron mobility in halide perovskites" Frost, PRB, 2017.

Slide 20

Slide 20 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 FeynmanKleinert.jl Feynman and Kleinert, Effective Classical Partition Functions Phys. Rev. A B 34, 5080 (1986)

Slide 21

Slide 21 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 We don't need Julia... John and Mary Gribbin, "RICHARD FEYNMAN, A Life in Science", Viking, NY, 1997

Slide 22

Slide 22 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 … but it makes things very easy.

Slide 23

Slide 23 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018

Slide 24

Slide 24 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Macros - useful to physicists!

Slide 25

Slide 25 text

Jarvist Moore Frost (King's College London, UK) Juliacon 2018 8 August 2018 Atomistic simulation with Julia Julians: atomistic simulation is important (>70% of public supercomputer time) Atom simulators: Julia is a natural language to wrangle atoms Automatic differentiation is a beautiful thing! (Physicists don't believe you when you tell them it exists…) There's a lot of coding required to bring up a full atomistic-simulation package in Julia. But there are considerable benefits to having codes that are explicable, composable, and sufficiently performant. Interesting in Julia and Atoms? Get in touch! If critical mass - an atomistic Julia organisation would really help.