Quantum Brain
← Back to papers

QAC: Quantum-computing Aided Composition

Omar Costa Hamido·February 9, 2022·DOI: 10.1007/978-3-031-13909-3_8
Computer ScienceEngineeringPhysics

AI Breakdown

Get a structured breakdown of this paper — what it's about, the core idea, and key takeaways for the field.

Abstract

In this chapter I will discuss the role of quantum computing in computer music and how it can be integrated to better serve the creative artists. I will start by considering different approaches in current computer music and quantum computing tools, as well as reviewing some previous attempts to integrate them. Then, I will reflect on the meaning of this integration and present what I coined as QAC (Quantum-computing Aided Composition) as well as an early attempt at realizing it. This chapter will also introduce The QAC Toolkit Max package,1 analyze its performance, and explore some examples of what it can offer to realtime creative practice. Lastly, I will present a real case scenario of QAC in the creative work Disklavier Prelude #3. Computer Music and Quantum Computing tools Recent literature exploring the intersection of Quantum Computing (QC) with creative music practice, of which this book is a prime example, have welcomed the potential increase in speed and computational power offered by future fault tolerant QC machines. In the context of Computer Music (CM), a need for more powerful machines is evident in the limitations that classical machines still present for the realtime (or near realtime) control of compositional processes [2]. Several research projects have already proposed proof-of-concept implementations that integrate QC with music practice, in simulation or with current hardware. However, there is still no consistency between the tools, and approaches undertaken in these explorations, and current CM practice. More importantly, a disconnect between scientific research and creative practice, may only serve to maintain a gap between scientists and artists. My proposed line of inquiry here intends to bridge that gap by focusing on the tools used and how they articulate with realtime creative music practices. 1 The QAC Toolkit is available via the Max Package Manager [1]. Pre-publication draft, to appear in the book Quantum Computer Music, E. R. Miranda (Ed.) Omar Costa Hamido, PhD QAC: Quantum-computing Aided Composition Figure 1 Computer Music Tools and Quantum Computing Tools Modern Computer Music tools and Quantum Computing tools have been shaped by their main users in their practice in such a way that each might currently be regarded as capable of drawing their own self-contained world of practice and practitioners (see figure 1). CM tools include score engravers, Digital Audio Workstations (DAW), and visual programming environments, like Musescore [3], Ableton Live [4], and Max/MSP2 [5], respectively. The use of these 3 categories of tools is deeply embedded in the creative practice of writing musical scores, recording and producing a track, and developing new interactive instruments as well as enabling realtime control of compositional processes. On the other hand, current QC tools seem to inherit greatly from code-based programming practices, where the majority of its user base is found. These include the different QC programming frameworks3 like Qiskit [6], Cirq [7], and pyQuil [8], that are accessed using a terminal or a Jupyter notebook, as well as some web apps that allow the design of circuits online like Strangeworks [9], IBM Quantum Experience [10], and QPS [11].4 These QC tools, based on a more traditional computer programming paradigm, can still be regarded as inheriting the punch card computation paradigm. In it, the user is faced with the clearly delineated step sequence of writing the code, submitting the code to be executed, and waiting for the results to come back. On the other hand, within the CM tools sphere, it is often seen the predominance of a realtime computation paradigm, where the program is being changed as it is being executed. It is worth noting that, while I offer these simple categories here, painting the landscape with large brushstrokes, there are examples of practices that challenge these broad boundaries. Such is the case with live coding [14] where performer-composers can be found programming music live using code-based languages, and often projecting their code on a screen on stage alongside them. 4 For a more complete list of current Quantum Computing tools see [12], [13]. 3 Most of them are based in the Python programming language. 2 From now on, in this chapter, simply referred to as Max. Omar Costa Hamido, PhD QAC: Quantum-computing Aided Composition Computer Music practice, in its broadest sense, is strongly informed by this realtime computation paradigm. From listening to notes as they are being dropped on a score, to tuning audio effects while a song is playing, and algorithmically generating tones and melodies that respond to a live input on the fly. Previous attempts for an integration Given that only recently QC has become more available to the larger community of researchers and enthusiasts worldwide, in both tools and learning references, the first initiatives to integrate QC with Music Composition mostly came from researchers with a Computer Science background. Unsurprisingly, these attempts have relied heavily on QC code-based tools, meant for non-artistic practice. Such is the case with Hendrik Weimer's quantenblog, where he presents some musical examples that were built with his C library for QC simulation, libquantum [15]. As early as 2014, I myself attempted to integrate the (then very obscure) QCL programing language5 with my compositional practice and electroacoustic setup, with no practical success. A second generation can be found expressed in the work published by researchers with stronger artistic considerations. The integration strategies present in these works are mostly characterized by more complex systems that include higher software stack requirements, or simply the proposal of a new CM dedicated application altogether. The first generation of the Quantum Synthesizer [17], a Max-based synthesizer making use of QC, can illustrate this. In this first generation of the Quantum Synthesizer, a 48 hour hackathon project at the Qiskit Camp Europe, in September 2019 [18], Max is used as a frontend where the user changes selected parameters that are passed to a backend Python environment via OSC.6 In turn, this Python environment, that can be running on the same machine or somewhere else in the local area network, is configured with Qiskit and running several Python scripts that account for the network information exchange and to programmatically build quantum circuits based on the parameters received from Max. These circuits are then simulated locally (with or without a noise model) or sent to real quantum computer hardware in the cloud. After retrieving the execution results, these are returned to Max, via OSC, which changes the state of the synthesizer accordingly (see figure 2). 6 Open sound control, a mostly music related, udp-based, networking protocol. 5 The first quantum computing programming language by Bernhard Ömer [16] Omar Costa Hamido, PhD QAC: Quantum-computing Aided Composition Figure 2 Architecture of Quantum Synth. From [17] A similar strategy is explored by Eduardo Reck Miranda in his interactive quantum vocal system architecture (see figure 3). In it, there is also a CM system that is connected to a Python environment, within a networked software architecture. However, Miranda’s approach relies more heavily on the direct use of Python and Jupyter notebooks, with Csound scripts being triggered from the Python environment [19], [20, p. 17]. The musical output, in this case, is managed through a more code-based interface, which was intended to work more seamlessly with the QC framework. This is at the cost of a higher learning curve, and a less realtime CM environment. Figure 3 The interactive quantum vocal system architecture. Reproduced by permission from Eduardo Reck Miranda [20, Fig. 15] Omar Costa Hamido, PhD QAC: Quantum-computing Aided Composition Another approach, taken by James Weaver, has been to create an entirely new CM application environment from scratch. In his web application, Quantum Music Composer, Weaver creates a new interface that allows the user to generate 3rd species counterpoint melodies, based on melody and harmony matrices [21]. The app generates output as Lilypond code, that can be rendered as a readable musical score using the Lilypond music score engraver [22]. Though it has a more clean interface, its use is also more restricted than the previous examples. It is clear from most of these examples that more visual user interfaces, that aren’t simply just a terminal window, are more inviting to musicians and creative users. However, it is also clear that most of these implementations still relied on rather complex software infrastructures that are not easy to set up and modify during the creative process. Weaver’s system requires considerable non-CM and non-QC skills to modify it and use it to achieve a different compositional goal. Miranda’s system requires more knowledge of code-based practices. And my own initial version of the Quantum Synthesizer, even in the more inviting user interface that was explored shortly after its hackathon conception (see figure 3), requires different software pieces to be running at the same time and be launched in the correct order. Figure 4 Second GUI for the Quantum Synth presented in [23] Omar Costa Hamido, PhD QAC: Quantum-computing Aided Composition At this point, there is both a need for more musician friendly interfaces as well as to rethink what is to be expected of this integration and what it should look like. On the one hand it seems that reducing code-based language barriers is one avenue, on the other hand, simplifying the deployment/setup/configuration process of these systems is equally important to make it a more practical tool. For the rest of this chapter, I will give an account of my own work to this effect. A new Quantum-computing Aided Composition When exploring the integration of QC with Music, it is important to have a clear idea of w

Related Research

Quantum Intelligence

Ask about quantum research, companies, or market developments.