Batteries are ubiquitous in everday applications but making them cheaper, safer, and able to store more energy could widen their use still further. Many rechargeable batteries rely on lithium ions moving backwards and forwards between a material that contains lithium to graphite through an electrolyte. Being able to replace the graphite with lithium metal would massively increase the energy density, but unfortunately defects form that make such a battery unsafe. Other metals are not prone to such defects and among them magnesium shows promise because it allows a metal anode and carries two units of electrical charge on each ion. This means a magnesium-ion battery could have a dramatically higher energy density than any lithium-ion battery, while remaining safe and potentially cheaper. Here we want to investigate how magnesium moves through a candidate material for such a battery.