Atomistic simulation with Julia (Juliacon2018)

Atomistic simulation with Julia (Juliacon2018)

Abstract
Atomistic simulation needs custom models, to approximate through hard O(N!) scaling of the underlying physical equations. Julia is a natural language to express such physical abstractions in. I will show how you can contribute to materials research with Julia and a fistful of 1960s PhysRevs.
Description
We can predict the properties of materials entirely within a computer. All material properties - strength, colour, opacity, conductivity etc. - come about as a result of the electronic structure adopted by the electrons in a material. This we can calculate by solving the Schrodinger equation. Unfortunately exact solutions are computationally intractable due to the O(N!) scaling with the number of electrons - the electron correlation problem. Progress in computational materials design has been made by solving approximate forms of this equation, numerically.
Venerable codes written in Fortran (and to a limited extent in C) consume the majority of cycles on public super computers. The often archaic code bases limits how easily they can be extended. The existence of standard, optimised, codes has enabled an enormous amount of research. At the same time, development of codes in relatively few walled gardens of physics has reduced the scope of techniques that are applied.
Modern materials design attempts to go beyond predicting properties of pure crystals. Generally this is because disordered materials can be made with less energy and time. Trying to predict the properties of these materials is a challenge, as the length and time scales so exceed that which we can get to even with approximate theories. As such, we need bespoke codes and models to be able to model these systems.
I will describe successful research projects in condensed matter theory which have made essential use of Julia, and will attempt to explain why Julia, with its mathematical expressiveness, physical abstraction, and high performance, is a natural language for future work in condensed matter theory.
I will discuss revisiting Polaron mobility theories from the 1960s (https://github.com/jarvist/PolaronMobility.jl), approximate forms of quantum-nuclear effects (https://github.com/jarvist/FeynmanKleinert.jl) and Tight-Binding approaches to large scale electronic structure calculations.

F9278b7f6b5b5c4e09e6b5dec800660a?s=128

Jarvist Moore Frost

August 08, 2018
Tweet

Transcript

  1. 1.

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

    August 2018 King's College London / Imperial College London, UK @JarvistFrost jarvist@gmail.com https://jarvist.github.io Atomistic simulation with Julia Jarvist Moore Frost Quantum Corrosion
  2. 2.

    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
  3. 3.

    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.
  4. 4.

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

    August 2018 UK national supercomputer utilisation … by research area
  5. 5.

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

    August 2018 UK national supercomputer utilisation … by language
  6. 6.

    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.)
  7. 7.

    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
  8. 8.

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

    August 2018 Julia A simple language, with: Functions Types Composability
  9. 9.

    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.
  10. 11.

    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
  11. 13.
  12. 14.

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

    August 2018 Step 1) Write down everything you know...
  13. 15.

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

    August 2018 Step 2) Auto-differentiate and optimise function...
  14. 16.

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

    August 2018 Step 3) Success! (For arbitrary Alpha and Beta) Hellwarth 1999 PRB
  15. 17.

    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.)
  16. 18.

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

    August 2018 Julia is a good source of golden bricks!
  17. 19.

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

    August 2018 "Calculating polaron mobility in halide perovskites" Frost, PRB, 2017.
  18. 20.

    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)
  19. 21.

    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
  20. 22.

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

    August 2018 … but it makes things very easy.
  21. 24.

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

    August 2018 Macros - useful to physicists!
  22. 25.

    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.