7. Quantum Supervised LearningIntroduction and ContextSupervised learning constructs a predictive relationship between inputs and labelled outputs. Given training pairs \(\{(x_i,y_i)\}_{i=1}^{N}\), a model learns parameters that minimize a loss function and then applies the learned relationship to unseen data. Quantum supervised learning (QSL) investigates whether quantum states, parameterized quantum circuits, and quantum measurement can improve or otherwise alter this process. The central idea is not that every learning problem becomes faster merely by replacing a classical model with a quantum circuit. Rather, QSL provides a family of hybrid models in which classical data are encoded into quantum states, trainable quantum transformations generate representations, and measurements produce predictions. Classical optimization, preprocessing, validation, and often parts of inference remain essential. The practical question is therefore comparative: for a particular dataset, hardware constraint, and objective, does a quantum-enhanced model offer better predictive performance, efficiency, robustness, or scientific insight than a well-designed classical baseline? This chapter develops the design and evaluation of quantum classifiers, regressors, support-vector methods, neural networks, and convolutional circuits. It also addresses losses, validation, metrics, trainability, noise, reproducibility, and responsible claims of advantage. Learning ObjectivesBy the end of this chapter, students should be able to: 1. Explain the architecture of a hybrid quantum supervised-learning pipeline. 2. Distinguish data encoding, variational models, quantum kernels, and measurement strategies. 3. Formulate losses for classification and regression and select suitable evaluation metrics. 4. Design quantum classifiers, regressors, support-vector methods, neural networks, and convolutional circuits. 5. Compare quantum models fairly with classical baselines using appropriate validation procedures. 6. Diagnose noise, barren plateaus, overfitting, data leakage, and other common failure modes. 7. Evaluate professional, ethical, and managerial implications of deploying quantum learning systems. From Labelled Data to Quantum PredictionsA supervised quantum pipeline usually contains five stages. First, data are cleaned, scaled, and divided into training, validation, and test sets. Second, a classical feature vector is encoded into a quantum state. Third, a parameterized quantum circuit transforms that state. Fourth, one or more observables are measured. Finally, a classical optimizer updates circuit parameters according to a loss. For a circuit \(U(x,\theta)\), where \(x\) is an input and \(\theta\) contains trainable parameters, a prediction may be written as \[ f_\theta(x)=\langle 0|U^\dagger(x,\theta) M U(x,\theta)|0\rangle, \] where \(M\) is an observable such as a Pauli operator. The expectation value lies in a bounded interval, commonly \([-1,1]\), and is converted to a probability or real-valued prediction. A binary classifier can use \(p(y=1|x)=(1+f_\theta(x))/2\), while a regressor may rescale the expectation to the target range. The encoding circuit \(U(x)\) is not a minor implementation detail. Angle encoding maps features to rotation angles and is usually hardware-friendly, but it may require one or more qubits per feature. Amplitude encoding can represent many numbers with fewer qubits in principle, but state preparation may be expensive and sensitive to normalization. Basis encoding is suitable for discrete or binary data. Data re-uploading repeatedly inserts classical features into successive layers, allowing a small circuit to represent richer functions. The choice should be justified by feature dimension, circuit depth, hardware connectivity, noise, and the information one expects the encoding to preserve. A useful design separates the feature map from the ansatz. The feature map determines how input geometry appears in Hilbert space; the ansatz supplies trainable transformations. Entangling gates may capture feature interactions, but excessive entanglement can increase depth and impair optimization. Measurement selection also defines the model's output space. Measuring a single qubit is inexpensive but may discard useful information; measuring several observables produces a vector representation at greater sampling cost. Quantum Models for Supervised PredictionVariational quantum classifiers and regressorsA variational quantum classifier (VQC) combines an encoding circuit with a trainable ansatz. For binary classification, the circuit output may be thresholded at zero or converted to a probability. Multi-class classification can use several observables, one circuit per class, or a quantum representation followed by a classical softmax layer. One-versus-rest schemes are often simpler than attempting to encode many classes directly into a small noisy circuit. For regression, the measured expectation is treated as a continuous prediction. If targets have been standardized, the output can be inverse-transformed after inference. A regression circuit should not be judged by classification accuracy; mean squared error (MSE), mean absolute error (MAE), root mean squared error (RMSE), and \(R^2\) are more informative. When uncertainty matters, repeated shots or an ensemble of circuits can provide an empirical dispersion estimate, although this is not automatically a calibrated confidence interval. The training objective for binary cross-entropy is \[ \mathcal{L}_{BCE}=-\frac{1}{N}\sum_i[y_i\log p_i+(1-y_i)\log(1-p_i)]. \] Squared error is \(\mathcal{L}_{MSE}=N^{-1}\sum_i(\hat y_i-y_i)^2\). Hinge loss, \(\max(0,1-y_i f(x_i))\), is useful when labels are represented as \(-1\) and \(+1\). The loss must correspond to the output convention; applying binary cross-entropy to an unrestricted expectation value is mathematically inconsistent unless the output is first mapped to a valid probability. Gradients may be obtained analytically with the parameter-shift rule for suitable gates, by finite differences, or through simulation-based automatic differentiation. Parameter-shift gradients can require multiple circuit evaluations per parameter, and hardware shots introduce statistical noise. Optimizers such as SPSA, Adam, COBYLA, and L-BFGS have different sensitivities to noisy gradients and parameter scaling. There is no universally best optimizer; controlled experiments are required. Quantum kernel methods and support-vector classificationA quantum kernel maps inputs into a quantum feature space and measures similarity. A common fidelity-style kernel is \[ K(x,z)=|\langle \phi(x)|\phi(z)\rangle|^2, \] where \(|\phi(x)\rangle\) is produced by a feature map. The resulting kernel matrix can be supplied to a classical support-vector machine (SVM). In this arrangement, quantum computation estimates similarities, while the classical SVM solves the convex optimization problem. The quantum support-vector classifier (QSVC) is attractive because its training objective is often better understood than that of a deep variational circuit. However, a kernel can be computationally expensive: an \(N\times N\) matrix requires many pairwise evaluations, and shot noise may make the matrix indefinite or poorly conditioned. Regularization, symmetrization, eigenvalue correction, and repeated measurement may be necessary. A quantum kernel is not automatically useful merely because it is high-dimensional. If its entries are nearly identical for all pairs, it has little discriminative value; if it is too sharply concentrated, generalization may also suffer. The correct comparison is not only with a classical linear SVM. One should evaluate classical kernels such as linear, polynomial, and radial-basis-function kernels, tune their hyperparameters fairly, and include the computational cost of constructing the quantum kernel. Quantum neural networksThe term quantum neural network (QNN) generally refers to a parameterized circuit trained in a neural-network-like manner. A QNN may be entirely quantum in its representation but is normally hybrid in optimization. A classical layer can reduce dimensions before encoding, and a classical output layer can combine several measured observables. Such architectures are useful when the number of available qubits is smaller than the number of features. A QNN's expressive capacity depends on encoding, depth, entanglement pattern, activation-like measurement structure, and parameter sharing. More parameters do not necessarily improve learning. Deep random circuits may generate barren plateaus, regions in which gradients become exponentially small with system size or circuit depth under certain conditions. Practical responses include shallow problem-informed ansätze, layerwise training, local cost functions, careful initialization, data re-uploading, and monitoring gradient variance. Quantum convolutional neural networksA quantum convolutional neural network (QCNN) borrows the locality and weight-sharing ideas of classical convolutional networks. Small unitary filters act on neighbouring qubits, followed by pooling-like operations that reduce the number of active qubits. The circuit is therefore hierarchical: local patterns are extracted first, and later layers combine increasingly global information. QCNNs are most natural when the data have spatial, temporal, or graph locality. For an image, however, directly encoding every pixel into a qubit is usually unrealistic on near-term devices. Practical designs use patch encoding, dimensionality reduction, classical convolution followed by quantum processing, or very small image benchmarks. Claims that a QCNN captures image structure must therefore be distinguished from claims of practical superiority over classical convolutional networks. Training, Validation, and EvaluationA reliable experiment begins with a data protocol rather than with a circuit. Remove duplicates, define the unit of analysis, handle missing values using training data only, and fit scaling transformations exclusively on the training partition. Feature selection must also occur within the training process. Otherwise, information from validation or test examples leaks into the model and inflates performance. For modest datasets, stratified cross-validation is suitable for classification, while repeated or nested cross-validation is preferable when hyperparameter selection is substantial. Regression uses shuffled or grouped folds according to the data-generating process. Time-dependent data require chronological splits rather than random shuffling. A final test set should be held back until all design decisions are complete. Accuracy can be misleading under class imbalance. Precision, recall, F1 score, balanced accuracy, receiver-operating-characteristic AUC, and precision-recall AUC should be selected according to the operational cost of errors. A fraud detector may prioritize recall, whereas an expensive medical intervention may emphasize precision and calibration. Report confusion matrices and confidence intervals or variation across folds rather than a single optimistic score. For regression, MAE is interpretable and less sensitive to outliers than MSE; RMSE penalizes large errors more heavily; \(R^2\) describes explained variance but can be misleading outside the target distribution. Always report a naive or mean-prediction baseline where appropriate. Quantum experiments require additional controls. Use the same preprocessing, splits, metric definitions, and tuning budget for quantum and classical models. Distinguish simulator results from hardware results, record the number of shots, transpilation settings, device, calibration date, random seeds, and error-mitigation procedure. Evaluate noiseless and noisy simulations separately. If a quantum model wins by a small margin within experimental uncertainty, the appropriate conclusion is inconclusive rather than superior. An Applied Design WorkflowA defensible workflow can be organized as follows: 1. Define the decision problem, target, error costs, latency requirement, and available data. 2. Establish classical baselines, including a simple model and a tuned strong model. 3. Perform leakage-safe preprocessing and reduce features to a dimension compatible with the circuit. 4. Choose encoding, ansatz, observables, and output mapping based on hardware and problem structure. 5. Train using a validation protocol and monitor both loss and gradient behaviour. 6. Test noise sensitivity through shot variation, circuit perturbation, and hardware execution where possible. 7. Compare predictive quality, uncertainty, runtime, resource use, interpretability, and reproducibility. 8. Document limitations and decide whether the quantum component is justified in production. This process prevents the common error of choosing a quantum architecture first and then searching for a dataset on which it appears favourable. Illustrative Case Study: Quantum Classification for Equipment Fault DetectionBackgroundConsider a fictional manufacturing company, NovaForge, that monitors four sensor-derived features: vibration variance, motor temperature, acoustic energy, and power fluctuation. Each operating window is labelled normal or faulty. The company has a small labelled dataset and wishes to investigate whether a quantum classifier could support early fault detection. Situation and analysisFaults represent only 12 percent of windows, so accuracy alone would reward a model that predicts normal operation almost everywhere. The engineering team defines recall for the fault class as the primary metric and precision-recall AUC as a secondary metric. Sensor features are standardized using training data, and repeated measurements from the same machine are grouped in the splits to prevent machine-specific leakage. A logistic regression, RBF-SVM, random forest, and a two-qubit or four-qubit VQC are selected. The VQC uses angle encoding after principal-component analysis, a shallow entangling ansatz, and a single measured observable mapped to a probability. Because the dataset is small, the team uses repeated stratified group cross-validation and reserves a final machine group for testing. Approach and solutionThe classical models are tuned inside the training folds. The VQC is trained with binary cross-entropy and parameter-shift gradients in simulation, followed by execution with finite shots. The team tests two feature maps, two ansatz depths, and two shot counts, but limits the search budget equally across model families. Calibration is assessed using reliability diagrams and Brier score. The quantum kernel model is also evaluated, with regularization applied only within each training fold. OutcomeSuppose the VQC produces recall comparable to the RBF-SVM but with wider variation across folds and a substantially greater inference cost on available hardware. The quantum kernel shows slightly higher validation precision-recall AUC but loses that advantage on the held-out machine group. The responsible deployment decision is therefore to retain the classical model for production while documenting the quantum experiment as a research result. A future trial may be justified if improved hardware reduces measurement overhead or if a domain-specific feature map produces stable gains. Learning pointsThe case illustrates that a quantum model can be technically successful without being operationally preferable. Group-aware validation, imbalance-sensitive metrics, classical baselines, calibration, and hardware cost are part of the learning problem itself. The relevant outcome is not a headline accuracy figure but evidence that the complete system improves a defined decision. Challenges, Risks, and Common MistakesQuantum supervised learning faces limited qubit counts, circuit noise, measurement overhead, connectivity constraints, compilation overhead, and costly data loading. Training may be unstable because of barren plateaus, local minima, noisy gradients, parameter non-identifiability, or an ill-conditioned kernel matrix. Small datasets make statistical conclusions fragile, while extensive architecture search can overfit the validation set. Frequent mistakes include comparing a tuned quantum model with an untuned classical baseline, using accuracy for imbalanced data, scaling data before splitting, reporting simulator results as hardware evidence, ignoring shot cost, and treating a high-dimensional feature space as proof of useful representation. Another mistake is to interpret a measured expectation as a calibrated probability without calibration analysis. Interpretability also requires care. Circuit parameters do not necessarily correspond to human-understandable features. Feature attribution methods may be unstable and should be validated with perturbation tests and domain expertise. Quantum randomness does not remove accountability for automated decisions. Governance, Ethics, and Professional PracticeA quantum classifier used in finance, healthcare, employment, or industrial safety remains subject to ordinary requirements for privacy, security, fairness, documentation, and auditability. Encoding data into a circuit does not anonymize them. Sensitive attributes and proxies must be governed, access controlled, and retained only as necessary. Teams should document data provenance, intended use, excluded uses, model version, circuit and hardware configuration, validation design, known failure modes, and human oversight. If a quantum model is less interpretable or less reproducible than a classical alternative, that disadvantage must be weighed against any claimed performance benefit. Model cards, experiment logs, reproducible seeds, and independent review support responsible deployment. Current DirectionsResearch is moving toward error-aware training, noise-resilient ansätze, error mitigation, quantum kernels adapted to hardware, and problem-informed circuit design. Hybrid architectures increasingly use classical representation learning to compress data before a quantum layer. Resource-aware evaluation is also becoming more important: qubit count, depth, shots, wall-clock time, energy, and compilation overhead should accompany predictive metrics. Longer-term fault-tolerant quantum computers may enable algorithms and data-loading strategies unavailable on near-term devices. Nevertheless, the burden of evidence will remain comparative. A future quantum advantage must be defined for a specific task and resource model, not inferred from the existence of entanglement or a large abstract Hilbert space. Best Practices for Quantum Supervised Learning- Start with a clearly defined prediction and decision objective.
- Establish strong, tuned classical baselines before selecting a quantum model.
- Use leakage-safe preprocessing and validation appropriate to the data-generating process.
- Match loss functions and metrics to output type and business or scientific costs.
- Keep circuits shallow, initialize deliberately, and monitor gradient magnitudes.
- Report simulator and hardware results separately, including shots and transpilation details.
- Test kernel conditioning, calibration, uncertainty, and robustness to noise.
- Compare total resources and reproducibility, not predictive scores alone.
- Treat quantum advantage as an empirical hypothesis requiring independent evidence.
Chapter SummaryQuantum supervised learning combines labelled data, quantum state preparation, parameterized circuits or quantum kernels, measurement, and classical optimization. Variational classifiers and regressors learn circuit parameters directly, whereas quantum support-vector methods use quantum feature-space similarities with classical optimization. QNNs and QCNNs extend these ideas through trainable representations, parameter sharing, locality, and hierarchical structure. Successful design depends on encoding choices, ansatz depth, observables, loss functions, optimization, and noise management. Evaluation must use leakage-safe validation, appropriate imbalance or regression metrics, calibration, resource accounting, and strong classical baselines. Small gains are not persuasive when they disappear under hardware noise, held-out groups, or realistic computational costs. Professional practice therefore treats quantum models as experimental components whose value must be demonstrated for a defined application. Key TermsQuantum supervised learning: Learning predictive relationships from labelled data using quantum states or circuits. Feature map: A circuit that encodes classical inputs into quantum states. Amplitude encoding: Representing normalized feature values in the amplitudes of a quantum state. Angle encoding: Encoding features as rotation angles of quantum gates. Data re-uploading: Inserting input features repeatedly across circuit layers. Variational quantum classifier: A trainable quantum circuit used to predict class labels. Quantum regressor: A quantum model that outputs a continuous prediction. Quantum kernel: A similarity function estimated from quantum feature states. QSVC: A support-vector classifier trained using a quantum-estimated kernel. Ansatz: A parameterized circuit architecture selected for a learning task. Observable: A quantum operator whose measurement supplies a model output. Expectation value: The average outcome predicted for an observable over repeated measurements. Parameter-shift rule: A method for estimating circuit gradients through shifted parameter evaluations. Barren plateau: A region where gradients become very small and optimization becomes difficult. Quantum neural network: A parameterized quantum circuit trained in a neural-network-like pipeline. QCNN: A hierarchical quantum circuit inspired by convolution and pooling. Shot noise: Statistical variation caused by finite repeated quantum measurements. Data leakage: Use of information from validation or test data during model development. Calibration: Agreement between predicted probabilities and observed event frequencies. Quantum advantage: Demonstrated superiority under a specified task and resource comparison. Review QuestionsShort Answer Questions1. What roles do a feature map and an ansatz play in a variational quantum model? 2. Why must an expectation value be transformed before binary cross-entropy is applied? 3. State two reasons why quantum kernel matrices may be difficult to use in practice. 4. What is a barren plateau? 5. Why is accuracy inadequate as the sole metric in an imbalanced fault-detection problem? Long Answer Questions1. Explain the complete workflow of a hybrid quantum supervised-learning system, from preprocessing to evaluation. 2. Compare variational quantum classifiers with quantum-kernel support-vector classifiers in terms of training, resources, and risks. 3. Discuss encoding strategies and the circumstances in which angle encoding, amplitude encoding, or data re-uploading may be appropriate. 4. Explain how validation, metric selection, and classical baselines affect the credibility of a claimed quantum advantage. 5. Describe the architecture and practical limitations of a quantum convolutional neural network. Analytical / Application Questions1. Design an evaluation plan for a quantum model predicting rare medical events. Specify splitting strategy, metrics, calibration procedure, and baseline models. 2. A quantum kernel has a slightly higher validation score than an RBF-SVM but requires thousands of pairwise hardware evaluations. Decide what additional evidence is needed before recommending deployment. 3. A VQC has low training loss but unstable test performance and nearly zero gradients in deeper layers. Diagnose the likely problems and propose a revised experimental design. 22. Multiple Choice Questions with AnswersQuestion 1Which expression correctly represents a binary probability obtained from an expectation value f(x) in [-1,1]? A. p(y=1|x)=f(x)^2 B. p(y=1|x)=(1+f(x))/2 C. p(y=1|x)=exp(f(x)) D. p(y=1|x)=1-f(x)^2 Correct Answer: B. p(y=1|x)=(1+f(x))/2 Question 2What is the primary function of a quantum feature map? A. To split data into training and test sets B. To optimize the classical learning rate C. To encode classical inputs into quantum states D. To calculate the confusion matrix Correct Answer: C. To encode classical inputs into quantum states Question 3A quantum-kernel SVM generally uses the quantum circuit to do what? A. Estimate similarities between input states B. Replace all classical optimization C. Generate labels without training data D. Guarantee a positive-definite kernel without checks Correct Answer: A. Estimate similarities between input states Question 4Which evaluation choice is most appropriate for a rare-fault detection problem? A. Accuracy alone B. Precision-recall AUC and fault-class recall C. Training loss only D. Number of circuit parameters Correct Answer: B. Precision-recall AUC and fault-class recall Question 5Why can data re-uploading be useful in a quantum model? A. It eliminates measurement shots B. It allows features to be inserted across multiple layers C. It guarantees absence of barren plateaus D. It converts regression into clustering Correct Answer: B. It allows features to be inserted across multiple layers Question 6Which practice constitutes data leakage? A. Holding out a final test set B. Fitting a scaler only on training data C. Selecting features using the entire dataset before cross-validation D. Using grouped splits for repeated machines Correct Answer: C. Selecting features using the entire dataset before cross-validation Question 7What is a major concern when a quantum kernel matrix is estimated with finite shots? A. It may become noisy or poorly conditioned B. It cannot contain any pairwise similarities C. It automatically overfits every training example D. It requires no classical optimization Correct Answer: A. It may become noisy or poorly conditioned Question 8Which statement best describes a QCNN? A. A circuit using local operations and pooling-like reduction in a hierarchy B. A classical neural network with no quantum operations C. A kernel method that never measures qubits D. A regression metric for quantum experiments Correct Answer: A. A circuit using local operations and pooling-like reduction in a hierarchy Question 9A fair comparison between a VQC and a classical model should include which requirement? A. Different train-test partitions to showcase each model B. The same preprocessing, splits, and appropriate metric definitions C. Only simulator results for the quantum model D. An untuned classical baseline Correct Answer: B. The same preprocessing, splits, and appropriate metric definitions Question 10What does a barren plateau most directly indicate? A. Extremely large and unstable gradients B. A region of very small gradients that impedes training C. A perfectly calibrated classifier D. A positive-definite kernel matrix Correct Answer: B. A region of very small gradients that impedes training
|