⚠️Warning: this article is still under construction 🚧
QHack 2021— a Quantum Machine Learning (QML) hackathon sponsored by Xanadu, AWS and others — started last week 🥳⚛️
And, much like the QML community itself, it grew considerably larger… 2650+ people, 430+ teams, 85 countries — a long, long way from the 2019 edition.
I never had much inclination for hackathons, but with its tron-ish look and amazing guest speakers — if you’ve been paying attention to the latest QML publications, you’ll recognize more than a few names — this was an opportunity I just couldn’t miss 👨💻
In this article, I will share some of my personal experiences as a newcomer to QHack and how I survived my first (but certainly not last) QML hackathon. As I am writing these lines, the Open hackathon portion is still going, so I will only be covering the QML challenge.
Near the end, you’ll find a complete list of references I used while preparing for QHack and that helped get through the QML hackathon challenges — be warned, it’s quite an extensive list!
⚠️Warning: Please notice that this article is not a walkthrough of the QML challenge problem set. According to information shared on the Xanadu slack channel, most of the hackathon challenges will (eventually) find their way to PennyLane’s demos page — so be patient 😉
What is QML?
“(…) a perfect marriage of buzzwords” — Protocol
QML is a research area that explores the “interplay of ideas from quantum computing and machine learning” (PennyLane).
For beginners, the quantum bit (pun intended) of QML may seem daunting. Quantum mechanics (QM) does have a reputation of being notoriously difficult to learn. This, and I can’t stress this enough, is simply not true. From MOOCs to beginner-level tutorials, you’ll find plenty of stuff online to get you started on your quantum journey.
Eventually, though, you’ll want to get your hands dirty. As the late Asher Peres once wrote “quantum phenomena do not occur in a Hilbert space, they occur in a laboratory” (Peres, 1995). The good news is that the advent of quantum cloud services like IBM Quantum Experience, Amazon Braket or Azure Quantum (in preview), and quantum programming languages and frameworks has made it a lot easier to run quantum “experiments” without an actual lab — whether it’s using a good ol’ simulator or one of those Devs-like quantum “chandeliers” we keep seeing on quantum computing articles.
💡 Tip: A great way to get started is to check the code samples from IBM, AWS and Microsoft, and the awesome quantum computing and quantum software repos available on GitHub.
From finance to healthcare and everything in between, quantum computing, and QML in particular, has a huge potential to disrupt and revolutionize strategic key areas, and there are already plenty of quantum applications and use-cases out there. Some, nevertheless, are still far, far away… 🔭
In the age of noisy intermediate-scale quantum (NISQ) devices, emphasis on noisy and intermediate-scale, it’s often hard to distinguish what pure quantum and quantum-enhanced (hybrid) devices can and cannot do (or, as Scott Aaronson puts it, read the fine print), and steer clear of false advertising. Ignoring these limitations will lead us into the perfect storm of hype, hubris and hogwash.
QML is a vibrant, new field with great potential, but a very young one still 👶 It’ll be interesting to see what the top 20 teams come up with during the Open hackathon. Who knows, maybe the next quantum killer app is already afoot…
💡 Tip: As of February 2020, the best way to learn QML is to attend Peter Wittek’s QML course on EdX — the lecture videos are available on YouTube. Unfortunately, Peter disappeared in September 2019 during a hiking expedition to the Himalayas. His legacy, however, is stronger than ever. The Unitary Fund (UF) and the Quantum Open Source Foundation (QOSF) have recently announced the creation of the Wittek Quantum Prize for Open Source Software.
After 3 full days of lectures and amazing guest speakers, here are some of the highlights — all videos are available on Twitch:
Day 1
We kicked things off strong with a high-level introduction to quantum differentiable programming (Q∂P) by Maria Schuld (Xanadu + University of KwaZulu-Natal), which paired up nicely with Josh Izaac’s (Xanadu) talk on Q∂P with PennyLane.
😋Tongue-in-Cheek Moment: The 1st half of this talk can be summarized by a few quotes from Karpathy’s book of aphorisms (unofficial title):
The PennyLane website contains a page dedicated to quantum differentiable programming, and you should definitely check the original PennyLane paper (Bergholm et al., 2018) for additional details.
💡 Tip: You’ll find some great introductions to differentiable programming (read Q∂P minus the Q) here and here — this last one uses Julia. If you want to know what powers the ∂P engine viz. automatic differentiation and how it’s used in ML, check out (Baydin et al., 2018).
Patrick Coles (Los Alamos National Laboratory) offered some great advice on how to design and build quantum variational algorithms (pictured below)
In the NISQ era, variational algorithms running on hybrid devices are pretty much the workhorse of QML applications. Virtually every problem in the QML challenge involved some sort of variational circuit.
💡 Tip: For more information, check out this great (and freshly out of the print) review article on variational quantum algorithms by Cerezo et al. (2020)
Day 2
Sukin “Hannah” Sim (Harvard + Zapata Computing) gave an update from the trenches of parametrized quantum circuits (PQC) optimization with some interesting work on parameter-efficient circuit training (PECT).
During the afternoon session, Guillaume Verdon (Sandbox@Alphabet) announced Floq 🦜— a quantum SaaS API built on top of TPUs — because, apparently, quantum ❤️ TPUs
Having placed in the top 50, I got the chance to play around with an alpha version of the Floq simulator — keep in mind, it’s still highly experimental (!). It will be interesting to see how the service evolves and incorporates the feedback from QHack’s early batch of users.
Day3
In a throwback to my early days as a particle physicist, Sofia Vallecorsa (CERN) showcased some great quantum technology initiatives in high energy physics (HEP) — from quantum SVMs for Higgs boson classification (Wu et al., 2020) and particle tracking with quantum GNN (Tüysüz et al., 2020) to quantum GANs for detector simulation (Chang et al., 2021) and beyond.
💡 Tip: For an introduction to QML in HEP, check out Schuld et al. (2020)
Finally, Murphy Niu (Google AI Quantum) gave us a peek behind the curtain of what it means to do ML at Google Quantum. A special mention to the work on quantum sample learning (Niu et al., 2020) and the final observations on where Google is heading QML-wise.
- If you want to win, team up—time is your worst enemy during an hackathon and working alone can only get you so far up the scoreboard; assemble a team (the hardest part!), define some goals (e.g. reaching top 50), identify possible constraints (different timezones, day job from 9 to 6, exam season around the corner, &c.), create a battle plan (tackle “low hanging fruit” problems first, go for a certain category, &c.), distribute the challenges among your teammates according to their expertise and start climbing that hackathon hill ⛰️
- Know thy primitives — make sure you have a solid knowledge of Pennylane’s quantum operations and templates, it will save you a lot of time
- Read, don’t F-read— read the problem statement carefully from top to bottom and don’t shy away from lengthy descriptions
- Don’t cower before (seemingly) hard problems — this happened to me with the natural gradient problem and it ended up being one of the easiest to implement
- Don’t stay too long on the same problem — either go outside and breathe some fresh air or move on to the next problem
- K.I.S.S. and follow your instincts— don’t overcomplicate (elegant solutions usually involve just a few lines of code) and trust your intuition (if you “know your stuff”, it’s usually right)
- Think outside the box but stay in the box— using drag-n-drop simulators like Quirk is a great way to gain some intuition on what an Ansatz is actually doing but not much else; run experiments while coding and keep a log of all the changes you’ve made and what their impact was
Links
Videos
Articles
- (Aaronson, 2015) Quantum Machine Learning Algorithms: Read the Fine Print
- (Abbas et al., 2020) The power of quantum neural networks
- (Abhijith et al., 2018) Quantum algorithm implementations for beginners
- (Adcock et al., 2015) Advances in quantum machine learning
- (Aïmeur, Brassard & Gambs, 2013) Quantum speed-up for unsupervised learning
- (Arrazola et al., 2019) Quantum-inspired algorithms in practice
- (Arunachalam & Wolf, 2017) A survey of quantum learning theory
- (Baydin et al., 2018) Automatic differentiation in machine learning: a survey
- (Benedetti et al., 2019a) Parameterized quantum circuits as machine learning models
- (Benedetti et al., 2019b) A generative modeling approach for benchmarking andtraining shallow quantum circuits
- (Bergholm et al., 2018) PennyLane: Automatic differentiation of hybrid quantum-classical computations
- (Bharti et al., 2021) Noisy intermediate-scale quantum (NISQ) algorithms
- (Biamonte et al., 2017) Quantum machine learning
- (Biswas et al., 2017) A NASA perspective on quantum computing: opportunities and challenges
- (Bova, Goldfarb & Melko, 2021) Commercial applications of quantum computing
- (Cao, Guerreschi & Aspuru-Guzik, 2017) Quantum neuron: an elementary building block for machine learning on quantum computers
- (Cao et al., 2018) Quantum chemistry in the age of quantum computing
- (Carleo et al., 2019) Machine learning and the physical sciences
- (Cerezo & Coles, 2020) Impact of barren plateaus on the hessian and higher order derivatives
- (Cerezo et al., 2020a) Cost-function-dependent barren plateaus in shallow quantum neural networks
- (Cerezo et al., 2020b) Variational quantum algorithms
- (Ciliberto et al., 2018) Quantum machine learning: a classical perspective
- (Colless et al., 2017) Robust determination of molecular spectra on a quantum processor
- (Cong, Choi & Lukin, 2018) Quantum convolutional neural networks
- (Crooks, 2019) Gradients of parameterized quantum gates using the parameter-shift rule and gate decomposition
- (Dallaire-Demers & Killoran, 2018) Quantum generative adversarial networks
- (Dong et al., 2008) Quantum reinforcement learning
- (Dunjko, Taylor & Briegel, 2016) Quantum-enhanced machine learning
- (Endo et al., 2020) Variational quantum simulation of general processes
- (Farhi & Neven, 2018) Classification with quantum neural networks on near term processors
- (Greene-Diniz & Ramo, 2019) Generalized unitary coupled cluster excitations for multireference molecular states optimized by the variational quantum eigensolver
- (Garg & Ramakrishnan, 2020) Advances in quantum deep learning: an overview
- (Guan et al., 2020) Quantum machine learning in high energy physics
- (Guerreschi & Smelyanskiy, 2017) Practical optimization for hybrid quantum-classical algorithms
- (Harrow, Hassidim & Lloyd, 2008) Quantum algorithm for linear systems of equations
- (Havlicek et al., 2018) Supervised learning with quantum enhanced feature spaces
- (Higgott, Wang & Brierley, 2018) Variational quantum computation of excited states
- (Holmes et al., 2021) Connecting ansatz expressibility to gradient magnitudes and barren plateaus
- (Huang et al., 2020) Power of data in quantum machine learning
- (Huggins et al., 2018) Towards quantum machine learning with tensor networks
- (Jones et al., 2019) Variational quantum algorithms for discovering hamiltonian spectra
- (Khoshaman et al., 2018) Quantum variational autoencoder
- (Killoran et al., 2019) Continuous-variable quantum neural networks
- (Kopczyk, 2018) Quantum machine learning for data scientists
- (Krantz et al., 2019) A quantum engineer’s guide to superconducting qubits
- (Lanyon et al., 2009) Towards quantum chemistry on a quantum Computer
- (Lau et al., 2016) Quantum machine learning over infinite dimensions
- (Leymann et al., 2020) Quantum in the cloud: application potentials and research opportunities
- (Li et al., 2020) Quantum reinforcement learning during human decision-making
- (Liu & Rebenfrost, 2017) Quantum machine learning for quantum anomaly detection
- (Liu, Yao & Zhang, 2020) Quantum-classical machine learning by hybrid tensor networks
- (Lloyd et al., 2020) Quantum embeddings for machine learning
- (Lloyd, Mohseni & Rebenfrost, 2013) Quantum algorithms for supervised and unsupervised machine learning
- (Lloyd, Mohseni & Rebenfrost, 2014) Quantum principal component analysis
- (Lloyd & Weedbrook, 2018) Quantum generative adversarial learning
- (Lockwood & Si, 2020) Reinforcement learning with quantum variational circuits
- (Lubasch et al., 2019) Variational quantum algorithms for nonlinear problems
- (Luongo, 2020) Quantum algorithms for machine learning
- (Mari et al., 2019) Transfer learning in hybrid classical-quantum neural networks
- (Mari, Bromley & Killoran, 2020) Estimating the gradient and higher-order derivatives on quantum hardware
- (McArdle et al., 2018) Quantum computational chemistry
- (McClean et al., 2015) The theory of variational hybrid quantum-classical algorithms
- (McClean et al., 2016) Hybrid Quantum-Classical Hierarchy for Mitigation of Decoherence and Determination of Excited States
- (Mitarai et al., 2018) Quantum circuit learning
- (Nakanishi, Mitarai & Fujii, 2019) Subspace-search variational quantum eigensolver for excited states
- (Paparo & Martin-Delgado, 2012) Google in a quantum network
- (Perdomo-Ortiz et al., 2018) Opportunities and challenges for quantum-assisted machine learning in near-term quantum computers
- (Perry et al., 2019) Quantum computing as a high school module
- (Peruzzo et al., 2013) A variational eigenvalue solver on a photonic quantum processor
- (Peters et al., 2021) Machine learning of high dimensional data on a noisy quantum processor
- (Preskill, 2018) Quantum computing in the NISQ era and beyond
- (Rebentrost, Mohseni & Lloyd, 2013) Quantum support vector machine for big data classification
- (Romero et al., 2017) Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz
- (Romero-Fontalvo, 2019) Variational quantum information processing
- (Santagati et al., 2016) Witnessing eigenstates for quantum simulation of hamiltonian spectra
- (Sarma, Deng & Duan, 2019) Machine learning meets quantum physics
- (Schuld, 2021) Quantum machine learning models are kernel methods
- (Schuld et al., 2018a) Circuit-centric quantum classifiers
- (Schuld et al., 2018b) Evaluating analytic gradients on quantum hardware
- (Schuld & Killoran, 2018) Quantum machine learning in feature Hilbert spaces
- (Schuld, Sinayskiy & Petruccione, 2014a) An introduction to quantum machine learning
- (Schuld, Sinayskiy & Petruccione, 2014b) The quest for a quantum neural network
- (Schuld, Sweke & Meyer, 2020) The effect of data encoding on the expressive power of variational quantum machine learning models
- (Sim, Johnson & Aspuru-Guzik, 2019) Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms
- (Stoudenmire & Schwab, 2016) Supervised learning with quantum-inspired tensor networks
- (Sweke et al., 2019) Stochastic gradient descent for hybrid quantum-classical optimization
- (Verdon et al., 2019) Quantum hamiltonian-based models & the variational quantum thermalizer algorithm
- (Wiebe, Braun & Lloyd, 2012) Quantum data fitting
- (Wiebe, Kapoor & Svore, 2014) Quantum algorithms for nearest-neighbor methods for supervised and unsupervised learning
- (Yuan et al., 2018) Theory of variational quantum simulation
- (Zhao, 2018) Quantum statistical inference
- (Zhu et al., 2019) Training of quantum circuits on a hybrid quantum computer
- (Zoufal, Lucchi & Woerner, 2020) Variational quantum boltzmann machines
Books
- (Aaronson, 2013) Quantum Computing since Democritus
- (Bernhardt, 2019) Quantum Computing for Everyone
- (Griffiths, 2018) Introduction to Quantum Mechanics
- (Hidary, 2019) Quantum Computing: An Applied Approach
- (Johnston, Harrison & Gimeno-Segovia, 2019) Programming Quantum Computers: Essential Algorithms and Code Samples
- (Mermin, 2007) Quantum Computer Science
- (Nielsen & Chuang, 2012) Quantum Computation and Quantum Information AKA “Mike & Ike”
- (Peres, 1995) Quantum Theory: Concepts and Methods
- (Schuld & Petruccione, 2018) Supervised Learning with Quantum Computers
- (Schumacher & Westmoreland, 2010) Quantum Processes Systems, and Information
- (Susskind & Friedman, 2015) Quantum Mechanics: The Theoretical Minimum
- (Wittek, 2014) Quantum Machine Learning: What Quantum Computing Means to Data Mining
- (Yanofsky & Mannucci, 2008) Quantum Computing for Computer Scientists