TL;DR
My PhD is at the intersection of computer science, maths, and physics. I create, maintain and develop computer programs that simulate magnetic materials at the atomic level by solving systems of stochastic differential equations (sometimes millions simultaneously). These are deployed on HPC systems using CPU and GPU resources. I'm highly experienced in C++ and CUDA for production simulations, and high-performance Python for prototyping new algorithms, signal processing, symbolic maths, and data analysis and visualisation. I also use high level mathematics, physics and quantum mechanics to develop new highly efficient algorithms and create new theories.

  • C++
  • CUDA
  • CMake
  • BASH
  • Python:
    • Numpy
    • Matplotlib
    • Pandas
    • SciPy
    • lmfit
    • Numba
    • SymPy
    • Glob
    • Cython
    • h5
  • Vagrant
  • Job schedulers (SGE and Slurm)
Magnetism for non-scientists

Like all materials, magnets are made of atoms. What makes a magnet different from other materials is that the electrons that surround the nuclei 'line up'. We normally think of electrons as tiny spheres, so it's counterintuitive that there is anything to align. But, due to quantum mechanics, these electrons have a property called spin.

Outside of quantum mechanics, spin is vector – you can think of it as an arrow pointing in any direction with a fixed length. The spin of electrons in (anti-)ferromagnetic materials point (anti-)parallel to other electrons. So in a normal bar magnet – which is ferromagnetic – all of the electrons are pointing in the same direction. We can swap which way these spin vectors are pointing by applying an electric current, or by applying a magnetic field to the bar magnet. This is how magnetic hard drives operate; tiny magnetic regions are switched from up (0) to down (1) with electric currents.

To make more efficient memory technologies, and to create better optimized hardware for machine learning models, we need to understand magnetic materials at the atomic level and how that affects devices. Trying to measure single atoms in a bar magnet is hard, even for the best labs in the world. So, scientists (including me) are trying to model them using computer programs.

Physicists broadly have two different approaches to this problem. Some study the most fundamental quantum mechanical problems using techniques like quantum monte carlo but these are limited to ~100 atoms and it is hard to use on electrical conductors. Others study much larger systems using finite element and finite difference methods which can be recreated in a lab. These methods can be very good at explaining qualitatively what happens in specific experiments. But, neither of these methods alone are good at predicting the properties of magnets that would be used for memory or logic devices in a lab – especially when they're heated up or have lots of impurities.

My PhD research uses simulations that connect these two approaches; I model millions of individual magnetic moments using an equation of motion derived from quantum mechanics, but the moments are classical vectors which means the simulation can run very efficiently on GPUs. Atomistic modelling is the only way to include temperature by using random numbers (often called a stochastic process), which means these simulations can predict finite temperature behaviour very accurately.

The equation of motion my simulations solve is the Landau-Liftshiz equation. Each magnetic moment has its own equation (denoted ii ), and which is coupled to others via the magnetic interactions.
In maths, this problem is called a system of linear differential equations. Small systems can be solved analytically (by hand using algebra) but here the system is too large, and it is stochastic which means it must be solved numerically (approximate solutions using numbers instead of symbols) on a computer.

These systems are too big even for standard numerical software packages used by mathematicians (Mathematica, Maple, etc). Instead, we must create our own custom software using high level computer science principles to optimise the calculations, and we use modern software development workflows to ensure it is rigorously tested, and development can happen quickly.

The material specific term in the above equation is the effective, local field. We call it an effective field because it contains all the energy terms , but it is written as a field (even if the energy term isn't an applied field). This field is local because the value of the field is different for each spin due to the interactions with the spins in its vicinity. The energy is written as a Hamiltonian (a mathematical construction for the total energy). Below is an example Hamiltonian for a fictitious ferromagnet.
H=12i,jSiJijSjiKi(Siz^)2\mathcal{H} = -\frac{1}{2} \sum_{i,j} \mathbf{\mathrm{S}}_i \cdot J_{ij} \cdot \mathbf{\mathrm{S}}_j -\sum_{i} K_i \left( \mathbf{\mathrm{S}}_i \cdot \mathrm{\hat{z}} \right)^2 where JijJ_{ij} is the exchange constant between spin ii and spin jj , J>0J > 0 corresponds with ferromagnetic coupling (parallel alignment) and J<0J < 0 is antiferromagnetic coupling (anti-parallel alignment), KiK_i is the anisotropy constant for the ii -th spin. K>0K > 0 means spins prefer to point along the zz -direction and K<0K < 0 means spins prefer to lie in the xyxy -plane.