In the early 2000s, a small community of coder-cosmologists set out to simulate the 14-billion-year history of the universe on a supercomputer. They aimed to create a proxy of the cosmos, a Cliffs Notes version in computer code that could run in months instead of giga-years, to serve as a laboratory for studying the real universe.

The simulations failed spectacularly. Like mutant cells in a petri dish, mock galaxies grew all wrong, becoming excessively starry blobs instead of gently rotating spirals. When the researchers programmed in supermassive black holes at the centers of galaxies, the black holes either turned those galaxies into donuts or drifted out from galactic centers like monsters on the prowl.

But recently, the scientists seem to have begun to master the science and art of cosmos creation. They are applying the laws of physics to a smooth, hot fluid of (simulated) matter, as existed in the infant universe, and seeing the fluid evolve into spiral galaxies and galaxy clusters like those in the cosmos today.

“I was like, wow, I can’t believe it!” said Tiziana Di Matteo, a numerical cosmologist at Carnegie Mellon University, about seeing realistic spiral galaxies form for the first time in 2015 in the initial run of BlueTides, one of several major ongoing simulation series. “You kind of surprise yourself, because it’s just a bunch of lines of code, right?”

With the leap in mock-universe verisimilitude, researchers are now using their simulations as laboratories. After each run, they can peer into their codes and figure out how and why certain features of their simulated cosmos arise, potentially also explaining what’s going on in reality. The newly functional proxies have inspired explanations and hypotheses about the 84 percent of matter that’s invisible — the long-sought “dark matter” that seemingly engulfs galaxies. Formerly puzzling telescope observations about real galaxies that raised questions about the standard dark matter hypothesis are being explained in the state-of-the-art facsimiles.

The simulations have also granted researchers such as Di Matteo virtual access to the supermassive black holes that anchor the centers of galaxies, whose formation in the early universe remains mysterious. “Now we are in an exciting place where we can actually use these models to make completely new predictions,” she said.

Black Hole Engines and Superbubble Shockwaves

Until about 15 years ago, most cosmological simulations didn’t even attempt to form realistic galaxies. They modeled only dark matter, which in the standard hypothesis interacts only gravitationally, making it much easier to code than the complicated atomic stuff we see.

The dark-matter-only simulations found that roundish “halos” of invisible matter spontaneously formed with the right sizes and shapes to potentially cradle visible galaxies within them. Volker Springel, a leading coder-cosmologist at Heidelberg University in Germany, said, “These calculations were really instrumental to establish that the now-standard cosmological model, despite its two strange components — the dark matter and the dark energy — is actually a pretty promising prediction of what’s going on.”

Researchers then started adding visible matter into their codes, stepping up the difficulty astronomically. Unlike dark matter halos, interacting atoms evolve complexly as the universe unfolds, giving rise to fantastic objects like stars and supernovas. Unable to code the physics in full, coders had to simplify and omit. Every team took a different approach to this abridgement, picking and programming what they saw as the key astrophysics.

Then, in 2012, a study by Cecilia Scannapieco of the Leibniz Institute for Astrophysics in Potsdam gave the field a wake-up call. “She convinced a bunch of people to run the same galaxy with all their codes,” said James Wadsley of McMaster University in Canada, who participated. “And everyone got it wrong.” All their galaxies looked different, and “everyone made too many stars.”