Source-linked AI summary

Quantum Generative Adversarial Networks for Learning and Loading Random Distributions

Christa Zoufal, Aurélien Lucchi, Stefan Woerner

arXiv:1904.00043v2quant-ph

TL;DR

Exact loading of generic data into n-qubit states can require O(2^n) gates, motivating a more efficient approximation. The paper trains a hybrid qGAN channel that learns distributions from samples and loads them with O(poly(n)) gates, demonstrating simulation, hardware, and quantum-finance applications.

  • Problem

    Exact preparation of a generic n-qubit state requires O(2^n) gates, and this loading cost can dominate quantum-algorithm complexity.

  • Method

    A hybrid qGAN trains a quantum channel with a classical discriminator to learn and approximately load generic probability distributions inferred from data samples.

  • Results

    The scheme requires O(poly(n)) gates and was evaluated through simulation, IBM quantum processors, and a QAE-based European call-option pricing application.

  • Takeaways & Limitations

    The trained gate-based quantum channel can be integrated into other quantum algorithms and reused for approximate distribution loading.

  • Takeaways & Limitations

    QAE execution on a quantum computer requires further improvements, including longer coherence times and higher gate fidelities.

Abstract

from arXiv · show

Quantum algorithms have the potential to outperform their classical counterparts in a variety of tasks. The realization of the advantage often requires the ability to load classical data efficiently into quantum states. However, the best known methods require $\mathcal{O}\left(2^n\right)$ gates to load an exact representation of a generic data structure into an $n$-qubit state. This scaling can easily predominate the complexity of a quantum algorithm and, thereby, impair potential quantum advantage. Our work presents a hybrid quantum-classical algorithm for efficient, approximate quantum state loading. More precisely, we use quantum Generative Adversarial Networks (qGANs) to facilitate efficient learning and loading of generic probability distributions -- implicitly given by data samples -- into quantum states. Through the interplay of a quantum channel, such as a variational quantum circuit, and a classical neural network, the qGAN can learn a representation of the probability distribution underlying the data samples and load it into a quantum state. The loading requires $\mathcal{O}\left(poly\left(n\right)\right)$ gates and can, thus, enable the use of potentially advantageous quantum algorithms, such as Quantum Amplitude Estimation. We implement the qGAN distribution learning and loading method with Qiskit and test it using a quantum simulation as well as actual quantum processors provided by the IBM Q Experience. Furthermore, we employ quantum simulation to demonstrate the use of the trained quantum channel in a quantum finance application.

I. INTRODUCTION

The paper addresses the exponential cost of exact generic quantum-state loading by proposing an approximate, efficient qGAN-based loading channel for probability distributions inferred from samples. It positions this channel for integration with quantum algorithms and demonstrates implementations and a finance application.

  • Exact preparation of a generic n-qubit state requires O(2^n) gates, which can dominate an otherwise advantageous quantum algorithm.
  • The proposed hybrid scheme trains an approximate quantum data-loading channel for generic probability distributions implicitly specified by data samples.
  • Unlike qGANs aimed at classical sample generation or quantum-state estimation, this implementation trains a quantum generator whose output state represents the data distribution.
  • The resulting quantum channel can be prepared and reused, and is described as compatible with approximate state preparation in QAE and HHL under stated conditions.
  • The method is implemented with Qiskit, tested in simulation and on IBM quantum processors, and applied to European call-option pricing with QAE.

II. GENERATIVE ADVERSARIAL NETWORKS

Classical GANs learn distributions from samples through competition between a generator and discriminator. Their alternating optimization uses losses that encourage generated samples to resemble real data while discriminators distinguish real from generated samples.

  • GANs use a generator and discriminator to learn random distributions implicitly given by training data samples.
  • The generator maps samples from a fixed prior distribution into outputs intended to be indistinguishable from samples of the real distribution.
  • The non-saturating generator objective maximizes the likelihood that generated samples receive real-data labels.
  • The discriminator distinguishes training data from generated data, while the generator seeks outputs labeled as real.
  • Generator and discriminator parameters are optimized in alternating updates, producing non-stationary objective functions.

III. QGAN DISTRIBUTION LEARNING

The qGAN uses a parametrized quantum circuit as generator and a classical neural-network discriminator to learn probability distributions from measured quantum samples. Its design supports scalable representations, tunable circuit complexity, and distributions ranging from unimodal to multimodal cases.

  • The qGAN trains a quantum generator and classical discriminator to capture the probability distribution of classical training samples.
  • The approach targets generic distributions and is explicitly suitable for both unimodal and multimodal distributions.
  • The quantum generator transforms an n-qubit input state into an output state whose computational-basis measurement frequencies define the modeled probabilities.
  • The number of qubits determines loading resolution, while affine mappings and multidimensional registers extend the scheme to suitable grids and d-dimensional distributions.
  • The variational circuit alternates RY rotation layers with CZ entanglement blocks; on n qubits and depth k, it uses (k+1)n single-qubit and kn two-qubit gates.
  • Increasing circuit depth enables more complex representations, while RY and CZ choices preserve probability amplitudes when parameters are zero.
  • Efficiently loadable input states can reduce generator complexity and training epochs, and may help avoid local optima.
  • The classical discriminator processes samples through nonlinear neural-network layers and must be balanced against the generator during alternating optimization.

A. Simulation Study

The simulation study trains qGANs under varied target distributions, initializations, and generator depths, evaluating distribution-learning performance across repeated quantum-simulation runs. Increasing generator depth and suitable initialization generally improve outcomes, with robust results for depths k ≥2.

  • Experimental settings: The quantum generator is implemented in Qiskit for execution on simulators and IBM Q Experience hardware.The simulation study uses quantum simulation, while Qiskit also supports execution on quantum hardware.
  • Training procedure: Training alternates discriminator and generator updates after batches of 2,000 training samples and 2,000 measured generator samples.Each epoch shuffles the training data, splits it into batches, and updates both networks alternately.
  • Evaluation: Kolmogorov-Smirnov statistics, relative entropy, accepted-run counts, and their means and standard deviations evaluate training performance over 10 repetitions.The KS test uses confidence level 95% with acceptance bound b = 0.0859.
  • Results: Increasing generator depth k usually improves training outcomes, while carefully chosen initialization can be especially favorable for bimodal targets.For depth k ≥2, standard deviations are relatively small and accepted-run counts are usually close to 10, supporting the authors’ robustness conclusion.
  • Results: Figure 3 compares trained probability density functions with generator and discriminator loss progress for representative target distributions.Examples use depth 2 for log-normal and triangular targets, and depth 3 for the bimodal target.
  • Experimental settings: The study benchmarks qGAN training across log-normal, triangular, and bimodal target distributions with uniform, normal, and random initializations.Quantum generators use 3 qubits representing 8 values and depths k ∈ {1, 2, 3}.

IV. APPLICATION IN QUANTUM FINANCE

The quantum-finance application trains a qGAN to load an asset’s spot-price distribution for European call-option pricing. The trained distribution is used for payoff estimation by sampling and Quantum Amplitude Estimation, including a run on IBM Q Boeblingen.

  • qGAN application: The application trains a qGAN data-loading unitary for the spot-price distribution underlying a European call option.Training is performed with different initial states in simulation and with random initialization on IBM Q Boeblingen.
  • Option pricing: A European call’s payoff is max{S_T − K, 0}, and its undiscounted fair price is the expected payoff.The option is exercised only when the asset price at maturity S_T exceeds strike price K.
  • Option pricing: The trained quantum channel is used with Quantum Amplitude Estimation to evaluate characteristics such as the expected payoff.The probability distribution and payoff function must be encoded into a quantum operator for QAE.
  • Scope: The illustrative example uses the analytically computable Black-Scholes model, while more realistic stochastic processes and complex payoffs are commonly evaluated with Monte Carlo simulation.The paper notes that Black-Scholes often oversimplifies real circumstances.
  • Results: The method approximately loads the distribution required for the finance calculation and supports QAE-based option pricing with a generator trained on real quantum hardware.The workflow proceeds from simulation training to hardware training and then QAE-based pricing.

A. QGAN Training

The qGAN was trained on discretized log-normal samples using different generator initializations, first in simulation and then on IBM Q Boeblingen. Carefully chosen initialization improved training, while both noisy simulation and hardware training converged toward the target distribution.

  • Simulation setup: 2,000 samples? No, 20,000 samples from a truncated log-normal distribution were rounded to the generator’s integer grid for training.The distribution used mean µ = 1, standard deviation σ = 1, and support [0, 7].
  • Initialization comparison: Uniform and normal initialization performed better than random initialization in the simulated qGAN training.The comparison used generator and discriminator losses together with the trained generator PDF.
  • Initialization comparison: Carefully chosen initialization clearly improved training, although all three initializations eventually produced reasonable results.The random initialization performed worst, while the normal initialization began with a relatively small relative entropy.
  • Statistical evaluation: Normal initialization produced better Kolmogorov-Smirnov statistics than uniform initialization, which outperformed random initialization; the null hypothesis was accepted for all settings.The statistics are reported for samples from the trained generator and the discretized, truncated log-normal distribution.
  • Hardware training: 10^-3 learning rate and 200 optimization epochs were used for the hardware run, with random initialization selected because it required the fewest gates.The same training data, quantum generator, and discriminator were used as before; analytic gradients used 8,000 measurements.
  • Hardware training: Relative entropy converged close to zero on both IBM Q Boeblingen and noisy simulation, while hardware recalibration could cause prominent fluctuations.The convergence indicates that the trained generator evolved toward the random distribution underlying the training samples.
  • Statistical evaluation: The hardware results were consistent with training an appropriate model, as confirmed using the Kolmogorov-Smirnov statistic at 95% confidence.The hardware comparison was made against a noisy quantum simulation.

B. European Option Pricing

A generator trained on IBM Q Boeblingen was used to load an approximate maturity-price distribution into QAE for European call pricing. QAE required fewer samples than Monte Carlo, but approximation and mismatched noise conditions limited the comparison.

  • QAE integration: The trained quantum generator loaded an approximate distribution for the maturity spot price ST into QAE to estimate E[max{ST − K, 0}] for K = $2.The target distribution was log-normal, and the payoff corresponds to a European call option.
  • Evaluation methods: QAE used 256 quantum samples, while Monte Carlo used 1,024 measured generator samples for the same expected-payoff estimation.The QAE evaluation used m = 8 evaluation qubits and generator parameters trained on IBM Q Boeblingen.
  • Results: QAE required only one fourth of the samples because of its better scaling, while the 95% confidence intervals were comparable in size to Monte Carlo’s.The comparison included analytic evaluation, hardware-based Monte Carlo, and classically simulated QAE.
  • Results: Both confidence intervals were close to the exact value but did not contain it because the loaded distribution was approximate.The intervals were reported at a 95% confidence level.
  • Limitations: The Monte Carlo and QAE estimates were exposed to different noise levels because Monte Carlo ran on hardware whereas QAE ran on a simulator.Running QAE on a quantum computer would require improvements such as longer coherence times and higher gate fidelities.

V. CONCLUSION AND OUTLOOK

The paper demonstrates qGAN-based approximate probability-distribution loading with polynomial gate complexity and integration into gate-based quantum algorithms. It also identifies open questions concerning model design, barren plateaus, and data representations.

  • O(poly(n)) gates are required for approximate qGAN-based loading, compared with O(2^n) gates for exact loading of generic distributions.The exact-loading complexity can dominate a quantum algorithm’s overall complexity.
  • A gate-based quantum channel trained by the qGAN can be integrated directly into other gate-based algorithms.The paper demonstrates this integration for European call option pricing with a QAE-based algorithm.
  • Varying qubit count n and circuit depth k trades loading resolution against training-data complexity, while online learning can update the model with new samples.The authors state that online or incremental learning may reduce training time in real-world scenarios.
  • The optimal quantum generator, discriminator, and training strategy remain unresolved for a given problem.The paper notes that the most suitable model structure and training strategy are not known a priori.
  • Barren plateaus were not observed experimentally, but their possible occurrence and mitigation require further investigation.The paper lists several classical and variational-quantum strategies as possible countermeasures.
  • Qubit-basis encoding naturally represents discrete, equidistant values, motivating further study of continuous and non-equidistant data types.

VII. CODE AVAILABILITY

The qGAN implementation is publicly available through Qiskit, with tutorials covering training and QAE-based application. The paper also describes isometric quantum generators as open-system evolutions implemented using ancilla qubits.

  • The qGAN algorithm is publicly available as part of Qiskit.Tutorials cover training and application in the context of Quantum Amplitude Estimation.
  • An isometric quantum generator can be implemented by adding ancilla qubits to a larger unitary evolution.This follows from representing an isometry as a partial trace of a unitary evolution.
  • Using an isometric quantum generator can be advantageous for learning random distributions in some settings.

Appendix B: Multivariate Historical Data for Portfolio Optimization

The qGAN scheme is applied to the distribution of the first two principal components of multivariate Treasury rates. Quantum simulation evaluates training with six qubits and compares generated and real distributions using relative entropy.

  • The qGAN learns and loads a distribution underlying the first two principal components of US government bond Treasury rates.The trained channel can be used with QAE to evaluate a government-bond portfolio’s fair price.
  • The simulated training uses more than 5,000 samples after discarding values below the 5th or above the 95th percentile.Batches contain 1,200 samples and training runs for 20,000 epochs.
  • The unitary generators use n = 6 qubits, representing 3 qubits per principal-component dimension, with depths k ∈ {2, 3, 6}.The input is a multivariate uniform distribution and parameters are initialized uniformly within [−δ,+δ], with δ = 10^-1.
  • The discriminator uses 512 input nodes, 256 hidden nodes, and one output node, with the generated-versus-real evolution evaluated through relative entropy.
  • Figure 9 tracks relative entropy between the quantum generator and the multivariate distribution underlying the training data for depths k ∈ {2, 3, 6}.

Appendix C: Practical Initialization of a Normal Distribution

The appendix develops practical initialization and QAE-based use of qGAN-loaded distributions. A shallow variational circuit approximates a normal initialization, while QAE maps thresholded payoff amplitudes to expectation estimates with quadratic sampling-error scaling.

  • Practical initialization of a normal distribution: A 3-qubit, depth-1 variational circuit fits a discretized normal distribution by least-squares loss for approximate initialization.The approach avoids involved exact normal-distribution loading techniques but does not scale to higher-dimensional distributions.
  • Practical initialization of a normal distribution: The fitted circuit approximates several normal, triangular, and bimodal target distributions with least-squares errors of order 10^-4.
  • Quantum Amplitude Estimation: QAE estimates the amplitude a efficiently, and the probability of measuring the final ancilla in |1⟩ equals a.This enables evaluation of E[max{0, S_T − K}] from the measured probability.
  • Quantum Amplitude Estimation: The QAE estimation error is bounded by π/2^m, giving quadratic improvement over classical Monte Carlo in the number of quantum samples.
  • Quantum Amplitude Estimation: The QAE construction prepares a probability-weighted state and uses a comparison ancilla to mark values exceeding the strike price K.The comparison maps |i⟩|0⟩ to |i⟩|1⟩ when i > K.
  • Quantum Amplitude Estimation: The payoff function is mapped into another ancilla amplitude, implementing channel A for the QAE procedure.The practical implementation approximates the exact linear objective rotation.

Appendix G: Hardware Efficient Circuit Implementation

The IBM Q Boeblingen chip’s linear connectivity requires SWAP gates for the three-qubit entanglement block, while an equivalent lower-CX circuit is preferred for qGAN training on hardware.

  • Gate decomposition: The lower circuit in Fig. 13 is equivalent to the illustrated upper circuit while requiring fewer CX gates.The lower circuit is consequently the favorable implementation choice for qGAN training on actual quantum hardware.
  • Measurement mapping: The lower circuit projects measurement of qubit q1 (q2) onto bit c2 (c1).
  • Connectivity constraints: The IBM Q Boeblingen chip provides only linear connectivity for the three-qubit subset comprising qubits 0, 1, and 2.This connectivity is shown in Fig. 12 and constrains the hardware implementation of the entanglement block.
  • Connectivity constraints: Implementing the entanglement block on qubits 0, 1, and 2 therefore requires SWAP gates.The required SWAP-based implementation is shown in Fig. 13(a).
  • Gate decomposition: The available IBM Q gate set implements CZ ◦ SWAP with 4 CX gates: 3 for the SWAP and 1 for the CZ.
Loading 1904.00043v2…