Source code and interface
The original research website describes a Python/Qiskit graphical interface for configuring quantum gates, running measurements, and translating their outcomes into musical sequences. It includes five selectable modes. The screenshots below are archived from the original website.
Original GitHub source repository ↗ Original Code page ↗
This is the earlier Quantum Gate Music Generator, distinct from the later web-based two-player Quantum-Game Dual Synth.
Graphical interface
Nbit_note). Nnotes sets the number of musical time steps: in Modes 1–4, this is also the number of active gate-control columns. Mode 5 has two players per time step, so four time steps require eight columns. Nshots sets the number of measurement runs. Measurement generates results, Playback plays them, and Stop Playback stops after the current shot sequence. The Save GUI State and Load GUI State controls preserve and restore the configuration.Gate selectors and sliders are arranged by musical time step, from left to right. Their interpretation depends on the selected mode. In the bottom result panel, the rightmost bit represents the earliest note; the full bitstring normally has Nbit_note × Nnotes digits, and each displayed row is a distinct outcome from the shots.

The bottom output panel shows measured bitstrings. The rightmost bit represents the earliest note in time; each row is a distinct result among the measurement shots.
Mode 1 · Stochastic note generation
One qubit encodes each note. For each time step, the user selects a measurement direction in the Bloch sphere’s x–z plane by specifying a rotation about the Y axis. The two possible measurement outcomes correspond to a pair of pitches separated by a tritone on the circle of fifths. A sequence of CNOT gates couples successive note qubits; depending on the gate and measurement settings, the resulting state can contain superposition and entanglement across time. The measurement outcomes are mapped to notes and played, with distinct outcomes from repeated shots forming alternative melodies.
Original example: four notes are configured using gate choices 1, 2, 3 and 4, corresponding to the pitch pairs G/F♯, G/D♭, D/A♭ and E/B♭. With ten shots, the illustrated run produced six different measurement results. The rightmost bit is played first. When Use circuit drawer is enabled, the circuit diagram is generated and saved as circuit_diagram.png.



Mode 2 · Pitch and duration
Two qubits encode each note: one selects its duration (0 → quarter note, 1 → half note) and the other selects a pitch using the same tritone-pair principle as Mode 1. The CNOT chain runs through the variables in the order duration of note 1 → pitch of note 1 → duration of note 2 → pitch of note 2 → …. This allows correlations between pitches and between pitch and duration, rather than generating those musical attributes independently.
Original example: with Nnotes = 4 and Nshots = 10, the user selects gates 1, 3, 4 and 6 (C/F♯, D/A♭, E/B♭ and G/D♭). Each measured bitstring contains eight bits, two for each of the four notes. In the illustrated run, all ten measured strings were different; this is an example, not a guarantee for every run.



Mode 3 · Chord generation
Three qubits represent one note using an eight-state encoding: |000⟩ denotes a rest, while |001⟩ through |111⟩ denote F, C, G, D, A, E and B in successive fifths. In this encoding the three bit positions contribute different scale-degree shifts: the least significant bit contributes a fifth, the next a second and the most significant a third. Quantum gates prepare superpositions restricted to the pitches of a selected diatonic chord, and measurement picks one of its constituent notes. Coupling notes across time also permits harmonic correlations between chords.
Original example: the GUI demonstrates the chord progression IM7 → iim7 → V7 → IM7. The accompanying images include the settings and generated notation.




Mode 4 · Quantum phrase modulation
Mode 4 retains the three-qubit, circle-of-fifths pitch encoding of Mode 3, but starts from user-specified notes rather than chord labels. The circuit for each note is initially prepared so that measurement would reproduce that specified pitch with certainty. Quantum-gate operations then introduce phase modulation between neighboring notes. These operations change the joint state before measurement, so later pitches can differ from their initial settings and a variety of phrase variations become possible. The modulation is introduced coherently at the quantum-state level rather than by adding random changes to already generated notes.


Mode 5 · Two-player quantum-game model
Each player supplies one note per time step. As in Mode 1, one qubit per note is associated with a selectable measurement axis and a pair of possible pitches. The two players’ qubits are entangled before measurement. Each player then chooses a measurement strategy independently, but the joint quantum state makes the observed outcomes interdependent. The musical result therefore reflects both players’ choices rather than two isolated note streams. The original site compares this form of mutual influence to the improvisational interaction of a jazz session.
For Nnotes = 4, there are eight active note-control columns: two players × four time steps. This is the earlier GUI-based model, not the separate 2025 browser-based Quantum-Game Dual Synth.


See also the separate 2025 two-player interactive music project.
Reference
Souma, S. (2022). Exploring the Application of Gate-Type Quantum Computational Algorithm for Music Creation and Performance. In Quantum Computer Music. Book chapter ↗ · Documents and manuscript →