NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Robust quantum control using reinforcement learning from demonstration

Shengyong Li, Yuhong Fan, Xiangyang Li, Xinhui Ruan, Qianchuan Zhao, Zhihui Peng, Re-Bing Wu, Jing Zhang, Pengtao Song

Abstract

Quantum control requires high-precision and robust control pulses to ensure optimal system performance. However, control sequences generated with a system model may suffer from model bias, leading to low fidelity. While model-free reinforcement learning (RL) methods have been developed to avoid such biases, training an RL agent from scratch can be time-consuming, often taking hours to gather enough samples for convergence. This challenge has hindered the broad application of RL techniques to larger and more complex quantum control issues, limiting their adaptability. In this work, we use Reinforcement Learning from Demonstration (RLfD) to leverage the control sequences generated with system models and further optimize them with RL to avoid model bias. By avoiding learning from scratch and starting with reasonable control pulse shapes, this approach can increase sample efficiency by reducing the number of samples, which can significantly reduce the training time. Thus, this method can effectively handle pulse shapes that are discretized into more than 1000 pieces without compromising final fidelity. We have simulated the preparation of several high-fidelity non-classical states using the RLfD method. We also find that the training process is more stable when using RLfD. In addition, this method is suitable for fast gate calibration using reinforcement learning.

Introduction: The Challenge of Model Bias

The realization of practical quantum computing hinges on the ability to perform high-fidelity operations. Traditionally, these operations are driven by electromagnetic pulses designed using model-based optimal control techniques, such as the GRadient Ascent Pulse Engineering (GRAPE) algorithm. These methods rely on an accurate mathematical description of the system's Hamiltonian. However, in real-world laboratory settings, the Hamiltonian is often imperfectly known due to calibration errors or environmental noise. This discrepancy, known as "model bias," results in control pulses that perform sub-optimally on physical hardware.

Model-free Reinforcement Learning (RL) offers a compelling alternative. By interacting directly with the quantum system and learning from the resulting rewards (e.g., state fidelity), an RL agent can discover control strategies that are inherently robust to model inaccuracies. However, the "blind" exploration phase of standard RL is computationally expensive and slow, especially when dealing with high-dimensional control spaces where a single pulse is discretized into thousands of segments.

Methodology: Reinforcement Learning from Demonstration (RLfD)

To overcome the sample inefficiency of standard RL, we propose a hybrid approach: Reinforcement Learning from Demonstration (RLfD). Instead of starting from a random initialization, the RL agent is initialized with "demonstrations"—pulse sequences generated by traditional model-based methods or pre-trained agents.

Schematic of the RLfD framework. (a) Demonstrations are collected from various sources like GRAPE or analytical gates. (b) The RL agent uses these demonstrations to warm-start its policy, subsequently interacting with the quantum system to refine the control pulses based on rewards.

We investigated two primary RL architectures:

  1. Proximal Policy Optimization (PPO): An on-policy algorithm that ensures stable updates. We implemented a supervised "warm-start" phase where the agent learns to mimic the demonstration pulses before beginning environmental interaction.
  2. Soft Actor-Critic (SAC): An off-policy algorithm that is typically more sample-efficient. In this case, we utilized a demonstration replay buffer and a behavior cloning loss to guide the agent's exploration.

By providing a "reasonable" starting point, the agent avoids the most difficult part of the learning process—finding the basic structure of a functional pulse—and can focus on fine-tuning the sequence to account for specific hardware quirks.

Key Results and Insights

The RLfD approach was tested across several demanding quantum tasks, including Bell state preparation, bosonic state engineering (Binomial and Cat states), and GKP state preparation.

Breaking the Dimensionality Barrier

A significant hurdle for standard RL is the "curse of dimensionality." When control pulses are discretized into many segments (e.g., >1000), the search space becomes prohibitively large. RLfD successfully handled pulses with up to 2,200 segments, maintaining high fidelity where standard RL often failed to converge.

Robustness to Model Inaccuracy

One of the most striking findings is the method's resilience to errors in the initial demonstrations. Even when the "expert" pulses were generated using a model with up to 30% parameter error, the RL agent was able to correct these flaws through interaction with the environment.

Training performance under varying levels of model bias (10% to 30%). The plots show the convergence of infidelity over training timesteps for different bosonic state preparation tasks, demonstrating that RLfD can reach high fidelity even with imperfect initial demonstrations.

Efficiency and Stability

RLfD demonstrated a clear advantage in training speed. For Bell state preparation, the method reached a target fidelity of 0.995 more than twice as fast as standard model-free RL. Furthermore, the training process was notably more stable, with PPO achieving fidelities as high as 99.8% for complex bosonic states.

Conclusion

Reinforcement Learning from Demonstration provides a powerful bridge between traditional optimal control and modern machine learning. By leveraging the strengths of model-based "guesses" to jumpstart model-free learning, we can achieve high-fidelity quantum control that is both sample-efficient and robust to model bias. This approach is particularly promising for the fast calibration of gates on near-term quantum hardware, where "shot time" is a precious resource. Future work will focus on scaling these techniques to multi-qubit systems and real-time error correction protocols.

Summary updated

BibTeX
@inproceedings{li2025robust,
  author = {Shengyong Li and Yuhong Fan and Xiangyang Li and Xinhui Ruan and Qianchuan Zhao and Zhihui Peng and Re-Bing Wu and Jing Zhang and Pengtao Song},
  title = {{Robust quantum control using reinforcement learning from demonstration}},
  booktitle = {Npj},
  year = {2025},
  doi = {10.1038/s41534-025-01065-2},
}
Figure