Source-linked AI summary

Reinforcement Learning with Quantum Variational Circuits

Owen Lockwood, Mei Si

arXiv:2008.07524v3quant-phcs.LGstat.ML

TL;DR

The paper asks whether quantum variational circuits can support reinforcement learning with reduced parameter complexity. It develops quantum data encodings and pure or hybrid QVC replacements for DQN and Double DQN, then evaluates them in CartPole and Blackjack. The reported results show that both QVC types solve the tested tasks, with positive comparisons against traditional neural-network approaches and a scope that still requires broader validation.

  • Problem

    The paper investigates whether quantum computing can aid reinforcement learning while exploiting potential speed and parameter-space advantages over traditional approaches.

  • Method

    The authors use a quantum simulator to test pure and hybrid QVCs in DQN and Double DQN, with new classical-to-quantum encoding schemes.

  • Results

    Both hybrid and pure QVC models achieve better policies and faster arrival at those policies than traditional neural networks in CartPole, while QVC approaches solve tasks across CartPole and Blackjack.

  • Takeaways & Limitations

    Results on CartPole and Blackjack suggest that QVCs may have representational abilities superior to traditional neural networks and indicate a potentially impactful relationship between quantum machine learning and deep reinforcement learning.

  • Takeaways & Limitations

    The paper states that generalizability requires further experiments with varied QVC hyperparameters, applications, encoding schemes, and more complex environments.

Abstract

from arXiv · show

The development of quantum computational techniques has advanced greatly in recent years, parallel to the advancements in techniques for deep reinforcement learning. This work explores the potential for quantum computing to facilitate reinforcement learning problems. Quantum computing approaches offer important potential improvements in time and space complexity over traditional algorithms because of its ability to exploit the quantum phenomena of superposition and entanglement. Specifically, we investigate the use of quantum variational circuits, a form of quantum machine learning. We present our techniques for encoding classical data for a quantum variational circuit, we further explore pure and hybrid quantum algorithms for DQN and Double DQN. Our results indicate both hybrid and pure quantum variational circuit have the ability to solve reinforcement learning tasks with a smaller parameter space. These comparison are conducted with two OpenAI Gym environments: CartPole and Blackjack, The success of this work is indicative of a strong future relationship between quantum machine learning and deep reinforcement learning.

1 Introduction

The paper investigates quantum computing as an aid for reinforcement learning, motivated by potential computational advantages from superposition and entanglement. It extends prior QVC-based work by evaluating more algorithms, encodings, and complex environments.

  • Deep reinforcement learning has achieved strong performance across complex games, while research seeks higher scores, shorter training, and smaller models.
  • Quantum algorithms may improve machine-learning speed and exploit superposition and entanglement, motivating quantum reinforcement learning.
  • Prior QVC work used Double DQN on deterministic Frozen Lake and reported O(N) parameter complexity versus O(N2) for neural-network DQN.
  • This study evaluates multiple QVC types and reinforcement-learning algorithms, introduces encoding schemes, and tests more complex environments than earlier work.
  • Using a quantum simulator, the authors report largely positive results for quantum techniques applied to OpenAI Gym reinforcement-learning environments.

2 Reinforcement Learning

Reinforcement learning models an agent interacting with an environment to maximize reward. This paper frames the task as an MDP and uses Q-value estimation to derive policies for discrete actions.

  • An MDP represents reinforcement learning through states, actions, transition probabilities, and rewards.
  • The agent seeks a policy that maximizes expected cumulative reward, with future rewards often discounted by γ.
  • The paper’s environments are deterministic, so the state-transition probability is set to Pa = 1.
  • Q learning estimates the value of taking an action from a state using immediate reward plus the maximum future Q value.
  • For discrete actions, the policy selects the action with the largest Q-value produced by parameters θ.

3 Quantum Computing

Quantum computing represents information with qubits that can occupy superpositions and become entangled through quantum gates. Quantum variational circuits use parametrized gates whose measured outputs can be optimized through learned parameters and parameter-shift gradients.

  • Qubits and Superposition: A qubit wavefunction can be a linear combination of |0⟩ and |1⟩, allowing superposition before measurement yields one classical state.
  • Qubits and Superposition: With N qubits, information representation scales as O(2^N), and a single qubit can be visualized on a Bloch sphere.
  • Gates: CNOT gates induce entanglement, linking qubits so operations on one affect their shared wavefunction and can influence multiple qubits.
  • Quantum Variational Circuits: Quantum variational circuits consist of parametrized gates U(θ), measured with a Pauli Z readout, while a loss function updates θ.
  • Quantum Variational Circuits: The paper uses parameter-shift differentiation to calculate gradients for optimizing QVC parameters.

4 Approach

The approach replaces neural-network components in DQN and Double DQN with pure or hybrid QVCs, using quantum pooling or a dense layer to match action spaces. It introduces encoding schemes for classical inputs and integrates encoded states into the replay-buffer and parameter-update workflow.

  • QVC models: The study evaluates pure and hybrid QVCs within both DQN and Double DQN, with hybrid outputs passed through a single dense layer.Pure and hybrid refer to whether QVC outputs are directly processed quantum mechanically or fed into a classical dense layer.
  • Quantum data encoding: The proposed encodings represent integer and floating-point arrays with O(N) qubits, compared with O(Nlogn) qubits for binary conversion.Scaled Encoding maps bounded inputs to rotations, while Directional Encoding applies π or 0 radians according to input sign.
  • Quantum data encoding: Scaled Encoding uses Rx and Rz rotations after mapping each bounded input to 0 through 2π, requiring two gates per qubit.The scheme is intended for environments with defined input ranges.
  • Model architecture: Each QVC uses three repeated circuit layers containing parametrized Rx, Ry, and Rz rotations preceded by CNOT gates for entanglement.The circuit layers are visual groupings rather than neural-network layers.
  • Output architecture: Hybrid QVCs resize outputs to the action space with a dense layer, while pure QVCs use quantum pooling to reduce qubit representations.Quantum pooling combines and reduces the representation so observation and action spaces can differ.
  • Algorithm integration: Encoded states replace raw states in replay-buffer tuples, after which DQN-style targets, loss calculation, and parameter updates proceed through the QVC.The replay buffer stores encoded state transitions while action selection remains epsilon-greedy.

5 Experiments

Experiments compare pure and hybrid QVC-based DQN and Double DQN models with neural-network baselines on CartPole and Blackjack, using encoding schemes suited to each environment. Across these tasks, QVC models achieve comparable or better learning behavior with substantially smaller parameter spaces.

  • Environments and encodings: CartPole uses Directional encoding, while Blackjack uses Scaled encoding to preserve input magnitude where it affects the optimal strategy.CartPole inputs have an infinite range in which magnitude does not matter; Blackjack requires magnitude because outcomes differ substantially across point totals.
  • CartPole: Both pure and hybrid QVC models achieve better policies faster than traditional neural networks on CartPole DQN, while QVC models perform at least as well on CartPole Double DQN.The comparisons use six runs and 95% confidence intervals; graphs begin at 50 iterations because rewards average the previous 50 iterations.
  • CartPole: 48 trainable parameters in the pure QVC achieve performance comparable to neural networks with 58, 226, and 1,282 trainable weights across the CartPole comparisons.The pure and hybrid QVC parameter spaces are 48 and 101, respectively, while the neural networks use one, two, or three intermediate layers.
  • Blackjack: Blackjack comparisons use DQN and Double DQN, with QVC approaches learning slightly faster than same-order neural networks, though slightly below higher-parameter networks.The Blackjack models use 33 QVC parameters versus 38, 194, and 1,250 neural-network parameters, with a random agent as a baseline.
  • Blackjack: Both pure and hybrid QVCs achieve similar Blackjack results because the environment’s optimal policy is more limited and therefore easier to attain.The experiments report that the Scaled encoding scheme can effectively represent the relevant Blackjack inputs.

6 Discussion

The discussion identifies a difference between hybrid and pure QVC behavior and argues that the encoding schemes may broaden applicability beyond the tested environments. It also states that broader generalizability remains unverified and requires further experiments.

  • 6.1 Differences in Hybrid and Pure: In three of four tests, hybrid and pure models perform comparably, while CartPole Double DQN is the exception: pure QVC achieves a superior policy and hybrid resembles the neural-network model.The authors suspect faster hybrid convergence may lead to a local rather than global optimum, but present this as a possibility.
  • 6.1 Differences in Hybrid and Pure: Faster convergence is advantageous when the optimal policy is less complex, as in the Blackjack setting.The discussion connects the benefit of faster convergence to the limited complexity of the policy.
  • 6.2 Generalizability: The encoding schemes may improve generalizability by supporting floating-point and integer arrays without tying observation and action spaces together.Directional encoding targets infinite-range inputs where magnitude is unimportant, while Scaled encoding targets bounded inputs without significant skew.
  • 6.3 Future Work: Generalizability remains unverified and requires experiments with more QVC hyperparameters, different applications, more complex environments such as Atari, and additional encoding schemes.Further encoding work depends on the necessary gates becoming available in TensorFlow-Quantum.

7 Conclusion

The work presents hybrid and pure Quantum Variational Circuit approaches for DQN and Double DQN across CartPole and Blackjack, including two classical-to-quantum encoding schemes. Success on both environments suggests potential representational advantages over traditional neural networks and an impactful relationship between quantum computing and reinforcement learning.

  • Hybrid and pure Quantum Variational Circuits are demonstrated with DQN and Double DQN on CartPole and Blackjack.
  • The work introduces Scaled encoding and Directional encoding for converting classical data into quantum inputs.
  • Success on both environments suggests that Quantum Variational Circuits may have representational abilities superior to traditional neural networks.
  • The results indicate a potentially impactful relationship between quantum computing and reinforcement learning.
Loading 2008.07524v3…