Gemstones might not seem so valuable if they literally rained from the sky, but that's thought to be a common weather pattern on ice giant planets. Now scientists at the SLAC National Accelerator Laboratory have seen it in action here on Earth, by making it rain diamonds in the lab.

Our local ice giant planets, Uranus and Neptune, have long been thought to have the right conditions for diamond rain. Around a solid core sits a slushy layer of different ices – not just plain old water ice, but ammonia and methane ice as well. In this environment, extreme pressure would squeeze common elements like hydrogen and carbon into solid diamonds, which then fall like rain towards the planet's core.

But this phenomenon has never been directly observed. Instead, the idea is usually the result of measurements of an exoplanet's mass and radius, which speak volumes about its composition. From there, astronomers can figure out how those elements interact, and characterize the planet accordingly.

"With planets, the relationship between mass and radius can tell scientists quite a bit about the chemistry," says Dominik Kraus, lead author of the study. "And the chemistry that happens in the interior can provide additional information about some of the defining features of the planet. We can't go inside the planets and look at them, so these laboratory experiments complement satellite and telescope observations."

To recreate such conditions in the lab, the team used polystyrene, a plastic compound made from methane, which is a key ingredient in the atmosphere of ice giants. Then, the researchers blasted the plastic with the world's most powerful x-ray laser, the Linac Coherent Light Source (LCLS), which sent strong shock waves rippling through the material in pairs. The first shock was small and slow, which allowed the second wave to overtake it.

In the brief moment where the two shock waves overlap, the peak pressure crushed almost all the carbon atoms in the plastic down into tiny diamond structures, measuring only a few nanometers wide. Unfortunately, they're also extremely short-lived, surviving just fractions of a second. Because of this, other experiments attempting to recreate diamond rains haven't been able to see them directly, but in this case, the intense laser allowed x-ray snaps of the structures forming to be taken, and their size and composition measured.

"For this experiment, we had LCLS, the brightest x-ray source in the world," says Siegfried Glenzer, co-author of the paper. "You need these intense, fast pulses of x-rays to unambiguously see the structure of these diamonds, because they are only formed in the laboratory for such a very short time."

While the lab-made diamonds were tiny and short-lived, the researchers believe that those formed in the depths of Uranus and Neptune could become much bigger, potentially weighing millions of carats and lasting thousands of years, as they slowly sink through the planet's slushy mantle to form a thick diamond layer around the core.

Along with improving our understanding of the composition of other planets, the research could have more practical applications back home. The team says creating nanodiamonds with lasers is a more efficient technique than the way they're currently made – using explosives – and the end result is a useful component in electronics and scientific equipment.

The research was published in the journal Nature Astronomy.