Pythagoras had some interesting thoughts about music.
The 6th-century BC mystic and mathematician was the first to discover the inverse proportion between a musical pitch and the length of a vibrating string, as well as the relationship between harmonic intervals and numerical ratios. But then, observing the sun, moon and planets, he theorized that if one took just the right proportions between their celestial movements, they would correspond to musical notes. His idea was later picked up by Aristotle—a keen observer of nature but not one for experimental verification—who noted that because objects in motion produce sounds on earth, therefore the planets, moving much faster, should also be much louder. Aristotle wondered why we couldn’t hear Pythagoras’ music of the spheres and concluded that our ears probably just learned to tune it out as so much background noise.
Mediaeval universities included music with arithmetic, geometry and astronomy in the quadrivium, the four most important fields of study[1]. Not much later, in the early 17th century, astronomer Johannes Kepler followed Aristotle’s footsteps and devoted an entire book, Harmonices Mundi, to his effort to make the data he had observed about elliptical orbits fit with what he knew of musical scales and harmonics. He decided that the musica universalis, undoubtedly agreeable and blissful, could only be heard by the soul.
My own interest tends toward far smaller spheres—those tiny photons, electrons and other subatomic particles that are the foundation of quantum computing.[2] I’m also best described as being unable to carry a tune in a bucket,[3] but my son is a talented composer and songwriter, and I like to think I have a broad appreciation of musical genres. So I was delighted to see an IBM article come across my LinkedIn feed describing a musical collaboration between the Brazilian composer Eduardo Reck Miranda and a System 1 Eagle quantum computer.
Music and mathematics, as Pythagoras and the rest of the ancients understood, are intimately intertwined, and musicians have been using computers for a long time already. AI has been in the mix for a while, and Miranda points out, correctly, that generative AI can easily be used to imitate any kind of music you want. Ask ChatGPT to compose a fugue in the style of Johann Sebastian Bach and it will dutifully spit out a few bars’ worth of notes. This is nothing new, and one can certainly argue that it doesn’t require any creativity on the part of the AI system. It’s also not Miranda’s area of interest. His work has, since the 1990s, dealt with how musicians and AI systems can work together to create new, innovative compositions. It turns out that this is computationally intensive—Miranda was already using Cray supercomputers in 1995—so it’s only natural to ask how quantum computing could help.
Let’s explore the music of the spheres at the subatomic level.
Cell data
To get there, we need to take a quick detour through another intersection of biology with computer science and AI. In my last post, I wrote about evolutionary algorithms and one particular example, the genetic algorithm. Another type is the cellular automaton, which Miranda uses in his quantum musical collaboration. A cellular automaton is a data structure that contains a number of variables with different data types and possible values. Unlike genetic algorithms, though, cellular automata don’t pair up with one another to produce offspring but instead work at the level of the entire population. They are arranged in a multidimensional grid or matrix, and the programmer can define rules that specify how data in one cell change depending on the values of all its neighbouring cells.
What does that mean? Well, an easy example would be to imagine a sheet of graph paper, as big as you want vertically and horizontally. Every square on the sheet has eight neighbours—adjacent to each side, and on each of the corners. Let’s say, for simplicity, that a square could have one of two possible values, coloured black or white. The programmer can write rules defining how a square changes colour depending on what colours its neighbours have. Every iteration of the program, or generation in evolutionary terms, each square either changes or stays the same as the rules get evaluated across the whole board. I remember seeing an implementation of this in university, called The Game of Life (not to be confused with the Milton-Bradley family board game), which listed only four very specific rules—and it was fascinating, depending on how you chose your initial configuration of coloured squares, to see patterns emerge and either stabilize or descend into chaos and eventually die out as the generations passed.
Now, just to get a bit more complicated, a square doesn’t have to be only black or white—it could have multiple colours, or you could just stuff any kind of numeric or text data in there depending on the problem you’re trying to solve. And, because mathematicians like abstraction, you don’t have to restrict yourself to two dimensions—try three, four or as many dimensions as you like. You’re just increasing the number of neighbours a cell will interact with—but I think you get the idea of how quickly the complexity of cellular automata increases with the amount of data and number of dimensions.[4]
Finally, there is a trick that programmers use to make cellular automata work properly. When you run the algorithm to update the grid from one generation to the next, it’s supposed to happen simultaneously across the board. But algorithms don’t work like that in real life, and you run the risk of a cell being updated before its neighbours, so its original data aren’t available anymore. To get around this, the programmer just makes copies of each cell’s data—so that when cells update at different times, they can still do so with the correct neighbouring values.
This is not just theoretical. There are many practical use cases for cellular automata, especially in modelling any kind of system that changes over time—from fluid dynamics in physics to the spread of infectious bacteria in a population. And, as we’ll see, music fits the same definition.
Qubit the music
Music, writes Miranda in a paper published on MDPI (the Multidisciplinary Publishing Institute), is “the art of organizing sounds in space and time.” Cellular automata, per the discussion above, are collections of data objects that transform themselves in space and time. Therefore, Miranda’s insight was to map the transitions of cellular automata to the progressions of musical notes and chords. It seems to me that between notes, pitches, harmonies, durations, rests, instrumental parts and everything else that goes into a musical composition, the amount of data and number of dimensions for your cellular automata could get extremely large. Miranda doesn’t say so explicitly, but I’m sure that this is what led him to explore quantum cellular automata—where each cell is represented by a qubit rather than a classical data structure.
So far so good—with qubits there’s more flexibility of data representation and speed of execution, but then there are some other limitations to work around. Specifically, the process of updating your grid of quantum cellular automata has additional problems. You could write a circuit that can, via quantum entanglement, work on multiple qubits simultaneously, but you can’t really scale it to a useful size. For many thousands of qubits, or more, acting as quantum cellular automata, the hardware doesn’t exist yet.
To make a long story short, Miranda turned to a technique called Partitioned Quantum Cellular Automata (PQCA), which essentially divides the grid into manageable subsets of qubits. He could then run smaller quantum circuits on each of the partitions, still entangling the qubits as they get updated.
Now that the quantum cellular automata were sorted out, Miranda could start working on mapping the contents of the cells to audible music. His idea was to convert each cell into a string of bits (much like is done in genetic algorithms) and divide that bit string into components that would define all the characteristics of a cluster of notes. For a one-dimensional PQCA, he created an 18-bit string where two bits defined the source (instrument) of the notes, three bits specified the duration (half-note, quarter-note, whole note, etc.) of the sound, one bit identified a rest, and the remaining 12 bits indicated the tones to be played. He then expanded his work to a two-dimensional PQCA, enabling him to have the quantum computer produce polyphonic music, replicating multiple instruments but using the same concept of bit strings as defined above. This was executed on the IBM System 1 quantum computer with 127 qubits.
Name that quantum tune
The result is Miranda’s album Qubism. Listen to it and let me know what you think in the comments section of this post. I won’t give my opinion until I’ve heard from at least some of you.
Miranda’s notes accompanying the work explain the interaction between the live musicians and the quantum computer(s). In the piece entitled Zeno 2.0,[5] the quantum computer was able to react in real time to the live instruments and produce complementary music. I find it fascinating that the inherently stochastic nature of quantum computing means the music it produces varies each time it is played—much like a jazz ensemble performing improvisations. Another piece, Qubism: Interact features variations on a theme. A solo violinist plays a short tune recorded live by a laptop computer on the stage. The music is transmitted to Miranda’s software running on the System 1 quantum computer in IBM’s cloud, which after only a couple of beats’ rest, plays back several minutes of synthesized saxophone music repeating and elaborating on the original tune in increasingly complex ways.
Miranda seems to detect shades of Bach in how these variations play out in both pieces, and he might be at least partly right—though Bach’s work is, to my ear, far richer. For what it’s worth, I think that The Art of the Fugue is still the gold standard of contrapuntal music—an ideal that Miranda and his collaborators can aspire to.
In the conclusion to his paper on MDPI, Miranda emphasizes that he is no fan of computer-generated music per se—it lacks the soul and cultural context of human-composed music. I agree, and I’m all in favour of his approach of having technology support musicians in creating original works. Without resorting to generative AI, machine learning and cellular automata appear to be the preferred tools for this human-technological collaboration.
Quantum is becoming an important part of this process. Miranda notes, perhaps only half-seriously, that there is no quantum advantage just yet in musical composition—he also points out that Qubism could not have been written or performed without a quantum computer. I like that he advocates for the music industry to become quantum-ready because, as he says, “In the process of learning and experimenting with this new technology, novel approaches, creative ideas and innovative applications are bound to emerge.”
So maybe Pythagoras was on to something, after all—just not in the way he or Johannes Kepler thought. But let’s leave the last word to Kepler’s more famous contemporary, the Bard himself, William Shakespeare—who, as always, says it best:
There’s not the smallest orb which thou beholds’t
But in his motion like an angel sings.[6]
[1] The subjects in the less-important trivium were grammar, rhetoric and logic. Trivium is, of course, the root of the English word trivial.
[2] OK, we don’t really know what shape—if any—they have, but I still like to think of them as tiny spheres. Also of interest is the bloch sphere, a clever mathematical representation of a qubit and its possible states.
[3] My father loves to tell the story of how, when I was a teenager, the piano teacher told my parents to stop wasting their money on me. I’m one of the few kids whose music teacher fired me, rather than the other way around.
[4] A square, as noted, would have eight neighbours. Move to three dimensions and a cube has 26 neighbours. I’ll leave it to you to try other shapes and higher dimensions.
[5] I’m intrigued by this title, and I wonder if Miranda took any inspiration from Zeno’s paradoxes of motion. He doesn’t say anything more about it.
[6] The Merchant of Venice, Act V, Scene I
Music was lyrical but lacked heart and soul which I feel only a human can give it.
Is it true that Quantum computing can only be done at extremely low temperatures?