Papers
Topics
Authors
Recent
2000 character limit reached

Variational Quantum Classifiers (VQC)

Updated 24 January 2026
  • Variational Quantum Classifiers are hybrid quantum–classical models that encode classical data into quantum states using angle encoding and variational circuits.
  • They use a trainable circuit optimized via the parameter-shift rule to minimize task-specific loss, achieving nonlinear pattern recognition on NISQ devices.
  • Practical implementations, such as B-cell epitope prediction, demonstrate high accuracy with trade-offs in class imbalance sensitivity, highlighting both potential and limitations.

A Variational Quantum Classifier (VQC) is a hybrid quantum–classical supervised learning model in which classical data are mapped into a quantum state, processed through a parameterized quantum circuit (variational ansatz), and measured to yield class probability estimates. The trainable circuit parameters are optimized via classical algorithms to minimize a task-specific loss function. VQCs are uniquely positioned to exploit the representational power of quantum circuits for nonlinear pattern recognition, particularly on Noisy Intermediate-Scale Quantum (NISQ) devices. Below, the architecture, training principles, design trade-offs, scalability, and practical benchmarks are detailed with direct reference to quantum machine learning applications such as B-cell epitope prediction (Hwang et al., 16 Apr 2025).

1. Circuit Architecture and Data Encoding

The canonical VQC circuit is structured in three stages:

  1. Data-encoding layer (UΦ(x)U_{\Phi(x)}): A nonlinear feature map encodes the nn-dimensional classical input vector x=(x1,,xn)x=(x_1,\ldots,x_n) via angle encoding onto nn qubits. The encoding uses per-qubit single-qubit rotations:

UΦ(x)0n=j=1nRZ(fj(x))RX(gj(x))0U_{\Phi(x)}\,|0\rangle^{\otimes n} = \bigotimes_{j=1}^n RZ(f_j(x))\,RX(g_j(x))\,|0\rangle

where fjf_j and gjg_j are problem-dependent nonlinear functions (implemented in Qiskit). This produces a state Φ(x)|\Phi(x)\rangle reflecting the original data distribution but embedded in Hilbert space.

  1. Variational (trainable) layer (W(θ)W(\boldsymbol{\theta})): Composed of \ell repeated sublayers, each consisting of:

    • An entangling block UentU_{\text{ent}} (e.g., five consecutive SWAP gates) that couples all qubits.
    • A pattern of local, trainable single-qubit rotations R(θj)R(\theta_j) (typically RYRY or RZRZ):

    W(θ)=l=1[Entangle Uent; Local rotationsj=1nR(θj,l)]W(\boldsymbol{\theta}) = \prod_{l=1}^\ell \left[\text{Entangle}~U_{\text{ent}};~\text{Local rotations}\bigotimes_{j=1}^n R(\theta_{j,l})\right]

  2. Measurement: After application of the variational circuit, a single-qubit ZZ measurement (on, e.g., qubit 1) yields the expectation Z\langle Z \rangle, and empirical class probabilities are estimated through repeated sampling.

The total parameter count is m=n×m = n \times \ell for nn qubits and \ell variational layers.

2. Objective Function, Gradient Evaluation, and Training Protocol

The VQC training is based on minimizing the expected misclassification probability over the dataset TT. For each sample xix_i with label yiy_i:

  • The output class probability py(x)p_y(x) is estimated from RR repeated circuit executions as py(x)=ry/Rp_y(x) = r_y / R, with ryr_y as the number of outcome yy.
  • The loss function is defined as

L(θ)=i=1tPr(m^(xi;θ)yixiT)L(\theta) = \sum_{i=1}^t \Pr\bigl(\hat{m}(x_i;\theta) \neq y_i | x_i \in T\bigr)

An analytical approximation is supplied via the sigmoid of a scaled difference between pyp_y and a bias term:

Pr(m^(xi)yi)sig(R[2yibpy2py(1py)])\Pr\bigl(\hat{m}(x_i) \neq y_i\bigr) \approx \text{sig}\Bigg(\sqrt{R} \cdot \left[2^{-y_i b} \frac{p_y}{\sqrt{2 p_y (1-p_y)}}\right]\Bigg)

where bb is an empirically chosen bias and sig(x)=1/(1+ex)\text{sig}(x) = 1/(1 + e^{-x}).

Parameter optimization utilizes the parameter-shift rule for exact and hardware-implementable gradients: Lθj=L(θj+π/2)L(θjπ/2)2\frac{\partial L}{\partial \theta_j} = \frac{L(\theta_j + \pi/2) - L(\theta_j - \pi/2)}{2} Parameters are updated in an iterative inner loop, typically with gradient descent: θ(t+1)=θ(t)ηL(θ(t))\theta^{(t+1)} = \theta^{(t)} - \eta\,\nabla L(\theta^{(t)}) where η\eta (learning rate) is tuned empirically.

Training proceeds in an online manner (batch size =1= 1), iterating over all samples: execute the circuit, evaluate pyp_y, compute loss, compute gradients, and update parameters, until convergence.

3. Practical Implementation—Hyperparameters and Pseudocode

The operational hyperparameters include:

  • RR: number of shots per forward pass (controls statistical noise).
  • η\eta: learning rate, often $0.1$–$0.01$ in Qiskit-based experiments.
  • \ell: circuit depth, set according to the computational budget and expressivity needs.

The pseudocode implementing the VQC workflow is:

  1. Initialize θ0\theta_0, select the feature map UΦU_\Phi and ansatz WW, set RR, η\eta.
  2. For each training sample xix_i: a. Prepare 0n|0\rangle^{\otimes n}, apply UΦ(xi)U_{\Phi(x_i)} and W(θ)W(\theta). b. Perform RR repeated measurements; accumulate ryr_y and compute pyp_y.
  3. Calculate L(θ)L(\theta) and its gradients via the parameter-shift rule.
  4. Update parameters θ\theta.
  5. Repeat until loss convergence.
  6. For inference, assign label y=argmaxypy(x)y = \arg\max_y p_y(x) after executing UΦ(x)W(θ)U_{\Phi(x)} W(\theta^*).

4. Empirical Performance and Comparison with Quantum SVM

On the B-cell epitope dataset, the VQC achieves:

Comparative QSVM performance on the same dataset yields 70%70\% ACC, $0.71$ AUC, and $0.42$ MCC. Thus, the VQC slightly outperforms QSVM in raw accuracy but is less robust to class imbalance (lower MCC). This highlights VQC's capacity for nonlinear pattern modeling—increased accuracy at the cost of reduced sensitivity to minority classes, a known challenge in variational models without explicit cost-sensitivity or oversampling (Hwang et al., 16 Apr 2025).

5. Applications, Scalability, and Limitations

VQCs are applicable wherever high-dimensional, nonlinear classification is required but computational and hardware efficiency is essential (e.g., bioinformatics, as in B-cell epitope prediction). The variational approach allows direct adaptation to complex data distributions and is compatible with NISQ-era limitations via shallow depth and batchwise updates.

However:

  • Class imbalance remains an outstanding issue—VQCs as constructed are not inherently sample-balance aware.
  • The stochasticity from measurement shots must be managed with sufficiently large RR, with classical optimizer hyperparameters tuned for the resulting noise profile.
  • Circuit design, particularly the feature map nonlinearity and ansatz depth, critically influences both expressivity and trainability.

A plausible implication is that deploying VQC for strongly imbalanced biomedical datasets will require incorporation of additional techniques such as cost-sensitive loss or class-conditional resampling to maximize both raw and balanced accuracy.

6. Design Considerations for Future Work

The VQC paradigm supports generic deployment across domains—feature map, ansatz structure, loss, and training procedures are modular. However, practical improvements necessitate:

  • Optimizing the choice of fjf_j and gjg_j in the feature map for specific data modalities.
  • Integrating advanced optimizers that mitigate gradient noise.
  • Extending evaluation metrics beyond accuracy to include robust measures like MCC for imbalanced datasets.
  • Benchmarking against both quantum and classical baselines for comprehensive assessment.

Given the observed class imbalance sensitivity, future iterations should prioritize improved loss formulations and data augmentation strategies to ensure VQC scalability to larger, more heterogeneous datasets (Hwang et al., 16 Apr 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Variational Quantum Classifiers (VQC).