There was a time when our Universe was nothing but an opaque, lightless sea of swirling gas.

By the time the Universe was a billion years old, however, that had all changed. Radiation from the first stars and galaxies wreaked a dramatic alteration, allowing light to stream freely, across the entire electromagnetic spectrum.

A new simulation, named Thesan after the Etruscan goddess of dawn, has allowed scientists to probe the Universe's Dark Ages. It's a new tool for seeing in detail how the lights may have switched on, at the Cosmic Dawn. And it's absolutely beautiful.

"Thesan acts as a bridge to the early Universe," said physicist Aaron Smith of MIT's Kavli Institute for Astrophysics and Space Research. "It is intended to serve as an ideal simulation counterpart for upcoming observational facilities, which are poised to fundamentally alter our understanding of the cosmos."

Most of what we know about the Universe, we have learnt from light (with the notable exception of gravitational waves, a field of astronomy still in its infancy). So, when light is hindered in some way, that causes quite some problems; just look (or don't look, as the case may be) at black holes, which emit no detectable radiation.

The early Universe between 50 million and 1 billion years after the Big Bang is another such case. This period is known as the Cosmic Dawn, the time at which the Universe as we know it today was just starting to come together out of the primordial plasma. Before the first stars came along, it was filled with a hot murky fog of ionized gas. Light was unable to travel freely through this fog; it simply scattered off free electrons.

Once the Universe cooled down enough, protons and electrons started to recombine into neutral hydrogen atoms. This meant light could finally travel through space. As the first stars and galaxies began to form, around 150 million years after the Big Bang, their ultraviolet light gradually reionized the neutral hydrogen ubiquitous throughout the Universe, allowing the entire spectrum of electromagnetic radiation to stream freely. This is the Epoch of Reionization.

By about 1 billion years after the Big Bang, the Universe was completely reionized; earlier than this 1 billion year mark, however, we can't really see with our current instruments, which makes this critical Cosmic Dawn difficult to understand.

"Most astronomers don't have labs to conduct experiments in. The scales of space and time are too large, so the only way we can do experiments is on computers," said astrophysicist Rahul Kannan from the Harvard-Smithsonian Center for Astrophysics.

"We are able to take basic physics equations and governing theoretical models to simulate what happened in the early Universe."

Thesan starts with a realistic model of galaxy formation, along with a new algorithm for reproducing how light interacts with and reionizes the ambient gas, and a model of cosmic dust.

These processes and interactions are very complicated; to simulate a section of the Universe 300 million light-years across, from 400,000 to a billion years after the Big Bang, the team used a powerful supercomputer, SuperMUC-NG machine, which used the equivalent of 30 million CPU hours to run Thesan.

The resulting simulation is the most detailed view yet of the Epoch of Reionization, capturing physics on scales a million times smaller than the simulated regions, the researchers said. This gives an "unprecedented" look at the way early galaxies formed and interacted with the gas of the early Universe. It shows a gradual change as light begins to seep through the Universe.

"It's a bit like water in ice cube trays; when you put it in the freezer, it does take time, but after a while it starts to freeze on the edges and then slowly creeps in," Smith said. "This was the same situation in the early Universe – it was a neutral, dark cosmos that became bright and ionized as light began to emerge from the first galaxies."

Interestingly, Thesan showed that initially light doesn't travel very far at all. It's only towards the end of reionization that light is able to travel large distances. The team also saw which types of galaxies had the biggest influence on reionization, with galactic mass playing a large role.

We won't have long to wait to find out how accurate the simulation is, either. The James Webb Space Telescope (JWST) is due to commence science operations in a few months, and is partially designed to peer back to around 300,000 years after the Big Bang, when reionization was in full swing.

"And that's the interesting part," said physicist Mark Vogelsberger of MIT.

"Either our Thesan simulations and model will agree with what JWST finds, which would confirm our picture of the Universe, or there will be a significant disagreement showing that our understanding of the early Universe is wrong."

Either way, we're going to learn something very exciting about the mysterious birth and early years of our amazing Universe.

The research has been published in the Monthly Notices of the Royal Astronomical Society.