How to Build a Universe

A cookbook for simulating your very own universe!

Zach Wolpe
7 min readSep 7, 2022

Tired of speculating about the origins of cosmology? Existential dread killing your vibe more often than you’d like? Well look no further! Grab your GPUs & favourite group of crack programmers, because it’s time to play God and instantiate your very own universe! (fundamental physics to support carbon-based life sold separately).

We’ll need a go over a bit of physics, so we know what we’re simulating.

Think → Predict → Analyse

Exploring the biggest questions in physics require some imagination. How the hell can we observe the universe 14 billion years ago? Or really measure atmospheric quantities in deep space? We can’t, but we’re getting good at guessing! Often the formula for validating the most outlandish theories in cosmology goes something like this:

  1. Think: Come up with an idea.
  2. Predict: Use a model to predict the existing universe based on this idea.
  3. Analyse: Assess how likely the theory is to be true based on how well our current reality matches the prediction.

If the prediction is really good, then we might be onto something! This is how many of the theories of the big bang are scrutinised. Let's look at a few in particular.

Violations of the Cosmological Principle (CP)

First discussed in Newton’s “Principia Mathematica”, the Cosmological Principle states:

Spatial distribution of matter in the universe is homogeneous and isotropic when viewed on a large enough scale.

A representation of radiation in the universe, which is unlikely to be homogeneous & isotropic.

In layman's terms, this simply means on large enough scales the matter should be evenly distributed across the universe. While proving fundamental to much of early cosmology, some notable experiments have violated the CP.

Hercules-Corona Borealis Great Wall: the largest known structure in the observable universe stretching 10 billion lightyears across. A clear violation of the CP, breaking the cosmic symmetry.

The Hercules-Corona Borealis Great Wall is one example of the lack of symmetry in our cosmos. Since Symmetry is foundational to physics, a great deal of research and speculation has gone into explaining breaches in cosmological symmetry.

The asymmetric nature of our universe is likely a consequence of imbalances between matter and anti-matter on the quantum scale, as well as the inflation of stochastic fluctuations in quantum fields in the early universe.

These imbalances are likely essential to producing matter, and thus we’ll need to replicate this in our cosmic recipe!

The Cyclical Universe

Although we’re almost certainly wrong, we have a few ideas about how the universe might end:

  • The Big Rip: The expansion of the universe (Hubble’s law) is a consequence of dark energy. This dark energy appears to increase with time, accelorating the expansion. If the strength of dark energy increases indefinitely it will overpower the electromagnetic force, eventually splitting all atoms, until no fundamental interaction is possible and the universe is silenced, stopping time.
  • The Big Bounce: Gravity will eventually overcome the universal acceloration, causing the universe to collapse in on itself until the overwhelming force results in a universe of pure plasma (identical to moments after the big bang). This inverse sigularity reproducing the state of the universe at the time of the big bang (exhibiting infinite heat and density).
  • The Heat Death of the Universe: Depending on protein decay, the universe expands until all stars and matter are consumed by black holes and all black holes decay by Hawking radiation.

All of these theories result in a zero spatial dimension universe that exists outside of time, effectively resetting the cosmos. Now we just need an explanation to trigger a new big bang.

Quantum fluctuations in a Vacuum

How does something come out of nothing? We’ll need some quantum mechanics!

Heisenberg’s uncertainty principle is the premise of modern quantum mechanics. It describes the a fundamental limit to the accuracy with which the values of certain pairs of physical quantities of a particle (position and momentum) can be predicted from initial conditions.

The principle tells us that energy E and time t can be related to Planck’s constant .

This means that pairs of virtual particles with energy E and lifetime shorter than t are continually created and annihilated in empty space.

Some physicists believe that in the unlikely instance that an imbalance occurs between matter and anti-matter during quantum fluctuations, a new universe can spawn! In an infinite universe, all instances with non-zero probability will occur, and thus we’ll exploit this property to build a universe!

Caveat: the estimated probability of this occurring is on the order of: 10¹⁰^¹⁰^⁷⁶

A representation of virtual particles bursting into brief existence, and subsequently rapidly decaying out of existence. These random perturbations may be the reason behind the violations of the Cosmological principle, as the random fluctuations are inflated during the inflationary period following the big bang.

Universe Starter Kit

To simulate our universe, we’ll need a few questions to describe our quantum fluctuations in a vacuum:

The Schrödinger equation is a linear partial differential equation that describes the wave form of quantum mechanical systems:

Schrödinger equation where ψ is the waveform, ℏ is Planck’s constant and H is the observable Hamiltonian operator.

We then extend this equation to the Schrödinger–Newton equation, a nonlinear modification of the above system.

An extract from Wikipedia describing the extension. This allows us to model quantum fluctuations accurately by articulating the balance between energy, time and the gravitational field.

Assumptions

For simplicity, we assume ℏ = m = 1. We also normalise ψ so that|ψ|²=1. Leveraging the Poisson’s equation we derive an expression for V:

We utilise the Poisson equation (left) — which describes a gravitational field g due to an attracting massive object of density ρ — and normalised ψ to derive an expression for V (right) in terms of its gradient.

Fourier Transform

By applying a Fourier Transform ψ*(x) = FFT( ψ(x)) we are able to circumvent the need to compute gradients. Allowing us to replace the gradient with constant k. Our original system now reduces to:

Ignoring the second (potential) term &decretising the system — assuming changes over time t instead of the continuous change computed by the derivative — we are able to define a drift operator:

Taking the inverse Fourier Transform will then produce the original waveform in the real space ψ = IFFT( ψ*). Since there is no spatial gradient in the second term Vψ* we do not need to transform it into the Fourier space. Again we use a drift operator to compute a discrete change in this potential term:

Finally, we solve for Poisson equation by again applying the Fourier transform:

This approach approximating a system of differential equations is known as a kick-drift-kick scheme.

Let’s Build a Universe!

Now assuming a 2 dimensional universe {x,y}:R (easily extended to n dimensions) we instantiate a python class to hold our universe parameters: Quantum_Simulation. We also create a update_simulation_parameters() method that can be used to specify our universe’s fundamental law’s of physics.

We then add the methods to update our waveform & gravitational potential, as described above. We also store these properties as data in the class instance, to ensure free will is completely absent from our universe. We wouldn’t want that!

Now all that’s left to do is to instantiate our universe class! Here we go!

We simulate quantum fluctations in a vacuum governed by our chosen universal properties (hyperparameters):

Boom!⚡️ You’ve got your very own universe builder!

Now simply:

  1. Access a quantum computer and instantiate approximately
10^10^10^78 class instances.

Unfortunately this will probably not be finished by the time our universe meets it’s heat death, however I leave optimisation to the user.

2. Store all 3-dimensional instantiations that exhibit signs of imbalances in quantum fluctuations in a vacuum.

3. Hack the CERN grid & simulate the stored instances using real particles in the LHC.

Safe Use Warnings

  • Commandments may be passed to your universes inhabitants at your discretion.
  • Our universe is likely running in a compiled language, because we don’t seem to have great access to the source code. Provide the source code or interpreter to your new universe with care, or we’ll end up with the Qu from All Tomorrows.
  • I recommend instantiating Karma, to encourage reciprocal altuism. Or just convert Dante’s Devine Comedy into binary, I don’t care :).
  • After instantiation, manipulating the source code will be interpreted as “divine intervention”: causing much controversy in your instance.

View all the code here. Special thanks to pmocz’s github!

--

--