Source-linked AI summary
Variational quantum generators: Generative adversarial quantum machine learning for continuous distributions
Jonathan Romero, Alan Aspuru-Guzik
TL;DR
Continuous classical probability distributions lacked hybrid quantum-classical generative approaches suitable for near-term devices. The paper proposes a variational quantum generator that encodes latent variables, optimizes a variational circuit, and decodes expectation values, demonstrating adversarial training with classical or quantum discriminators.
Problem
Hybrid quantum-classical approaches for generative modeling of continuous probability distributions had not been developed.
Method
VQG combines a quantum encoder, an optimized variational generator circuit, fixed-observable measurements, optional classical post-processing, and gradient-based adversarial training.
Results
VQG learns target distributions in a proof-of-principle experiment, with both training schemes converging toward the expected loss equilibrium while KL divergence decreases.
Takeaways & Limitations
The architecture provides a framework for continuous-distribution generation and for combining variational circuits with classical neural networks in hybrid quantum-classical pipelines.
Takeaways & Limitations
Implementation on NISQ devices faces measurement noise and potentially vanishing gradients from barren plateaus.
Abstract
from arXiv · showhide
We propose a hybrid quantum-classical approach to model continuous classical probability distributions using a variational quantum circuit. The architecture of the variational circuit consists of two parts: a quantum circuit employed to encode a classical random variable into a quantum state, called the quantum encoder, and a variational circuit whose parameters are optimized to mimic a target probability distribution. Samples are generated by measuring the expectation values of a set of operators chosen at the beginning of the calculation. Our quantum generator can be complemented with a classical function, such as a neural network, as part of the classical post-processing. We demonstrate the application of the quantum variational generator using a generative adversarial learning approach, where the quantum generator is trained via its interaction with a discriminator model that compares the generated samples with those coming from the real data distribution. We show that our quantum generator is able to learn target probability distributions using either a classical neural network or a variational quantum circuit as the discriminator. Our implementation takes advantage of automatic differentiation tools to perform the optimization of the variational circuits employed. The framework presented here for the design and implementation of variational quantum generators can serve as a blueprint for designing hybrid quantum-classical architectures for other machine learning tasks on near-term quantum devices.
I. INTRODUCTION
Hybrid quantum-classical methods divide computation between quantum state preparation and classical processing, supporting machine-learning algorithms for near-term devices. This paper addresses the lack of hybrid approaches for continuous-distribution generation with a variational quantum generator trained adversarially.
- Motivation: Hybrid quantum-classical algorithms use quantum subtasks for state preparation and observable measurements while classical resources optimize parameters or perform remaining computation.This framework is motivated by limitations in qubit counts and coherence times of NISQ devices.
- Related work: Variational circuits support quantum machine-learning tasks by compressing quantum states, approximating nonlinear functions, and encoding classical data as circuit parameters.These capabilities have been investigated in quantum autoencoders and related variational-circuit models.
- Research gap: Existing hybrid quantum-classical generative approaches had not addressed continuous probability distributions, despite image and sound generation being examples of this category.The paper positions continuous-distribution generation as its central application gap.
- Contribution: The proposed variational quantum generator combines a quantum encoder, an optimized variational circuit, expectation-value measurements, and optional classical post-processing.The architecture is designed to provide flexibility and incorporation into classical neural-network architectures.
- Contribution: VQG training uses adversarial feedback from a discriminator and automatic differentiation, supporting either a classical neural network or a variational quantum classifier as discriminator.The discriminator distinguishes real-data samples from generator-produced samples while the generator learns from that feedback.
- Adversarial learning: Classical GANs train competing generator and discriminator networks so generated samples mimic real data, with the discriminator estimating whether a sample is real.Quantum adaptations vary in data type and whether the generator and discriminator are classical or quantum.
A. Architecture
The VQG architecture maps classical latent variables into quantum states, transforms them with a variational generator, and decodes measured observables into classical samples. A classical function can further transform the measurement vector into the final output.
- Architecture: VQG uses an encoding circuit R(z) on r qubits and a generator circuit G(Θg) on n qubits, with n ≥ r, to model observations x ∈ R^N.The encoder receives a random variable from a noise distribution, while the generator acts on the encoded state.
- Architecture: The encoder prepares the quantum latent state R(z)|0⊗r⟩ = |φ(z)⟩ from a classical random variable z ∼ pz(z).The latent state manifold is the quantum analogue of the latent space in classical generative models.
- Measurement decoding: The generator maps the encoded latent state to a variationally parameterized quantum state, which is decoded by measuring fixed Pauli-string observables.The resulting measurement vector is P = [⟨P1⟩, ⟨P2⟩, · · · , ⟨PM⟩].
- Classical post-processing: The measurement vector P is transformed by a classical function with parameters Ωg to produce the fake sample xFake.The classical post-processing component is optional and can be used to generate the final classical output.
1. Quantum encoding circuit
The paper distinguishes amplitude and variational encoding for mapping classical data into quantum states. Variational encoding uses circuit parameters with a shared layout, while amplitude encoding uses state preparation with logarithmic qubit and linear-depth scaling.
- Encoding strategies: Quantum encoding acts as a nonlinear feature map from classical data into a quantum Hilbert space.The paper distinguishes amplitude encoding from variational encoding.
- Amplitude encoding: Amplitude encoding maps x ∈ R^N directly to an n-qubit state, requiring padding and normalization when the vector length is not a power of 2.A preparation circuit Sx then prepares the encoded state on the quantum register.
- Variational encoding: Variational encoding inserts a classical feature map into the parameters of a fixed variational circuit that prepares the input state.The circuit form is E(fE(x))|0⟩⊗n = |φ(x)⟩.
- Encoding trade-offs: Amplitude encoding uses O(log(N)) qubits and O(N) state-preparation depth, but preparation may require thousands of gates for ten qubits.This gate count can challenge implementation on NISQ devices.
- Encoding trade-offs: Variational encoding uses the same circuit layout for every input and typically requires O(N) qubits with O(1) depth.This simplifies compilation and may make encoding more amenable to NISQ devices, at the cost of more qubits than amplitude encoding.
- Variational encoding: Product encoding maps each vector element to a one-qubit state, while other schemes add single-qubit layers or nonlinear activation functions.The tensorial map and nonlinear functions introduce nonlinearities in the encoding map.
2. Variational circuit
The VQG generator uses a variational circuit to transform encoded latent states into expressive quantum states. Such circuits are designed to explore correlations and Hilbert space, including through strongly entangling or Hamiltonian-evolution constructions.
- Variational generator: G(Θg) is the variational generator circuit that maps encoded input data into quantum states for measurement decoding.The circuit is part of the VQG architecture introduced for continuous-distribution generation.
- Circuit design: Variational circuits are commonly designed to prepare strongly entangled states and explore Hilbert space sufficiently to represent correlations in input data.These design goals motivate circuit expressivity for quantum machine-learning models.
- Circuit design: Hamiltonian-evolution circuits can use Hamiltonian coefficients as variational parameters and have been applied to quantum classification and nonlinear-function modeling.The paper cites transverse Ising evolution as one example of this construction.
3. Measurement decoding and post-processing
Measurement decoding generates classical samples from measured expectation values, with the decoding operators selected as a model hyper-parameter. Gradient-based training adds measurement costs for estimating parameter gradients.
- Measurement decoding: The generator produces samples by estimating a vector of expectation values for a selected set of measurement operators.The operators are chosen according to the problem and constitute a model hyper-parameter.
- Measurement decoding: Measurement averaging estimates each operator independently at fixed precision ϵ, with cost determined by the number of decoded observables.The passage states that this measurement cost is comparable to other hybrid quantum-classical algorithms using observable averages.
- Gradient-based training: Gradient-based optimization requires estimating ∇_ΘG P in addition to the measurements used to generate samples.The total measurement count depends on measurements per gradient estimation and the number of optimizer gradient evaluations.
B. Training and cost function
The VQG is trained adversarially by alternating discriminator and generator updates, using classical or quantum discriminators and gradients propagated through hybrid circuits. The generator cost can be chosen to reduce vanishing-gradient problems during training.
- Adversarial objective: The discriminator distinguishes real samples from generator samples using a cost function with separate real-data and synthetic-data terms.Training therefore uses two batches: real samples labeled as real and generated samples labeled as fake.
- Adversarial objective: The generator may minimize the discriminator’s probability of being correct through the alternative cost Cg(Θd, Θg) = −Ez∼pz(z)[log FD((FG(z; Θg, Ωg); Θd))].The paper describes this heuristic objective as facilitating training in classical GANs by preventing vanishing gradients.
- Discriminator schemes: Classical discriminators use standard backpropagation, whereas quantum discriminators encode classical inputs and classify them with a variational circuit and measurements.The two schemes differ in whether classification is performed by a classical neural network or a quantum discriminator.
- Hybrid gradients: Quantum-discriminator gradients require derivatives of both the discriminator’s variational circuit and the generator’s encoding or variational circuit.Classical-discriminator input derivatives can instead be computed using established classical techniques.
- Hybrid gradients: Automatic differentiation propagates the classical derivative ∂L/∂Q backward to the quantum module, which estimates ∂Q/∂θq for the chain rule.This supports gradient-based optimization of the hybrid architecture with optimizers such as Adam or SGD.
A. Numerical simulations
A controlled noiseless simulation trained a VQG against either classical or quantum discriminators using a matched VQG-generated target distribution. Both schemes converged toward the target distribution, though the quantum-discriminator scheme produced much larger gradients and could oscillate.
- Experimental setup: The controlled experiment uses a target distribution generated by a VQG with the same structure as the trainable generator, ensuring that a learning solution exists.The target parameters are fixed at Θg = [2.48, 2.52, 2.0], while the generator starts at Θg = [2.3, 2.3, 1.0].
- Experimental setup: The generator uses a two-layer product encoding circuit and a two-qubit variational circuit with three parameters, decoding through a single operator without classical post-processing.The generated distribution is univariate over x ∈ [−1, 1].
- Training results: Both classical- and quantum-discriminator schemes converge toward approximations of the target distribution, with losses approaching ln(0.5) ≈ 0.7.Convergence is assessed using KL divergence together with the generated distribution’s mean and standard deviation.
- Training results: The KL divergence initially remains mostly constant, then decreases as the discriminator’s learning signal increases during training.Figure 7 visualizes the corresponding progressive resemblance between generated and target histograms for scheme II.
- Optimization behavior: Quantum-discriminator gradient components are around an order of magnitude larger than those in scheme I, producing convergence issues and oscillatory dynamics in some experiments.Reducing Adam learning rates changed the dynamics to a damped oscillation.
- Optimization behavior: The larger gradients are linked to variational-circuit parameterization, where signals distribute across only a polynomial number of parameters compared with a neural-network representation.The paper connects this parameterization to efficient implementation of high-dimensional linear hidden layers.
B. Implementation on NISQ devices
The VQG is suitable for NISQ implementation, but sampling costs, noise, and potentially vanishing gradients constrain scaling and training. Proposed mitigations include error mitigation, block-by-block training, and classically simulable circuit components.
- The VQG can run on fault-tolerant or noisy intermediate-scale quantum devices because its variational structure suits NISQ implementation.Its algorithmic cost is associated with the number of samples needed to evaluate and train the model.
- O(M/ϵ2) repetitions are required to evaluate the model, where M is the number of measured operators and ϵ is the estimation accuracy.
- Gradient estimation faces noise in expectation values and barren plateaus, where near-random circuits can have gradients that vanish exponentially with qubit number.
- Error mitigation can estimate expectation values at different noise levels and extrapolate to zero noise, potentially improving gradient estimation and post-training sample quality.
- Block-by-block training may reduce barren-plateau risk by progressively adding circuit blocks and reusing previously optimized parameters.The proof-of-principle experiments did not observe vanishing gradients, likely because their circuits were small.
- Circuits containing classically simulable subcomponents, such as matchgates augmented with ZZ rotations, could support classical simulations of the VQG.
V. CONCLUSION AND OUTLOOK
The paper presents a hybrid variational quantum generator for continuous probability distributions, combining quantum circuits with classical post-processing and adversarial training. It establishes a flexible framework while identifying open questions about classical advantage, noise, and practical applications.
- V. CONCLUSION AND OUTLOOK: The variational quantum generator encodes a classical random variable into a quantum state, applies an optimized variational circuit, and measures predefined observables to produce samples.The resulting expectation-value vector can be transformed by a classical function such as a neural network.
- V. CONCLUSION AND OUTLOOK: The generator can be trained through gradient-based adversarial learning with either classical or quantum discriminators.Gradient estimation for variational circuits is integrated with automatic differentiation of classical functions.
- V. CONCLUSION AND OUTLOOK: A central open question is whether the approach provides an advantage over purely classical generative models.The paper also highlights unresolved questions about noise tolerance, noise benefits, and the dependence of training quality on the noise process and target distribution.
- V. CONCLUSION AND OUTLOOK: The architecture offers flexibility through multiple choices of variational circuits and encodings, with nonlinearities introduced through classical preprocessing, post-processing, and tensorial mappings.Quantum and classical components can be combined as nonlinear layers and repeated to build deeper hybrid architectures.
- V. CONCLUSION AND OUTLOOK: The framework is intended to combine increasingly large variational circuits with standard neural networks for generative learning on quantum devices.Future applications include image processing, finance, medicine, cybersecurity, and drug and materials design.
Appendix A: Variational circuits architectures
The appendix surveys variational circuit architectures and analytical gradient-estimation strategies used in hybrid quantum-classical algorithms. It contrasts circuit designs and explains trade-offs between ancilla-based and classical linear-combination methods.
- Variational circuit architectures: The HQC circuit block contains controlled one-qubit rotations interleaved with single-qubit rotations, with O(n^2) parameter scaling.Simplified blocks can omit parameterized entangling operations.
- Variational circuit architectures: A code block B(n, r) applies general single-qubit rotations to n qubits followed by n/gcd(n, r) controlled-R gates.Here, r specifies the range of the two-qubit gates.
- Analytical gradient estimation: Analytical gradients of variational expectation values can be estimated by modifying the original circuit and measuring an additional ancilla qubit.The Figure 9 strategy requires one extra qubit and estimates an element of the Jacobian of P.
- Variational circuit architectures: Figure 8 presents three variational circuit-block examples: HQC blocks, generalized code blocks, and Hamiltonian-evolution circuits with tunable parameters.The code-block example uses 3 qubits with range 2, denoted B(3, 2).
- Analytical gradient estimation: The CLCU strategy estimates the same gradient using two modified circuit evaluations, requiring twice as many measurements but no ancilla qubit.It uses the same circuit structure as the objective function, which may simplify compilation.
- Analytical gradient estimation: Automatic differentiation computes numerical derivatives through derivative propagation and was implemented using reverse mode accumulation.Unlike numerical differentiation, it provides derivatives to working computational precision.