Giovanni A Cirillo
Oct 8 · 7 min read

Authors: Edoardo Giusto, Mohamad Vakili, Omar Costa Hamido, Baiardialberto and Giovanni Amedeo Cirillo

You probably know it: Quantum Computers are real, and you can play them! We developed an interface between Qiskit and Max to generate sound synthesis encoded on the basis states of a quantum computer.

Intro

From September 12th to 15th, the first international IBM Qiskit Camp hackathon in Europe was held [1], [5]. The playground for the contest was Piz Gloria, Schilthorn (Switzerland), where the famous 007 movie “On Her Majesty’s secret service” was shot [2]. Among the participants, there were MSc students, Ph.D. students, Post-Doc and Professors coming from 19 countries around the globe, guided by the IBM technicians involved in hardware and software design.

Somehow, the main characters of this story got an invitation to the event. Part of the team was attending “Quantum Information for Developers” summer school at ETH, Zurich [3], in the previous days: there Edoardo, Gianni, and Mohammad from Turin, Italy met Omar from Irvine, CA and decided to partner up right away. When in Piz Gloria then, they also took on board Alberto from Zurich, who was wandering between the tables and different projects.

From the beginning, they knew that they didn’t have enough background in quantum information, compared to the other participants, to provide a research-innovative work based on Qiskit. Against all odds, the team still believed they would be able to come up with a compelling project, a project that some would call the “Fiorino a metano” (explanation later) of this quantum hackathon racing track.

We (now it is possible to change the pronoun) proposed Quantum Synth, an audio synthesizer based on the imperfections of nowadays usable Quantum Computers, inherently affected by noise. The tool is on the one hand didactic, since it provides a different way to learn and teach about certain aspects of quantum computing with sound, on the other it can also be employed by music performers and composers in their creative process. The project gained the Community Choice Award, assigned by the other participants at the event.

The idea

The timbre of musical instruments can be considered — according to the Fourier theory — to consist of multiple harmonic or tones, nothing but sine waves of different frequency and amplitude. The combination of different harmonics generates sounds with different timbres and this is what allows us to perceive the difference between musical instruments.

A music synthesizer electronically generates and modifies sounds: waveforms generated in hardware or software are then altered in intensity, duration, frequency, and timbre, according to the preferences of the musician. This technique permits to produce sounds with harmonics/notes on a frequency range much larger than conventional musical instruments.

In our Quantum Synth we explored two possible synthesis techniques to generate and modify our sound in the following manner:

  1. subtractive synthesis, in which a white noise audio signal is filtered by up to twelve bandpass filters in order to alter its timbre with the selected specific harmonics to be kept;
  2. wavetable synthesis, in which a timbre is created by constructing the waveform from the ground up.

In both cases, a quantum circuit is exploited to encode either the frequencies (thus the notes) to be selected in the subtractive synthesis or the quantized-time samples of the waveforms to be added together in the wavetable synthesis. For what concerns wavetable synthesis, Quantum Synth currently encodes the probabilities of each tone in an octave, made of twelve harmonic/notes, in four qubits encoding the amplitude of the sixteen waves to be added.

The main novelty of our work is that music synthesis is not implemented anymore on a classical digital computer but, let’s say, on a quantum computer!

The block scheme of the system is reported in the following. The main actors are:

  • Max, a visual programming language for music and multimedia;
  • Qiskit, an open-source quantum computing software development framework for executing quantum algorithms on today’s quantum processors or to simulate them on classical computers.

The composer can choose the configuration mode of the synthesizer and the “quantum circuit to play” with Max, then a quantum circuit is generated and then executed with Qiskit. In conclusion, the results provided by the quantum circuit are exploited for music synthesis.

Block scheme of Quantum Synth

Two different Max interfaces have been developed for subtractive and wavetable syntheses: each one permits to choose the backend, which could be a simulator (affected or not by noise) or a real quantum computer, the quantum circuit employed as reference for synthesis operations, the note or to be played, the mode and noise fidelity. Moreover, they have specific features as the Q-factor for harmonic selection in subtractive synth. Qiskit returns a string containing the twelve or sixteen probabilities to be exploited for sound synthesis.

Max interface for subtractive synth
Max live interface for wavetable synth

In order to interface Max and Qiskit, a UDP protocol-based server has been developed. The middleware parses a configuration command from Max, then it runs circuit on the selected backend via-Qiskit. After finishing the job, the middleware sends the final set of probabilities to the Max application, thus closing the loop of the block-scheme.

Demonstrations

The keys of Quantum Synth are basic quantum circuits. Each circuit produces a specific state for the qubits, that are then encoded according to the type of synthesis. The quantum circuits interfaced with Quantum Synth are:

  • Bell state generation;
  • Equal superposition of N states which can be chosen by the user;
  • Hadamard superposition of all states;
  • square wave signal generation (additive synthesis);
  • Grover’s search quantum circuit.

How do each circuit sound like? Take the last one, the Grover’s search circuit: have you ever thought that the procedure of amplitude amplification for a quantum state can be interpreted as a volume amplification of a certain note? This is exactly what our Quantum Synth does! Starting from an equal superposition of low-volume notes, behaving as noise,

Initial probability distribution of Grover’s search, retrieved from [6]

Grover’s search gradually amplifies the volume of the desired note, until it is well-distinguishable among the others.

Probability distribution after the first iteration of Grover’s search, retrieved from [6]

The following picture shows how Quantum Synth works for Grover’s search: the desired note (C#4) is encoded onto the second state vector and its probability has been already significantly amplified.

System overview for Grover’s search (third iteration)

Conclusions

An overview of the main components of Quantum Synth has been presented with some brief demonstrations. We invite interested developers, composers and quantum computing learners to visit our repository on Github [4] and follow our social accounts on Twitter and YouTube. We are going to continue this project in future, adding new quantum circuits and synthesis techniques. Moreover, we have identified an important and challenging context of application where Quantum Synth could be employable in future: the characterization in phonic terms of the intrinsic noise of quantum computers. Noise is a critical aspect which limits the fabrication of more powerful and fault-tolerant quantum computers and we hope that our system can facilitate the analysis of non-ideality phenomena of quantum hardware. Even though possible research areas for Quantum Synth can be defined, it is always important to remind which is the main goal of Quantum Synth: making some noise with a quantum computer!

Footnotes:

[1] https://community.qiskit.org/events/europe/

[2] https://www.imdb.com/title/tt0064757/

[3] https://qid.ethz.ch/

[4] https://github.com/menegolli/Quantum_synth

[5] https://medium.com/qiskit/recap-2019-qiskit-camp-europe-908c8d8d72e4

[6] https://community.qiskit.org/textbook/ch-algorithms/grover.html

Devotion

Fiorino a metano in da heart

We were inspired by a series of YouTube videos that went viral in Italy, the ones of “Fiorino a metano”. The Fiat Fiorino is a small commercial vehicle, beloved mean of transporting all sorts of stuff up to the point it has become an icon of the working class.

Fiorino a metano ruling Italian highways

Why we love it? It is a symbol of hard work and patience, remembering everybody that, even if you are driving a methane-propelled small cube, you can still overrun Ferrari and Lamborghini supercars.

Soundtrack

You have a car. You have a radio in the car. You play “L’Amour Tojours”, for sure. It is a song recorded by the Italian disk-jockey Gigi D’Agostino, who comes from Turin, hometown of Gianni, Edoardo, and Mohammad. It is one of the most famous tracks of Italian electronic/dance music. We started developing Quantum Synth keeping in mind that we wanted to play this song with a quantum computer.

As you can clearly observe from the video, Gigi D’Agostino’s tracks are usually played at rave parties.

QuantumSynth

Let’s make some noise with a quantum computer!

 by the author.

Giovanni A Cirillo

Written by

QuantumSynth

Let’s make some noise with a quantum computer!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade