AI and Qubits: a collaboration in quantum art

Russell Huffman
4 min readApr 18, 2022

--

I recently started a collaboration with the AI artist Pindar Van Arman on a piece called Quantum Skull. As fellow enthusiasts in creative uses of emerging technology, Van Arman and I decided to explore how AI generated art and quantum generated art could be meaningfully used together. We ultimately arrived at Quantum Skull, a piece lead by Van Arman in his iconic style, but with a new quantum computing technique I’ve been working on as a part of the process. The entire project write up can be found here, but I would like to give a bit more of a deep dive on the quantum aspect of the artwork.

Image of the animated NFT.

Qubits to Pixels

The core quantum computing element of this piece was mapping individual qubits to individual pixels, and then encoding pixel color values into the assigned qubits. This technique differs from other quantum image processing techniques in that I am not mapping entire images to an entire quantum state, but instead individual pixels to individual qubits. By doing so, I can create much simpler (albeit still quite large) quantum circuits that can easily be run on today’s quantum hardware with minimal issues. There is still noise from the quantum system, but an amount that added to the aesthetic of the piece, which we liked. Without further ado, let’s get into the details.

Van Arman provided representative keyframes from the piece’s training set (this is AI art too, after all), which were 32px by 32px images. The goal is to map each qubit to each pixel, but this would require 1024 qubits per image, which unfortunately there are no quantum systems with enough qubits available yet. Fortunately, with this technique none of the qubits are entangled to each other, which functionally means I just need 1024 individual one qubit quantum systems, which can be spread out across multiple quantum computers, or I could recycle qubits from the same computer. I chose the latter option and whenever I ran out of qubits on the quantum system, I could start over with a fresh new quantum circuit and reuse the same qubits from the same device. This is key to being able to process large images on today’s quantum systems.

Next, let’s talk about encoding a pixel’s value onto a qubit. A pixel generally has 3 color channels: red, green, and blue. The mixture of these 3 channels gives the pixel all the visible colors we see on a computer screen. If you were to look really closely at a computer screen, you would see something like the following image, where all 3 colors are visible at varying degrees of brightness.

Example close up image of screen pixels

For this new quantum image processing technique, the three color values had to be encoded into the qubit 1 at a time and run separately, and then recompiled afterwards.

So how can a color be encoded into a qubit? Qubits store information based on rotation. A 0degree rotation should return the boolean value 0or off. A 180 degree (or pi) rotation should return the boolean value 1or on. Any rotation in between the middle is a superposition with a probability of returning either off or on . I think it’s important to say “off” and “on” here because that literally corresponds to the pixel being off or on. If a pixel’s value was, for example, 25 (not a very well lit pixel), I would give the qubit a rotation (an Ry rotation to be specific) of 25/255 * π . I would then run the qubit 100 times. Most of the time, the qubit would do nothing, but sometimes the qubit value would return on , which I could then easily map to the final image. I did this 3072 times (1024 pixels, and 3 colors each) on a quantum computer, and voilà, a full color image generated via qubits! This technique was done multiple times to create a quantum computing generated training data set.

The fully mapped images look like the following, and were sent back to Van Arman as reference in Quantum Skull.

Final quantum computing generated keyframe images

Quantum Skull has more steps involved, including painting robots, GANs, a quantum random number generator, and a few other puzzle pieces that make it unique. This blog post focused specifically on the new quantum computing technique used as a part of the composition. I’m very proud and excited to have worked with Van Arman on this piece, which was exhibited at Sotheby’s:
https://www.sothebys.com/en/buy/auction/2022/natively-digital-1-3-generative-art/quantum-skull.

--

--

Russell Huffman

I am a product manager with Quantum Computing Inc. I have an art background but grad school at Georgia Tech brought me into the tech scene.