Quantum Artificial Intelligence

Chapter 8
Quantum Unsupervised and Generative Learning

Post Graduate Program in AI and ML
Quantum Artificial Intelligence   •   Post Graduate

8. Quantum Unsupervised and Generative Learning

Introduction and Context

Unsupervised learning addresses a central problem in artificial intelligence: how can a system discover structure when labels are unavailable, incomplete, or too expensive to obtain? Clustering, dimensionality reduction, anomaly detection, density estimation, and generative modelling are therefore important in scientific discovery, finance, cybersecurity, healthcare, manufacturing, and language and image processing.

Quantum machine learning introduces quantum states, interference, entanglement, and quantum measurement into these workflows. The objective is not simply to replace every classical algorithm with a quantum circuit. Rather, quantum methods offer alternative representations and computational mechanisms for exploring complex probability distributions, estimating similarities, preparing samples, or optimizing latent structures. In the near term, most practical systems are hybrid: classical data preprocessing and optimization are combined with parameterized quantum circuits or quantum sampling devices.

This chapter examines quantum approaches to clustering, dimensionality reduction, anomaly detection, autoencoders, Boltzmann machines, generative adversarial networks, and Born machines. Particular attention is given to the issues that determine whether a quantum model is useful in practice: data encoding, trainability, sample quality, likelihood evaluation, hardware noise, resource requirements, and comparison with strong classical baselines.

Learning Objectives

After studying this chapter, the reader should be able to:

1. Explain how quantum representations can support unsupervised learning and generative modelling.

2. Distinguish quantum clustering, quantum dimensionality reduction, anomaly detection, and quantum generative models.

3. Describe the structure and training objectives of quantum autoencoders, Boltzmann machines, GANs, and Born machines.

4. Evaluate generated samples using likelihood-related and distributional metrics.

5. Identify the practical limitations of current quantum hardware and hybrid optimization.

6. Select an appropriate quantum unsupervised-learning approach for a realistic application.

The Quantum Perspective on Unsupervised Learning

A classical unsupervised model usually receives a data matrix and attempts to infer a latent structure. A quantum model may instead encode a vector x into a quantum state |ψ(x)⟩, represent a probability distribution through measurement outcomes, or use a quantum circuit to estimate a kernel or similarity. These choices are not interchangeable.

Data encoding is often the first bottleneck. Amplitude encoding can represent many values using relatively few qubits, but state preparation may be computationally expensive. Angle encoding maps features to rotation angles and is easier to implement on near-term devices, although it generally requires one or more gates per feature. Basis encoding is natural for binary data but may require many qubits. Consequently, a claimed quantum advantage must account for the full pipeline, including feature reduction, state preparation, circuit execution, measurement, and classical post-processing.

Parameterized quantum circuits (PQCs) provide a common architecture. A circuit U(θ) acts on an initial state and produces |ψ(θ)⟩. Measurements generate samples or expectation values, while a classical optimizer updates θ. The objective may be reconstruction error, a clustering cost, an adversarial loss, a divergence between distributions, or a variational energy. This arrangement is known as a hybrid quantum-classical algorithm.

Important terminology includes the following ideas. A quantum kernel is a similarity function obtained from overlaps or measurements between encoded states. A latent space is a lower-dimensional representation in which meaningful structure is expected to become easier to model. A quantum sampler produces measurement outcomes from a circuit-defined distribution. A variational circuit is trainable because selected gates contain adjustable parameters. Barren plateaus are regions in which gradients become exponentially small or statistically uninformative. Expressibility describes the range of states a circuit can represent, whereas trainability concerns whether useful parameters can be found efficiently.

Quantum Clustering and Similarity Learning

Clustering divides observations into groups without predefined labels. Classical k-means minimizes within-cluster squared distance, while density-based approaches identify regions of high concentration. Quantum methods generally enter through one of three routes: quantum distance estimation, quantum kernels, or quantum optimization of a clustering objective.

In a quantum-kernel approach, each observation is mapped to a state |φ(x)⟩. The similarity between xᵢ and xⱼ may be estimated from an inner product such as |⟨φ(xᵢ)|φ(xⱼ)⟩|². A kernel matrix can then be supplied to a classical clustering method. Alternatively, a variational circuit can learn a feature map that places observations from the same group close together according to a quantum-defined metric.

Quantum approximate optimization methods can also encode assignment decisions into binary variables. A quadratic unconstrained binary optimization formulation may represent whether an observation belongs to a cluster, with penalty terms enforcing constraints. The quantum device then searches for low-cost bit strings. Such formulations are conceptually attractive but can become large and difficult to embed on hardware.

The principal analytical question is not whether a quantum circuit produces a different similarity matrix, but whether that matrix captures structure that classical kernels fail to capture at comparable cost. A useful evaluation compares cluster quality using adjusted Rand index, normalized mutual information, silhouette coefficient, or domain-specific utility, while also reporting runtime, number of circuit evaluations, and sensitivity to noise.

Dimensionality Reduction and Quantum Feature Maps

Dimensionality reduction seeks a compact representation that preserves information relevant to analysis. Principal component analysis preserves directions of large variance; manifold methods preserve local or probabilistic relationships; autoencoders learn nonlinear transformations through reconstruction.

Quantum dimensionality reduction can be understood as a learned map from classical observations to quantum states or a lower-dimensional set of parameters. Quantum principal component analysis has been proposed using quantum density operators and phase-estimation-style procedures, but its practical benefit depends heavily on the availability of quantum data access and efficient state preparation. For ordinary classical datasets, loading the data may dominate the theoretical speedup.

A more accessible approach uses a quantum feature map followed by measurements. The measured expectation values form a new feature vector. These features can be compressed, selected, or used for visualization and downstream clustering. Another approach trains a quantum autoencoder to retain information in a smaller subsystem. In both cases, dimensionality reduction should be judged by reconstruction quality, downstream predictive performance, robustness, and computational cost rather than by visual separation alone.

Quantum Anomaly Detection

Anomaly detection identifies observations that differ substantially from normal behaviour. The distinction is important in fraud detection, industrial monitoring, medical imaging, and network security, where anomalies may be rare and labels may be unreliable.

A quantum anomaly detector may learn a normal-data distribution and assign low probability to unusual observations. It may also calculate a quantum-kernel distance from a reference set, use a variational classifier trained only on normal examples, or reconstruct inputs with a quantum autoencoder. An anomaly score can be defined as reconstruction error, negative log-likelihood, distance from a learned centre, or disagreement among multiple models.

Threshold selection is a major practical issue. A threshold chosen on balanced laboratory data may be inappropriate when the operational anomaly rate is one in a thousand. Precision-recall curves, false-alarm cost, detection delay, and stability under distribution shift are more informative than accuracy alone. Quantum noise can create false anomalies, especially when small measurement fluctuations are interpreted as evidence of rarity.

Quantum Autoencoders

An autoencoder consists of an encoder and decoder. The encoder maps an input to a latent representation, and the decoder reconstructs the original input. A quantum autoencoder uses a parameterized unitary or isometry to compress information into a designated latent subsystem while attempting to disentangle or discard redundant degrees of freedom.

Suppose an input state occupies n qubits and the intended latent space occupies k qubits, where k<n. The circuit U(θ) transforms the input so that the first k qubits preserve relevant information and the remaining qubits approach a fixed reference state. A reconstruction objective can compare the decoded output with the input, while a compression objective can penalize entropy or excitation in the discarded subsystem. Training is usually hybrid: quantum measurements estimate the loss and a classical optimizer updates θ.

Quantum autoencoders are especially natural for quantum data, such as families of physical states, because the input is already a quantum state. For classical data, however, state preparation can remove much of the anticipated advantage. Important design choices include the bottleneck size, circuit depth, locality of gates, loss estimation method, and whether the model must reconstruct exactly or only preserve task-relevant information.

Boltzmann Machines and Quantum-Assisted Energy Models

A Boltzmann machine defines a probability distribution over binary configurations using an energy function. In a classical restricted Boltzmann machine (RBM), visible variables v interact with hidden variables h, but visible-visible and hidden-hidden connections are usually removed. The probability of a configuration is proportional to exp(-E(v,h)), and learning attempts to make observed data low-energy while controlling the overall distribution.

Quantum Boltzmann machines replace or augment the classical energy model with a quantum Hamiltonian. A Hamiltonian H defines a Gibbs state ρ = exp(-βH)/Z, where β is an inverse-temperature parameter and Z is the partition function. Quantum interactions, including non-commuting terms, can represent distributions that are difficult to express with a purely classical energy landscape. Training may use quantum annealing, variational thermal-state preparation, or a quantum device as a sampler.

The partition function is central. It normalizes the model but is often difficult to compute, making exact likelihood evaluation impractical. Contrastive divergence, persistent sampling, score matching, and variational approximations may be used instead. A quantum sampler is useful only if its output distribution is sufficiently close to the intended model and if sampling cost is competitive with classical Markov-chain methods.

GANs with Quantum Components

A generative adversarial network contains a generator and discriminator. The generator produces samples from latent noise, and the discriminator distinguishes generated samples from training data. The two networks are trained in opposition. In a quantum GAN, the generator may be a parameterized quantum circuit, the discriminator may be classical, or both components may contain quantum circuits.

A quantum generator naturally defines a distribution over measurement bit strings. Continuous outputs require additional interpretation, such as mapping bit strings to numerical intervals or using a classical post-processing layer. A hybrid discriminator can receive measured quantum features and apply a classical neural network. Training may use adversarial loss, Wasserstein objectives, maximum mean discrepancy, or other distributional distances.

GAN training is unstable even classically. Quantum versions add shot noise, hardware noise, restricted circuit expressibility, and gradient-estimation cost. Mode collapse occurs when the generator produces only a narrow subset of the target distribution. A generator that obtains a low adversarial loss may still have poor coverage. Therefore, sample diversity and distributional fidelity must be assessed separately.

Born Machines and Quantum Generative Modelling

A Born machine defines probabilities through the Born rule. If a circuit prepares |ψ(θ)⟩ = Σₓ ψθ(x)|x⟩, measuring in the computational basis gives pθ(x)=|ψθ(x)|². The circuit itself therefore acts as a generative model. Sampling is straightforward in principle: execute the circuit repeatedly and record measurement outcomes.

Born machines are attractive because probability normalization is automatic. Unlike an energy-based model, the model does not require an explicitly computed partition function. However, this does not make all evaluation easy. For a dataset containing configurations x, exact log-likelihood requires calculating pθ(x), which may require many circuit measurements or classical simulation. If the circuit is large, estimating probabilities of individual strings can be expensive. Moreover, the likelihood of observed strings does not fully reveal whether the model captures global structure.

Training objectives include maximum likelihood, fidelity-based losses, kernel distances, and maximum mean discrepancy. Maximum likelihood rewards probability assigned to observed examples, while distributional objectives compare generated and real samples using a feature representation. A model can have good likelihood but poor sample quality if it spreads probability broadly, or good sample quality on common patterns while assigning negligible probability to rare but important examples.

Sampling Quality and Likelihood Evaluation

Generative learning requires more than producing visually plausible samples. Evaluation should address fidelity, diversity, coverage, calibration, and computational efficiency. Fidelity asks whether samples resemble the target distribution. Diversity asks whether the model represents multiple modes. Coverage asks whether important regions are omitted. Calibration concerns whether stated probabilities correspond to observed frequencies.

For discrete models, empirical frequency tables, total variation distance, Jensen–Shannon divergence, Hellinger distance, and cross-entropy may be used when the state space is small. For larger spaces, one may use maximum mean discrepancy, classifier-based two-sample tests, Wasserstein-style distances, or domain-specific feature statistics. In quantum experiments, the number of shots affects the reliability of every estimated probability.

Likelihood evaluation differs by model. Autoregressive models can often calculate likelihood exactly through the chain rule. Born machines may require probability estimation from circuit outcomes. GANs generally do not provide an explicit likelihood, so evaluation relies on indirect metrics. Boltzmann machines require a partition function, which is often intractable. These distinctions must be reported clearly; comparing likelihood scores across models that define different objectives can be misleading.

A rigorous experimental protocol includes a held-out test set, repeated runs with different random seeds, uncertainty estimates, noise-model information, and classical baselines. It should also compare equalized resources: number of trainable parameters, training samples, circuit executions, wall-clock time, and energy consumption where relevant.

An Illustrative Case: Quantum Anomaly Screening in Manufacturing

Background

Consider an illustrative semiconductor-manufacturing plant that records sensor vectors from wafers judged to be normal. Failures are rare, and labels arrive weeks after production. The plant wishes to detect unusual combinations of temperature, vibration, pressure, and electrical measurements.

Situation and Analysis

A direct quantum model using all sensor dimensions would require costly encoding and might be highly sensitive to noise. Engineers therefore standardize the data, remove unstable sensors, and use classical principal component analysis to reduce the vector to six dimensions. The reduced vector is angle-encoded into a quantum circuit. A quantum autoencoder is trained only on normal wafers, with reconstruction error used as an anomaly score.

The team compares this model with a classical autoencoder, one-class support vector machine, and isolation forest. They evaluate precision at a fixed false-alarm rate, detection delay, robustness across production shifts, and total inference cost. Because measurements are probabilistic, the quantum circuit is executed repeatedly for each wafer. Calibration data are used to distinguish hardware noise from genuine reconstruction error.

Approach and Outcome

The quantum autoencoder identifies a nonlinear interaction between two sensor groups that was not represented well by the initial linear baseline. However, the improvement is modest and disappears when the circuit depth is increased beyond the noise-tolerant range. The final deployment uses a hybrid architecture: classical preprocessing and threshold management, with the quantum circuit retained as an experimental feature extractor. A classical fallback is triggered when measurement uncertainty exceeds a specified level.

Learning Points

The case illustrates that quantum learning may contribute a useful representation without replacing the complete analytics pipeline. It also demonstrates why operational metrics, noise monitoring, and classical comparisons are essential. A statistically significant improvement on a small benchmark would not by itself justify industrial deployment.

Practical Limitations, Risks, and Common Errors

The most persistent limitation is data loading. A theoretical algorithm may assume efficient access to a quantum state, whereas a real application begins with classical files, databases, or sensor streams. Encoding can dominate runtime and may require as many resources as the learning task itself.

Noise and finite sampling create uncertain gradients and unreliable probability estimates. Deep circuits may suffer from decoherence, while broad random ansätze may exhibit barren plateaus. Optimization is non-convex, and different runs can converge to different solutions. Hardware connectivity can require additional routing gates, increasing circuit depth.

Common errors include claiming quantum advantage from a comparison with a weak classical baseline; reporting only training performance; ignoring preprocessing costs; treating a high-fidelity sample as evidence of diversity; and interpreting a simulator result as evidence of hardware feasibility. Another mistake is using a quantum model merely because a dataset is high-dimensional. Feature dimension, data structure, noise level, and the required output—not the label “big data”—should determine algorithm selection.

Ethical, Governance, and Professional Considerations

Unsupervised models can reproduce hidden biases in training data and may flag minority or unusual populations as anomalous. In regulated settings, anomaly scores should support investigation rather than automatically trigger harmful decisions without human review. Data provenance, access control, auditability, and retention policies remain important even when the computational model is quantum.

Quantum randomness does not guarantee fairness, privacy, or accountability. Organizations should document encoding choices, circuit versions, calibration procedures, evaluation datasets, and fallback policies. Where generative models produce synthetic records, users must be informed about disclosure risks, memorization, and whether synthetic data preserve or distort protected-group characteristics.

Emerging Directions and Best Practices

Current research increasingly focuses on error mitigation, problem-specific ansätze, quantum kernels, quantum-assisted sampling, and models designed for limited-depth hardware. Quantum-classical co-design is becoming more important than isolated circuit innovation. Research also explores trainable data re-uploading, tensor-network comparisons, diffusion-inspired quantum generation, and methods for learning from quantum experimental data.

Best practice is to begin with a clearly defined unsupervised task and a measurable business or scientific objective. Establish a strong classical baseline, reduce and validate the data representation, select the smallest circuit that can express the required structure, and estimate uncertainty through repeated shots and repeated training runs. Report the complete resource budget and distinguish simulation, emulation, and hardware results. Finally, deploy incrementally, with monitoring and a classical fallback.

Chapter Summary

Quantum unsupervised learning uses quantum states, kernels, variational circuits, and quantum sampling to discover structure without labels. Quantum clustering commonly relies on quantum similarities or optimization formulations; dimensionality reduction may use quantum feature maps or autoencoders; anomaly detection can be based on reconstruction, distance, or learned probability. Quantum Boltzmann machines model energy-based distributions, while quantum GANs combine adversarial learning with quantum generators or discriminators. Born machines define distributions directly through measurement probabilities.

The practical evaluation of these models requires attention to sample fidelity, diversity, coverage, likelihood or likelihood substitutes, shot noise, and resource cost. Quantum models do not automatically provide computational advantage, and data encoding, trainability, hardware noise, and classical baselines are decisive. Hybrid architectures, rigorous benchmarking, governance, and staged deployment are therefore central to professional practice.

Key Terms

Quantum kernel: A similarity function estimated from overlaps or measurements of quantum-encoded data.

Quantum feature map: A circuit that transforms classical features into a quantum state.

Parameterized quantum circuit: A quantum circuit containing adjustable gate parameters.

Hybrid quantum-classical algorithm: A method in which quantum computation and classical optimization operate together.

Quantum autoencoder: A trainable circuit that compresses quantum or encoded classical information into a smaller latent subsystem.

Born machine: A generative model whose probabilities are given by squared quantum amplitudes.

Boltzmann machine: An energy-based probabilistic model that assigns probabilities through an energy function.

Quantum GAN: A generative adversarial network containing a quantum generator, discriminator, or both.

Barren plateau: A parameter region where gradients become extremely small and training becomes difficult.

Shot noise: Statistical variation caused by estimating quantum probabilities from a finite number of measurements.

Expressibility: The range of quantum states that an ansatz can represent.

Trainability: The practical ability to optimize a parameterized circuit.

Latent space: A compact representation intended to capture meaningful underlying factors.

Anomaly score: A numerical measure indicating how unusual an observation is.

Partition function: The normalization factor in an energy-based probability model.

Maximum mean discrepancy: A kernel-based measure of difference between two probability distributions.

Mode collapse: A generative-model failure in which only a limited subset of target modes is produced.

Data encoding: The procedure for mapping classical information into quantum states.

Quantum advantage: A demonstrable benefit over relevant classical methods under comparable resource conditions.

Review Questions

Short Answer Questions

1. What is the role of a quantum feature map in unsupervised learning?

2. Why is data encoding a major concern in quantum machine learning?

3. Define a Born machine.

4. What does an anomaly score represent?

5. Why can likelihood evaluation be difficult for quantum generative models?

Long Answer Questions

1. Explain the principal approaches to quantum clustering and discuss how their performance should be evaluated.

2. Describe the architecture and training objective of a quantum autoencoder.

3. Compare quantum Boltzmann machines, quantum GANs, and Born machines as generative models.

4. Discuss the importance of fidelity, diversity, coverage, and likelihood in evaluating generated samples.

5. Analyse the technical and organizational limitations that affect deployment of quantum unsupervised-learning systems.

Analytical / Application Questions

1. A cybersecurity team has mostly normal network records and very few confirmed attacks. Design a quantum-assisted anomaly-detection workflow and specify suitable evaluation metrics.

2. A Born machine produces realistic samples but omits a rare class of valid configurations. Explain how this failure could be detected and reduced.

3. An industrial quantum autoencoder performs better in simulation than on hardware. Diagnose likely causes and propose an evidence-based deployment decision.

22. Multiple Choice Questions with Answers

Question 1

Which statement best describes a Born machine?

A. A classifier that uses labelled quantum states

B. A generative model whose measurement probabilities are squared quantum amplitudes

C. A clustering algorithm based only on Euclidean distance

D. A classical optimizer for quantum hardware calibration

Correct Answer: B. A generative model whose measurement probabilities are squared quantum amplitudes

Question 2

Why can amplitude encoding be problematic in practical quantum machine learning?

A. It cannot represent numerical data

B. It always destroys phase information

C. Preparing the encoded state may be computationally expensive

D. It requires a classical label for every feature

Correct Answer: C. Preparing the encoded state may be computationally expensive

Question 3

A quantum autoencoder generally attempts to do what?

A. Maximize the number of discarded qubits

B. Compress information into a latent subsystem while enabling reconstruction

C. Convert every unsupervised task into classification

D. Eliminate the need for measurements

Correct Answer: B. Compress information into a latent subsystem while enabling reconstruction

Question 4

Which metric is especially appropriate when anomalies are rare and false alarms are costly?

A. Accuracy alone

B. Precision-recall analysis

C. Training loss alone

D. Number of circuit parameters

Correct Answer: B. Precision-recall analysis

Question 5

What is mode collapse in a generative model?

A. The circuit loses all qubits during execution

B. The model produces only a narrow subset of the target distribution

C. The likelihood becomes exactly normalized

D. The discriminator becomes a clustering algorithm

Correct Answer: B. The model produces only a narrow subset of the target distribution

Question 6

Why is likelihood evaluation difficult for many Boltzmann machines?

A. They cannot assign probabilities to configurations

B. Their partition function is often intractable to compute

C. They do not use an energy function

D. They require labelled test data

Correct Answer: B. Their partition function is often intractable to compute

Question 7

Which practice provides the strongest evidence for a claimed quantum benefit?

A. Comparing with a weak classical baseline

B. Reporting only simulator accuracy

C. Comparing against strong classical methods with comparable resource accounting

D. Increasing circuit depth without measuring noise

Correct Answer: C. Comparing against strong classical methods with comparable resource accounting

Question 8

In a quantum GAN, what is a possible role of the quantum circuit?

A. It can serve as the generator producing measurement samples

B. It must always replace the training dataset

C. It guarantees stable adversarial optimization

D. It removes the need for a discriminator

Correct Answer: A. It can serve as the generator producing measurement samples

Question 9

What does shot noise refer to?

A. Noise caused by classical data labelling

B. Variation caused by estimating probabilities from finitely many measurements

C. A fixed error in the partition function

D. A method for increasing circuit expressibility

Correct Answer: B. Variation caused by estimating probabilities from finitely many measurements

Question 10

Why might a hybrid architecture be preferred in an industrial anomaly-detection system?

A. Classical preprocessing and monitoring can manage encoding, thresholds, and fallback decisions

B. Hybrid systems never experience quantum noise

C. They eliminate the need for validation data

D. They guarantee quantum advantage

Correct Answer: A. Classical preprocessing and monitoring can manage encoding, thresholds, and fallback decisions

Quantum Artificial Intelligence
Chapter 8 of 15