In this post we explore the integration of IBM qiskit, a library developed to design, run and simulate quantum circuits, and OpenAI gym, a library developed to define, train and run reinforcement learning agents.
We develop a simple quantum game, qcircuit, that is, a game where part of the underlying game logic is controlled by a quantum circuit. Our game simply requires the user to interact with a given quantum circuit, and add or remove standard gates in order to achieve a predefined ending state. The game is simple enough to be simulated locally (although, qiskit allows for remote execution on a quantum platform).
The game we developed is implemented following the standard OpenAI interface. This allows us to deploy some pre-made agents available in the stable-baselines and train them on our quantum game. Finally we observe and compare the performance of these agents against the performance of a random agent.