Bell and Shor Take the Spinductor for a Walk
Endless calculation, inevitable evolution, artistic opportunity. The Spinductor is an instrument that allows users to harness quantum spin via magnets in their hands to create musical gestures with the electromagnetic field surrounding us. Musical material in this piece is generated using quantum algorithms which can be run using qubits – a fundamental unit of computation relying on spin. The control you have over this instrument is unlike any other; rather than having direct control over the music, you instead improvise using probabilities the nature of the music. Every gesture through the instrument engages at least twelve dimensions of correlated musical parameters, which could in turn affect the tone-color of the sound, the pace of the music, the way it echoes, and so much more. With the permission and guidance of the composer, please come and interact with the Spinductor, and travel alongside the algorithms of Bell and Shor on a walk towards the unusual and unexplored.
Interactive Demo times - if you want to play the Spinductor visit at one of the following times:
Monday November 4th, 1:30 - 2:30 PM
Thursday November 7th, 3:00 - 6:00 PM
Saturday November 9th, 5:00 - 9:00 PM
Wednesday November 13th, 5:00 - 8:00 PM
Thursday November 21st, 3:00 - 6:00 PM
Quantum Spin
This piece is fundamentally an appreciation and utilization of quantum spin. There are two main components: there is algorithmic music generated using quantum algorithms (or classical approximations of those algorithms), and there is an instrument (the spinductor) which allows the performer to explore the sonic space using magnetism.
When spins align, strong magnetic fields are created. Individual spins can also be used as a unit of computation called a quantum-bit or qubit. Qubits form the basis of quantum computers, and there are several algorithms which have been designed to take advantage of the unique properties of quantum computers.
Bell's Inequality
What I'm doing with spatialization and melodic contour comes from running tests as described in the below paper by Mermin run on a simulated quantum computer. In essence, the results of this simulation are acting as a random number generator. Each of the three bases correspond to a different speaker, and a green or red measurement (which could be interpreted as measuring a spin qubit up or down) dictate whether a small melodic fragment is ascending or descending in pitch. In practice, these little melodies overlap quite a bit so this particular sonification is very much obscured by everything else going on in the piece.
Shor's algorithm
Shor's algorithm is an important algorithm in the history of quantum computing, but it is not an algorithm which can be run usefully on today's hardware - we'll see if that's still the case in a few years time. The algorithm allows us to factor very large numbers into their constituent prime numbers, for example 42 decomposes into 2, 3, and 7. Shor's algorithm has spurned a lot of interest in quantum technology for several reasons, one of the more obvious of which being that the problem of factoring large numbers is actually the basis behind RSA encryption, which keeps a lot of things safe online like bank accounts and passwords. With a sufficiently large computer, Shor's algorithm can be used to break that encryption.
How I am musically using results from Shor's algorithm is described later...
Magnets
In short, the individual spins of particles each generate their own tiny little magnetic fields. If all the spins are aligned, then the net effect is multiplied and we have a permanent magnet! But then what exactly is magnetism other than a manifestation of spin? And what is spin exactly? I can't answer that concisely (or confidently), but I can direct you to the video on the left to start.
Hall Effect Sensors
In order to detect the magnetic fields at specific locations in the spinductor, I am relying on Hall-effect sensors as my magnetometers. In essence, a current is run through a little rectangular bit of metal. As a magnet gets closer to the sensor, the stream of electrons is deflected to one side in that rectangular metal. Because there are now more electrons on one side of the metal than the other, there is now a voltage which can be measured perpendicular to the direction of current-flow through the sensor. The amplitude of this perpendicular voltage is proportional to the strength of the magnetic field.
Arduino
Once the Hall-effect magnetometer reads a voltage, that data is sent via a multiplexer to a little Arduino microcontroller. The data from 12 sensors is consolidated here, and sent using a serial communication protocol to my computer.
Here are the parts I am using: https://www.sparkfun.com/products/14571
https://store.arduino.cc/products/arduino-nano
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview
Sonification
To generate the pitch material for this piece, I read results from prime-factor calculations (Shor's algorithm) and Bell-style tests one at a time.
When the prime-factor data is read in, I know the number, and the factors are stored in a data-array. For example, the prime factors of 42 are [2, 3, 7]. I then make fractions out of every possible combination of prime factors. In this case, the list would be [2/2, 2/3, 2/7, 3/2, 3/3, 3/7, 7/2, 7/3, 7/7]. If a fraction equals one, I discard it- [2/3, 2/7, 3/2, 3/7, 7/2, 7/3]. If, in the Bell-style test, the quantum state is measured as "up", then I discard all the fractions less than one - [3/2, 7/2, 7/3]. The measurement basis of the Bell-style test determines from which speaker the musical event corresponding to this newly created list of fractions will be emitted.
Every 0.8 seconds or so, a stream of musical events is created using our new list of fractions. If I have some reference pitch like A4 = 440 Hz, I multiply that reference frequency by our list of fractions, creating a stream of pitches to be emitted from a speaker (and I also prepend the sequence with the reference pitch): [440, 660, 1,540, 1026.67]. I could also represent this using pitch names: [A4, E5, G6, C6].
Some numbers generate a very long list of prime factors, which is why sometimes very long, repeated sequences of pitches (ostinati) are generated.
One other note on prime numbers. Following the procedure listed above, a prime number will generate a sequence of only one pitch, namely A4. Instead, the prime numbers have a structural role in the piece; whenever a prime number is found, the reference pitch changes and the rhythm of new measurements modulate slightly. The result is that this endless piece has distinct sections end-capped by prime numbers.
FluCoMa and FM Synthesis
All the magnetometer data coming in via the serial port is used to control timbre (sound-color) and make subtle changes in delay, reverberation, and rhythm. The interpolation between timbres is controlled by a neural-net (powered by FluCoMa), and the sounds themselves are made using FM synthesis. In short, for every sound you hear, there are two sine-tones used to create that sound. One sine-tone, called the modulator, adjusts the frequency of the second sine-tone, called the carrier. Even though just two sine-tones are involved, you can get really wild sounds to come out of the speakers by altering how they interact.
In preparing this piece, I trained the neural net by designing a few interesting sounds and telling the instrument where I'd like to 'place' those sounds relative to the spinductor. The neural net then handles interpolation between those points, and it is this higher-dimensional neural networked timbre space in which the performer is exploring.
Miscellaneous Thoughts
Placing the couch and television in the space help to give the installation a 'living room' vibe, implying that quantum technology may one day be part of our daily lives. After all, classical computers are practically attached to us today, maybe there are quantum technologies waiting to be discovered that will make them cheap and convenient one day.
Here's a GitHub repository where most of the code for this project is stored: https://github.com/Xavman42/bell_and_shor_take_the_spinductor_for_a_walk