qiskit-advocate / qamp-spring-22

Qiskit advocate mentorship program (QAMP) spring 22 cohort (Mar - Jun 2022)
13 stars 1 forks source link

`TorchRuntime` tutorial 2.0 (QML) #21

Closed ElePT closed 2 years ago

ElePT commented 2 years ago

Description

Qiskit Runtime is a new architecture offered by IBM Quantum that streamlines computations requiring many iterations of circuit executions and classical processing. In simple terms, this means that for iterative (repetitive) computations, the time spent queuing processes is reduced, so the overall execution time becomes significantly faster. For example, IBM researchers achieved a 120x speedup in a lithium hydride molecule simulation.

Qiskit Runtime allows to design custom runtime programs to run experiments in the remote runtime server, as well as runtime clients to interface with these programs from the user side. Quantum neural network training is a good example of iterative problem, where a training loop is defined, and multiple forward and backward passes are performed on each training step. This is why qiskit-machine-learning recently incorporated TorchRuntime, a runtime program that leverages the PyTorch machine learning library to streamline training and inference with quantum neural networks in the cloud 🎉.

Thanks to its use of PyTorch, TorchRuntime is extremely flexible in the kind of quantum machine learning problems it can tackle. The user can define any dataset or network architecture they want, be it a fully quantum, hybrid or even classical network, and customize the training hyper-parameters using the concept of hooks. While the core functionality of TorchRuntime is explained in the following tutorial, the examples are quite basic, and it can be difficult for inexperienced users to know how to implement more complex workflows.

This long introduction leads to the main goal of the project: Creating a new torch runtime tutorial that shows a more realistic usage with complex examples. One idea could be showing how to perform classification on the MNIST dataset using a hybrid quantum-classical neural network and TorchRuntime, but it can also be a chance to experiment with different QML problems and datasets.

With my help, you could dive deep into the realm of Qiskit Machine Learning, Qiskit Runtime and the mysteries of PyTorch (and with it, data serialization- the most mysterious of all). If you have found this description interesting, or would like to actually understand what I have been writing about, this might be the project for you.

While the main deliverable will be the tutorial notebook, any issues found on the way could lead to side contributions to the source code of TorchRuntime.

Deliverables

A tutorial, jupyter notebook in Qiskit Machine Learning repository, explaining the advanced functionality of TorchRuntime.

Mentors details

Number of mentees

1

Type of mentees

Required:

Nice to have:

q-inho commented 2 years ago

#21 TorchRuntime tutorial 2.0 (QML).pdf