The years of the pandemic were tragic and surreal. Our everyday way of life changed drastically and abruptly and some of these changes still linger today. I was doubly lucky: I was already working from home and I continued to do so. I am also introverted and the lack of human contact was not as severe for me as it was for others.
Nevertheless, I am not completely immune to isolation. The need for communication with other specimens of our species is too ingrained in our psyche. I became a regular of online meetups about books, physics, and mathematics - a cocktail of nerdy delights. A friend and I started a Physics study group - a field that has always been close to my heart. Given my love of mathematics, physics, and programming, it would have been impossible to ignore Quantum Computing, especially since its hype has been causing a deafening buzz.
It turns out that the elements of Quantum Computing, as far as algorithms are concerned, are not very hard to master. Programming, on the other hand, is challenging, with several competing libraries and platforms that are constantly in flux. I yearned to apply my new knowledge to something practical, so when I found out that Quantum Formalism was organizing a Quantum Computing Hackathon, I jumped at the opportunity.
The topic of the hackathon was a bit daunting for a neophyte: Quantum Federated Learning for NISQ devices with Genomics data. Up until then, I had no experience with either Federated Learning or Quantum Machine Learning. Luckily, we had over a month to complete our project. Me and my two teammates, Vesselin Gueorguiev and Krystal Maughan quickly came up to speed using the resources found in Qiskit, Pennylane, and various other sources in order to put together a Quantum Federated Machine Learning framework with Homomorphic Encryption. Our hard work paid off. We won first place and received a very generous award of $10,000 from Zaiku Group!
One of the great things about hackathons is that they’re like idea boot camps—once you start getting your hands dirty in a new field, the floodgates of creativity just burst open. There are many challenges to overcome that no amount of Googling or sweet-talking ChatGPT can solve. While chasing down answers, I stumbled upon a solution, that not even Google has seen before.
The Problem
The objective of Machine Learning is to make predictions by learning from a large number of examples. Imagine we want to determine whether a tumor is benign or malignant. We feed the system a vast collection of examples—like images, measurements, and statistics—each labeled as either benign or malignant. By analyzing these examples, the system "learns" to distinguish between the two. Then, when presented with a new, unlabeled example, it can classify it with a high degree of confidence. The inputs to the system are converted into numerical vectors, which are often quite large. The number of elements in these vectors is referred to as the "dimension" of the data set.
To implement machine learning methods on quantum computers, the first step is to transform each numerical vector into a quantum state. What is a quantum state? Putting aside mumbo-jumbo, like superposition and entanglement, a quantum state is a vector in a very high-dimensional vector space - almost. The elementary computing unit is called a qubit and the addition of each qubit to the circuit multiplies the dimension of the vector space by 2. For example, if you have N qubits, you can construct states in a space of (roughly) 2N dimensions. This indicates a clear advantage of quantum computers: they can achieve dramatic dimensionality reduction. For a vector of 1000 dimensions, only about 10 qubits are needed! The technique to achieve this is well known and is called “Amplitude Encoding”.
Yet almost no example I saw was using this encoding but instead were using much less impressive encodings that require as many qubits as the dimension of the vector. This struck me as odd, especially considering that quantum computers have a limited number of qubits compared to their classical counterparts. Moreover, quantum simulators running on old, boring computers can simulate an even smaller number of qubits.
I tried several quantum machine learning experiments with this amplitude encoding and I found that their accuracy was dismal - well below the commonly used Angle encoding. That explained why people were not using it. It was puzzling over the question of why the performance was so bad which led to my first contribution in the field. The answer was that amplitude encoding was implemented incorrectly because failed to account for the true nature of quantum state space.
The Solution
Remember I said that the quantum state space is almost a vector space and that N qubits give roughly 2N dimensions? In mathematical terms, these statements are inaccurate because qubits actually live in Projective Hilbert space, a manifold that behaves in some ways as a vector space but isn’t one. As a consequence, amplitude encoding implemented with N qubits produces a state of only 2N-1 dimensions. For example, if we encode a 64-dimensional vector with 6 qubits, the resulting space has dimension 26 -1 = 63. This loss of one dimension implies a loss of information, which in turn leads to accuracy degradation.
Once the problem was clear, so was the solution: We needed a more sophisticated way to embed a vector into the projective space. For technical reasons, this involves mapping a flat space onto a hypersphere. Luckily, this is something cartographers have been doing since the 15th century by creating maps of the earth. All I had to do was generalize from two dimensions to an arbitrary number of dimensions. Long story short, the improved encoding worked and achieved similar accuracy as other, more quit-wasteful encodings.
The Publication
I was very lucky that Bambordé Baldé of the Zaiku Group paired me with the mathematician Max Arnott to put together a paper on this idea. At that point, I was distracted by personal issues and I would have probably abandoned the effort. Max wrote the entire paper, worked out the mathematical framework around the idea, and enhanced it by combining it with equivariant embeddings to take advantage of natural symmetries in the data. His tireless work led to the publication of this paper. Our co-author Kieran McDowall with the NQCC performed additional simulations to demonstrate the combined advantages of the enhanced amplitude encoding and equivariant embeddings.
About the Author
Dimitri Papaioannou is a software scientist, mathematician, and data scientist. He has helped numerous startups design and develop high-availability, scalable products and deploy them to production. His primary areas of expertise are in financial technology, Software Architecture, Mathematical Modelling, and Machine Learning. Other areas of interest include Quantum Computing and Mathematical Physics.
Pre-Announcement: QF Fall Hackathon
Earlier this summer, we hosted a virtual test hackathon, which resulted in two teams emerging as winners. The first-place team took home a total prize of $2,000 in bounties. They will be sharing their experience and insights in an upcoming guest post, where they will discuss their journey through the hackathon and the use case they developed.
At QF, we're committed to empowering our community members with more than mathematical solid foundations. We're also committed to supporting those eager to explore practical applications in quantum computing. While the industry is still in its early stages, and the much-anticipated breakthrough or "wow moment" has yet to arrive despite the media hype, we believe that such breakthroughs may very well come from outside the traditional academic and large corporate settings and driven by unconventional thinkers from communities such as QF.
With that in mind, we're excited to announce another hackathon this fall! If you're a QF community member passionate about rigorous mathematics and cutting-edge technologies, including quantum computing, we encourage you to register your interest below. Unlike our previous test hackathon, this event will welcome more teams, and, of course, there will be bounty cash prizes up for grabs!
We’re in the final stages of selecting the use cases for the hackathon and will share more details publicly soon. Expect to see exciting challenges related to federated quantum learning, quantum embeddings, and more. Additionally, top participants will have the chance to secure internships and collaboration opportunities with our partner companies. Stay tuned for more updates!
QF Fall Hackathon Registration: https://forms.gle/WD7aMozzAVeZ5kfR6.
Thank you!
QF Team