Quantum music: random walks
A random walk is a great example of a place where there is a clear difference in the behaviour of quantum and classical physics. We wanted to use this to create musically contrasting melodies. Before we get into the music, let’s quickly explain the random walks. To do a random walk, imagine that every time you want to take a step, you toss a coin. If it lands on heads, you step sideways to the left. If it lands on tails, you go right. When you get people to play this game, you can see that they will shuffle around a lot, but they’ll also tend to drift away slowly from their starting point. We decided to imagine taking steps on points around the edge of a circle. So, if we take too many steps to the right or to the left, we will end up back where we started.
That was the “classical” random walk - which just means when we described it, we did not have to use any quantum mechanics. To describe a “quantum” random walk, we replace our coin with a quantum coin, and we replace our walker with a quantum walker. At each step, we rotate our coin so that it is in a “superposition” of heads and tails. Like before, our walker will step left or right depending on whether the coin is heads or tails. However, this time, our walker and our coin are quantum and so they become “entangled”. After one step, there is now a superposition between the coin showing heads and our walker stepping left, and the coin showing tails and our walker stepping to the right. Because we have two quantum systems which are in superposition, and where the “state” of the walker (their positions) is now dependent on the “state” of the coin (if it shows heads or tails), we say that they are entangled.
Now, how do we turn this into music? For the classical version, this is not too tricky. We divide our circle into 14 steps, then we give each step a note over 2 octaves of a scale C Harmonic Minor. At each step of the random walk, we play the note of the scale which corresponds to the position of the walker.
For the quantum version, we need some extra tricks. If we were to perform this experiment in real life and measure the position of the walker at every step, the quantum state would “collapse” and the movements of the walker would look exactly like the classical case. Instead, we cheat a little, and give ourselves powers which we can only do in simulations - we look inside the state of the walker without collapsing it back into a classical walk. What we see is that the walker will be spread over many different positions, with different probabilities at each spot. We then choose a position based on these probabilities and use that to give our note.
Once we had the quantum/classical walk data from the simulations we created a patch in Cycling 74’s MAX MSP software (a visual programming language for music and multimedia). By inputting the text files containing classical and quantum walk data, the patch translated the raw data into MIDI information – a communication protocol used to send musical information. From this we were able to send pitch and gate (note on or note off) messages to a digital audio workstation, in this case it was Ableton Live 11.
Once in the digital audio workstation we were free to fuel several digital and analogue synthesisers with the data. This is how we came to hear the classic and quantum walks as music.
There are two main differences which can be heard in the music between the classical and the quantum walk. The first is that in the classical walk, the note only ever moves up or down by one step, making the melody sound quite similar to playing a scale. In the quantum walk, we see large jumps because the position of the walker is spread out over many positions at once. The other thing which you may be able to hear is that in the quantum walk, the notes move away from the starting point (the first note in the melody) faster than the classical walk. This is because of an important feature of the classical vs quantum walk - if you want to get somewhere fast, it helps to be quantum!
The piece of music was composed around the melodies created by the walk, during our initial meetings to discuss the project the song ‘Giorgio by Morodor’ by Daft Punk was mentioned several times. This track undeniably influenced the composition style with driving rhythm, and it’s use of storytelling sound effects (the click track). This inspired us to collect field recordings from Bristol’s Quantum Engineering Technology lab itself that were then included in the composition – everything from key card sounds to compressors for the cryostats (very cold fridges). You can download the samples we took for your own use here.
When listening to Random Walk you will first hear the classical walk panned in the left speaker. At 0:22 the melody changes to the quantum walk and switches to the right speaker. Each melody remains in that speaker configuration for the duration of the track so this should help you hear the different melodies as the piece continues.