Project Highlight: Quantum Computing Meets Machine Learning
If learning is the first step towards intelligence, it’s no wonder we’re sending machines to school.
Machine learning, specifically, is the self-learning process by which machines use patterns to learn rather than (in the ideal case) asking humans for assistance. Seen as a subset of artificial intelligence, machine learning has been gaining traction in the development community as many frameworks are now available.
And soon, you may have a machine learning framework available in your favorite quantum computing framework!
The winning project of 2019 Qiskit Camp Europe, QizGloria, is a hybrid quantum-classical machine learning interface with full Qiskit and PyTorch capabilities. PyTorch is a machine learning library that, like Qiskit, is free and open-source. By integrating Qiskit and PyTorch frameworks during the 24-hour hackathon, the QizGloria group demonstrated that you can use the best of the quantum and classical world for machine learning. The project is still ongoing modifications but may soon be integrated into Qiskit Aqua.
Below, we interview the four members of the QizGloria group about their project, their experiences, and their future outlook on the field. Interviews are edited for clarity.
Why did you think to combine Qiskit, a quantum-computing framework, with PyTorch, a machine-learning framework?
Karel Dumon: Classical machine learning is currently benefiting hugely from the open-source community, and this is something we want to leverage in quantum too. Our project focuses on the potential application of quantum computing for machine learning, but also on the use of machine learning to help progress quantum computing itself. Through our project, we hope to make it easier for machine learning developers to explore the quantum world.
Patrick Huembeli: To that effect, it makes Qiskit very accessible for people with a classical machine learning background — they can treat the quantum nodes just as another layer of their machine learning algorithm.
Amira Abbas: In that sense, this project bridges the gap between two communities, machine learning and quantum computing, whose research could seriously complement each other instead of diverging.
How do you think your integration will benefit the Qiskit community?
Dumon: There are a lot of open-source tools available for both quantum computing and machine learning, but those integrations do not provide the optimal synergy between the two worlds. What we tried to build is a tighter integration between Qiskit and PyTorch (an open-source machine learning framework from Facebook) that makes optimal use of the existing capabilities.
Isaac Turtletaub: In quantum computing, we commonly have circuits that need to be optimized with a classical computer. PyTorch is one of the largest machine learning libraries out there, and opens up the possibilities of using deep learning for optimizing quantum circuits.
How can others make use of your integration?
Turtletaub: The longterm goal is for anyone who is using quantum optimization or machine learning algorithms can hopefully use this project to use PyTorch to optimize their quantum circuits.
Huembeli: Any Qiskit function can be used together with classical machine learning. It was very important for us that there is no restriction on what type of Qiskit functions you can use.
Abbas: We are working on fleshing out the functionality of the project before formally adding it to the Qiskit Aqua element. Once that is completed, it will be as simple as an import in Python. We will also provide various tutorials on the official Qiskit tutorials GitHub repository to help users understand how to deploy the code with tangible examples. How one uses the actual software framework to solve problems or do research is totally up to the individual and the options are endless!
What was the most difficult part of this project?
Turtletaub: The most difficult part of the project for me was making sure that the PyTorch tools could accurately analyze what was going on in the quantum circuit by measuring the gradient.
Dumon: It took us the first day — until deep in the night — to get the boilerplate code working for our Qiskit-PyTorch integration. This was the hardest part. Once this was working, we built out several use cases in a couple of hours!
Do you plan to continue working on this project?
Dumon: During the hackathon, we built the bridge between the two worlds, and showcased some possibilities — but we definitely believe that this is just the beginning of what is possible! While our Qiskit Camp submission was a proof-of-concept, we are currently working with the Qiskit team to include our work in the Qiskit Aqua codebase.
Turtletaub: I plan on continuing to work on this project by contributing to a generalized interface between PyTorch and Qiskit, allowing this to work on any variational quantum circuit. I hope collaborating with the IBM coaches will let all Qiskitters take advantage of our project.
Abbas: We also plan on writing a chapter on hybrid quantum-classical machine learning using PyTorch for the open-source Qiskit textbook and created an pull request for this on GitHub.
What is one of the more difficult challenges still ahead?
Huembeli: Getting the parameter binding of Qiskit right. This will be very important if we want to continue this project. This has to be thought through very well.
In what other ways could this project be expanded?
Turtletaub: This project could be expanded by not only opening up Qiskit to PyTorch, but to another machine learning library, such as TensorFlow.
Huembeli: And if we integrate it well into Qiskit, people will be able to add any nice classical machine learning feature to Qiskit. There is really no limit of applications.
Abbas: Since everything is open source, members of the community can contribute to the code (via pull requests) and add functionalities; make things more efficient, and even create more tutorials demonstrating new ideas or research.
Dumon: We hope that others start playing around with our code and help shape the idea further. This is at the core of the open-source spirit.
And on another topic — Qiskit Camp Europe — what was your favorite part?
Huembeli: The hackathon. It was amazing to see what you can get done in 24 hours.
Turtletaub: My favorite aspect was being able to meet people interested in quantum computing from all across the world and being able to collaborate with some of the top researchers and engineers at IBM.
Abbas: Hands down, my favourite aspect of the hackathon was the people. Coming from South Africa, I was really worried I wouldn’t fit in or be good enough because I’m just a master’s student from the University of KwaZulu-Natal with no undergraduate experience in physics. But as soon as I arrived, I realised that the intention of others at the camp wasn’t to undermine others’ capabilities or differences, but to highlight them and use them to build beautiful applications with Qiskit. There were people from all types of backgrounds with differing levels of experience, and all so helpful, open and keen to learn. I was blown away by the creativity of the projects and I am convinced that the world of quantum computing has a very bright future if these are some of the individuals contributing to it.
QizGloria Project Members
Amira Abbas has an undergraduate degree in actuarial science and is now finishing up her master’s degree in physics at the University of KwaZulu-Natal in South Africa, after which she intends on enrolling in a PhD program. Abbas is very passionate about science and technology and her research focus is on quantum machine learning. Prior to Qiskit Camp Europe, Abbas had very little experience with Qiskit.
Samuel Bosch is a master’s student in physics and data science at École Polytechnique Fédérale de Lausanne (EPFL) in Switzerland but was unfortunately unavailable for interview.
Karel Dumon is a machine learning engineer with an academic background in engineering physics and industry experience in research and consulting. Dumon is currently setting up a start-up around quantum hardware & software. Dumon had used Qiskit a couple of times before, especially during the Quantum Machine Learning course of Peter Wittek, and also during this year’s QML bootcamp at Creative Destruction Lab (Toronto).
Patrick Huembeli is a PhD student in Quantum Information Theory at ICFO in Barcelona. Huembeli’s main interests are the application of machine learning and methods of interpretability of machine learning on quantum phase transitions. Prior the Qiskit Camp Europe, Huembeli did not have a lot of experience in Qiskit, but had used other quantum computing platforms such as DWave and Rigetti.
Isaac Turtletaub is an undergraduate student from North Carolina State University majoring in Computer Engineering with a minor in physics. Prior to Qiskit Camp Europe, Turtletaub had explored the use of quantum optimization algorithms for electronic design automation using Qiskit Aqua.
For those interested in collaborating, the full project is available on GitHub.
Machine learning was a popular topic at 2019 Qiskit Camp Europe. Related projects include The Queen’s Royal Lancers, a framework of quantum reinforcement learning for Qiskit Aqua; Quantum ML with Aqua a development of a new Python interface to handle the regression problem using Qiskit Aqua, and Q Genetic Programming, an application of techniques of evolving programming to Qiskit.
For those attending a future Qiskit Camp, check out Qiskit Camp 101, written by Amira Abbas, where you can learn six tips to maximize your Qiskit experience.