Unentangled quantum reinforcement learning agents in the OpenAI Gym

Jen-Yueh Hsiao, Yuxuan Du, Wei-Yin Chiang, Min-Hsiu Hsieh, Hsi‐Sheng GoanarXiv 2022 · DOI

Abstract

Classical reinforcement learning (RL) has achieved remarkable success across diverse domains, yet it remains plagued by significant sample inefficiency. This paper presents numerical evidence demonstrating that quantum reinforcement learning (QRL) can achieve superior sample efficiency—faster convergence—while utilizing at least one order of magnitude fewer trainable parameters than classical fully-connected neural networks (FCNs). We introduce a single-qubit-based variational quantum circuit (SVQC) architecture that operates without entangling gates, significantly reducing noise sensitivity. Our agents successfully master standard OpenAI Gym benchmarks, including CartPole and Acrobot, and represent the first quantum RL agents to complete the complex LunarLander task on real IBM quantum hardware.

Introduction

The primary bottleneck in modern reinforcement learning is the vast amount of data required for training. While classical agents can master complex games, they often require millions of interactions with an environment to reach human-level performance. Quantum Reinforcement Learning (QRL) offers a potential path toward more efficient learning. However, traditional QRL approaches often struggle with "barren plateaus"—where gradients vanish during training—and the high error rates associated with entangling gates on current Noisy Intermediate-Scale Quantum (NISQ) devices.

The SVQC Architecture

To address these challenges, we developed the Single-Qubit-based Variational Quantum Circuit (SVQC). This architecture is designed for robustness and efficiency by intentionally avoiding entangling gates.

The SVQC architecture features an input layer for data re-uploading, a parameter layer for learning, and a classical post-processing stage with output reuse (coping).

The SVQC employs several key strategies:

  • No Entanglement: By manipulating each qubit independently, we bypass the barren plateau problem and minimize errors from noisy hardware.
  • Data Re-uploading: Environmental features (e.g., position, velocity) are encoded directly into the rotation angles of single-qubit gates.
  • Output Reuse (Coping): Measurement results from the qubits are "copied" $\ell$ times and fed into a classical fully-connected layer. This hybrid approach significantly boosts the expressive power of a small number of qubits.

Hybrid Quantum-Classical Learning

The agent operates in a closed loop with a classical environment. The quantum circuit acts as the policy network, determining actions based on the current state.

The hybrid QRL framework: state features are processed by the quantum circuit to produce actions, while a classical optimizer updates circuit parameters based on rewards.

We utilize the Proximal Policy Optimization (PPO) algorithm for training. The classical optimizer calculates the loss based on rewards received from the environment and updates the parameters ($\theta$) of the quantum gates. This synergy allows the agent to leverage quantum representational power while benefiting from mature classical optimization techniques.

Experimental Benchmarking

We evaluated our SVQC agents on three classic OpenAI Gym environments:

  1. CartPole-v1: Balancing a pole on a cart.
  2. Acrobot-v1: Swinging a two-link pendulum.
  3. LunarLander-v2: Navigating a spacecraft to a landing pad.

In all tasks, the quantum agents demonstrated superior sample efficiency. For instance, in CartPole, the SVQC agent reached maximum reward in approximately 150 episodes, compared to 400 episodes for classical models. Most notably, our agent is the first quantum model to successfully solve the LunarLander task, reaching the target reward in 1,000 episodes—nearly twice as fast as a classical FCN.

Furthermore, the quantum agents achieved these results with extreme parameter efficiency. While classical benchmarks required roughly 8,800 parameters, our quantum agents used between 200 and 900 parameters, suggesting that quantum circuits can represent complex control policies much more compactly than classical neurons.

Real-World Quantum Hardware Validation

To prove the practical viability of our unentangled approach, we deployed the trained models on real IBM quantum machines (ibmq_lagos and ibmq_belem). Despite the inherent noise of NISQ hardware, the performance on these physical devices closely matched our ideal simulations. This robustness is a direct result of the unentangled, shallow-circuit design, which minimizes the accumulation of gate errors.

Conclusion

Our findings suggest that entanglement is not a strict prerequisite for achieving a "quantum advantage" in reinforcement learning. By focusing on shallow, unentangled circuits and hybrid post-processing, we can create RL agents that are more sample-efficient, parameter-efficient, and hardware-resilient than their classical counterparts. Future research will explore how this architecture scales to high-dimensional inputs like raw pixels and investigate the specific thresholds where entanglement becomes necessary for more complex tasks.

Reference: Hsiao, J. Y., et al. (2022). Unentangled quantum reinforcement learning agents in the OpenAI Gym. arXiv:2203.14348v1 [quant-ph].

Summary updated

BibTeX
@misc{hsiao2022unentangled,
  author = {Jen-Yueh Hsiao and Yuxuan Du and Wei-Yin Chiang and Min-Hsiu Hsieh and Hsi‐Sheng Goan},
  title = {{Unentangled quantum reinforcement learning agents in the OpenAI Gym}},
  year = {2022},
  eprint = {2203.14348},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.14348},
}
Figure