Table of Contents
Fetching ...

QOC: Quantum On-Chip Training with Parameter Shift and Gradient Pruning

Hanrui Wang, Zirui Li, Jiaqi Gu, Yongshan Ding, David Z. Pan, Song Han

TL;DR

The paper addresses the challenge of training parameterized quantum circuits on real, noisy hardware by introducing QOC, an on-chip training framework that uses the exact parameter-shift gradient $\frac{\partial f(\theta)}{\partial \theta_i} = \frac{1}{2}\left(f(\theta_+) - f(\theta_-\right)$) evaluated on hardware. It combines in-situ gradient computation with classical backpropagation and introduces probabilistic gradient pruning to filter unreliable gradients, reducing noise impact and computation. Experiments on 5 QNN benchmarks across 5 IBM devices show that QC-Train-PGP achieves higher real QC accuracy than naive training and can approach noise-free simulation performance, with up to 2× inference savings and up to 7% PQC accuracy gains. This work demonstrates scalable, robust PQC training on current hardware and provides open-source code in TorchQuantum for broader adoption.

Abstract

Parameterized Quantum Circuits (PQC) are drawing increasing research interest thanks to its potential to achieve quantum advantages on near-term Noisy Intermediate Scale Quantum (NISQ) hardware. In order to achieve scalable PQC learning, the training process needs to be offloaded to real quantum machines instead of using exponential-cost classical simulators. One common approach to obtain PQC gradients is parameter shift whose cost scales linearly with the number of qubits. We present QOC, the first experimental demonstration of practical on-chip PQC training with parameter shift. Nevertheless, we find that due to the significant quantum errors (noises) on real machines, gradients obtained from naive parameter shift have low fidelity and thus degrading the training accuracy. To this end, we further propose probabilistic gradient pruning to firstly identify gradients with potentially large errors and then remove them. Specifically, small gradients have larger relative errors than large ones, thus having a higher probability to be pruned. We perform extensive experiments with the Quantum Neural Network (QNN) benchmarks on 5 classification tasks using 5 real quantum machines. The results demonstrate that our on-chip training achieves over 90% and 60% accuracy for 2-class and 4-class image classification tasks. The probabilistic gradient pruning brings up to 7% PQC accuracy improvements over no pruning. Overall, we successfully obtain similar on-chip training accuracy compared with noise-free simulation but have much better training scalability. The QOC code is available in the TorchQuantum library.

QOC: Quantum On-Chip Training with Parameter Shift and Gradient Pruning

TL;DR

The paper addresses the challenge of training parameterized quantum circuits on real, noisy hardware by introducing QOC, an on-chip training framework that uses the exact parameter-shift gradient ) evaluated on hardware. It combines in-situ gradient computation with classical backpropagation and introduces probabilistic gradient pruning to filter unreliable gradients, reducing noise impact and computation. Experiments on 5 QNN benchmarks across 5 IBM devices show that QC-Train-PGP achieves higher real QC accuracy than naive training and can approach noise-free simulation performance, with up to 2× inference savings and up to 7% PQC accuracy gains. This work demonstrates scalable, robust PQC training on current hardware and provides open-source code in TorchQuantum for broader adoption.

Abstract

Parameterized Quantum Circuits (PQC) are drawing increasing research interest thanks to its potential to achieve quantum advantages on near-term Noisy Intermediate Scale Quantum (NISQ) hardware. In order to achieve scalable PQC learning, the training process needs to be offloaded to real quantum machines instead of using exponential-cost classical simulators. One common approach to obtain PQC gradients is parameter shift whose cost scales linearly with the number of qubits. We present QOC, the first experimental demonstration of practical on-chip PQC training with parameter shift. Nevertheless, we find that due to the significant quantum errors (noises) on real machines, gradients obtained from naive parameter shift have low fidelity and thus degrading the training accuracy. To this end, we further propose probabilistic gradient pruning to firstly identify gradients with potentially large errors and then remove them. Specifically, small gradients have larger relative errors than large ones, thus having a higher probability to be pruned. We perform extensive experiments with the Quantum Neural Network (QNN) benchmarks on 5 classification tasks using 5 real quantum machines. The results demonstrate that our on-chip training achieves over 90% and 60% accuracy for 2-class and 4-class image classification tasks. The probabilistic gradient pruning brings up to 7% PQC accuracy improvements over no pruning. Overall, we successfully obtain similar on-chip training accuracy compared with noise-free simulation but have much better training scalability. The QOC code is available in the TorchQuantum library.
Paper Structure (11 sections, 5 equations, 9 figures, 3 tables)

This paper contains 11 sections, 5 equations, 9 figures, 3 tables.

Figures (9)

  • Figure 1: In QOC, PQC training and inference are both performed on real quantum machines, making the whole pipeline scalable and practical.
  • Figure 2: (a) Classical simulation has unscalable computational and memory costs. (b) Noises create significant accuracy gaps between PQC (QNN) classical simulation and on-chip training. (c) Small gradients suffer from larger relative errors, thus being less reliable.
  • Figure 3: Quantum Neural Network (QNN) architecture.
  • Figure 4: Quantum gradient calculation using the parameter shift rule on real quantum devices.
  • Figure 5: Efficient on-chip quantum gradient calculation with probabilistic gradient pruning. Gradient magnitudes are accumulated within the accumulation window and used as the sampling distribution. Based on the distribution, gradients are probabilistically pruned with a ratio $r$ in the pruning window to mitigate noises and stabilize training.
  • ...and 4 more figures