Computing Library › Quantum Ml
Quantum Ml

Quantum Generative Adversarial Networks

A quantum GAN pits a quantum generator against a discriminator in a minimax game, training the generator to produce samples the discriminator cannot distinguish from real data.

The adversarial setup

A quantum generative adversarial network (QGAN) mirrors the classical GAN. A generator produces candidate samples, and a discriminator tries to tell generated samples from real ones. The two train against each other: the discriminator improves at spotting fakes while the generator improves at fooling it. At the ideal equilibrium the generator's distribution matches the data and the discriminator can do no better than chance.

Which parts are quantum

Kronos motion — training from sim

The minimax objective

Training optimizes a two-player value function: the discriminator maximizes its ability to separate real from generated, and the generator minimizes that ability. In the quantum case, generator gradients come from the parameter-shift rule while discriminator gradients use ordinary backpropagation if it is classical. Updates alternate between the two players.

python
# One QGAN training step (schematic)
real = sample_data(batch)
fake = quantum_generator(theta_g, batch)         # circuit samples
loss_d = discriminator_loss(D(real), D(fake))    # classical net D
update(theta_d, grad(loss_d))                     # backprop
loss_g = generator_loss(D(quantum_generator(theta_g, batch)))
update(theta_g, parameter_shift_grad(loss_g))    # quantum gradient

Instabilities

QGANs inherit the notorious instability of classical GANs, mode collapse and oscillation, and add quantum-specific troubles: shot noise in every generator evaluation, hardware noise that biases samples, and barren plateaus that stall the generator. Balancing the two players is delicate even in the noiseless setting.

Prospects

The most credible use is loading or learning distributions that are quantum in origin, or approximately preparing a target quantum state, since there the generator's output is naturally quantum and no expensive encoding is needed. For classical data, QGANs remain experimental and have not shown a general advantage over strong classical generative models.