This is the repository of our project "QDynamics" (part of the PushQuantum "Quantum Entrepreneurship Laboratory"). In this Project, we aim to modify a Physics Inspired Neural Network (PINN) to use a quantum layer. This proof of concept intends to show that it is possible to use Quantum Neural Network layers in Neural Networks that solve Partial Differential Equations (PDEs). With these Hybrid Quantum-Classical Neural Networks, it will most likely be possible to speed up Computational Fluid Dynamics (CFD) calculations in the future.
A Clickable Prototype of a Front-End for our CFD application using Figma can be found here.
A classical implementation of a Physics Inspired Neural Network (PINN) solving the Burger's Equation (which we adapted from https://github.com/pierremtb/PINNs-TF2.0 ), as well as our modification of this network to incorporate a quantum layer, can be found in the following Google Colab notebook.
The quantum layer found in the hybrid quantum neural network is structured as seen in the figure below:
We implemented the QPINN using Tensorflow Quantum. Unfortunately, since this framwork – like all Quantum Machine Learning Frameworks – is still very young, it does not provide the possibility to calculate higher-order gradients on quantum layers yet, which our application would require. Other people have also been experiencing this issue, so a corresponding feature will hopefully be provided soon. For this reason, our Quantum Physics-Inspired Neural Network (QPINN) is not entirely executable just yet.
To show that our Quantum Layer is most defininetely executable per se, we additionally provided a toy example using it in another neural network: keras_example_tfq.ipynb (or, as a Google Collab: https://colab.research.google.com/drive/1ngD5YMM7EeWnWxXgMZfk8GgXPdhSoexI)
For the classical version of the algorithm, the result is shown below. For higher resolution, we may refer you to the .pdf version in our repository.
Install requirements with:
pip -r requirements.txt