Physics-inspired Generative AI models via real hardware-based noisy quantum diffusion
Authors: Marco Parigi, Stefano Martina, Francesco Aldo Venturelli, Filippo Caruso
Organizations: Department of Physics and Astronomy, University of Florence, Via Sansone 1, Sesto Fiorentino, 50019, Florence, Italy. · LENS - European Laboratory for Non-Linear Spectroscopy, University of Florence, Via Nello Carrara 1, Sesto Fiorentino, 50019, Florence, Italy. · Department of Engineering, Pompeu Fabra, T`anger 122-140, Barcelona, 08018, Barcelona, Spain.
Quantum Diffusion Models (QDMs) are an emerging paradigm in Generative AI that aims to use quantum properties to improve the performances of their classical counterparts. However, existing algorithms are not easily scalable due to the limitations of near-term quantum devices. Following our previous work on QDMs, here we propose and implement two physics-inspired protocols. In the first, we use the formalism of quantum stochastic walks, showing that a specific interplay of quantum and classical dynamics in the forward process produces statistically more robust models generating sets of MNIST images with lower Fréchet Inception Distance (FID) than using totally classical dynamics. In the second approach, we realize an algorithm to generate images by exploiting the intrinsic noise of real IBM quantum hardware with only four qubits. Our work could be a starting point to pave the way for new scenarios for large-scale algorithms in quantum Generative AI, where quantum noise is neither mitigated nor corrected, but instead exploited as a useful resource.
Figures & tables
Figure 1: Example of dm for discrete data. An initial data distribution q(x0) is transformed into a uniform categorical distribution π(x2) after T=2 time steps. The forward transition kernel is q(xt∣xt−1) , while p(xt−1∣xt) is the transition kernel of the backward process obtained by training an ann .
Figure 2: Comparison between the Gaussian probability distribution (violet squares) obtained from a crw and probability distribution of a qw with Hadamard coin (red circles).
Figure 3: The kl divergence between the populations of a single qsw and the uniform distribution on a cycle graph of 8 nodes for different value of ω after T=20 time steps. The walker is initially in the node 0 , corresponding to the state ρ=\outerproduct00 , and its evolution over the graph is obtained by solving the equation Eq. 22 .
Figure 4: Illustration of the model. Each pixel of an image sample represents an independent quantum stochastic walker moving on a cycle graph of 8 nodes that correspond to the gray intensity values. The walker moves on the graph by Eq. 22 .
Figure 5: Box plot of fid values for different values of ω . Every box is obtained from 10 different repetitions of for the same value of ω with T=20 , 8 -cycle graph. Mean and standard error of the mean are also reported. The plot show how the hybrid quantum-classical diffusion dynamics (ω=0.3) results to generate statistically better image datasets.
Figure 6: Image generation with qsw -based dm via a quantum ( ω=0 ), hybrid (ω=0.3) and a classical ( ω=1 ) forward chain of T=20 time steps. We use the models with the inferior median values of fid between the 10 repetitions of Fig. 5 . We report the first two steps of the forward chain (in the first row) of 9 different samples, and the evolution of the distribution of the pixel values for the entire dataset of digits 0 of MNIST (blue bins in the second row) that is compared with the final uniform prior (orange bins in the second row). The kl divergence value between the two distributions is reported on the top. We also illustrate the final two steps of 9 generated samples, and the fid score between the entire training dataset and generated dataset is reported (third row). In the last row, we compare the distribution of the pixel values of the entire generated dataset (blue) with the training dataset distribution (orange), and kl divergence between them.
Figure 7: Implementation of discrete time qw on cycle graph using quantum circuits. The H and P are respectively Hadamard and phase gates, and F is the quantum Fourier transform. The outer shaded block indicates a single time step of the walker and is repeated for t times up to T . The inner shaded block modulates the amount of noise in the circuit by a delay operation scaled as in Eq. 26 . The final measurements are also shown.
Figure 8: Images generation with qw -based dm with noise from real ibm_brisbane nisq device. We report for selected values of t the evolution of 9 random samples of the real dataset in forward (first row) and 9 random generated samples in backward (third row). In the second row we show the evolution of the pixel values distributions (orange) for the entire training dataset reporting the kl divergence with the uniform distribution (blue). Finally, in the fourth row we show the value distributions of a generated dataset of the same dimension of the training set comparing it with the original dataset using the kl divergence. Also, we report for t=0 the value of fid equal to 169 between the original and generated dataset.
Figure 9: Qubit connectivity map of the real qpu ibm_brisbane (courtesy of IBM ( IBM, 2016 ) ). Every circle represents a qubit, and lines represent their connections. Colors code the readout errors (circles) and the errors for the connections (lines). Dark blue indicates a small error, while large one is in purple.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 10: Box plot, mean and standard error of the mean of the fid values for ω=0,0.1,…,1 obtained with the same setting used in Fig. 5 , but for the entire MNIST dataset and with a model trained for 100 epochs.
Figure 11: Box plot, mean and standard error of the mean of the fid values for ω=0,0.1,…,1 obtained with the same setting used in Fig. 5 , but for the EMNIST-letters dataset and with a model trained for 100 epochs.
Figure 12: Images generation with qw -based dm with noise from IBM simulator fake_brisbane .
Figure 13: Original MNIST images (first row) and images generated with a hybrid qsw dynamics (second row) and a qw -based dm with noise from a simulated (third row) and a real nisq device (fourth row) for digit from 1 to 9 . We also report the fid metric values between the original full training set and a same-sized generated dataset.
Program of Applied Mathematics, Department of Mathematics, University of Arizona, Tucson, USA · College of Computer Science and Technology, Zhejiang University, Hangzhou, China
BMW Group, Munich, Germany · Department of Computer Science and Institute of Applied Mathematics, University of British Columbia (UBC), Vancouver, Canada · Stewart Blusson Quantum Matter Institute (QMI), Vancouver, Canada +1
BCN Medtech, Department of Engineering, Universitat Pompeu Fabra, Barcelona, Spain · Barcelona Supercomputing Center, Barcelona, Spain · Department of Physics and Astronomy, University of Florence, Sesto Fiorentino, Florence, Italy +2