Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 2.02 KB

README.rst

File metadata and controls

46 lines (31 loc) · 2.02 KB

Gym Environment for Quantum Circuit Synthesis (using qiskit and qutip)

A custom gym environment for the generation of optimal quantum circuits which perform a given computational task, using IBMQ's Qiskit library for Python. Options include:

  1. Defining size of the circuit in terms of number of qubits
  2. Choosing whether to use unitary matrices or statevectors
  3. Choosing a set of gates to use, predefined or custom
  4. Choosing the physical connectivity of the qubits, predefined or custom
  5. Choosing initial goal states or unitaries

A step in the environment is defined as applying one single gate from the defined gate group to a specific qubit, with all possible combinations of gate/qubit pairs (or triplets in case of a two qubit gate) being generated based on the defined connectivity.

The reward is sparse, and inversely proportional to the amount of gates needed to get to the goal - incentivising smaller circuits. Experimentation with custom reward functions is encouraged.

Qiskit Integration

Qiskit is central to this environment, providing the QuantumCircuit class that allows the sequential application of gates to construct a circuit representation of a unitary process. This facilitates the simulation of a given circuit using the Aer backend in order to obtain the resultant quantum state. The library also provides a tool to visualise the current circuit using standard literature conventions.

Installation

First clone/download the repo. Then (preferably in a fresh virtual environment):

cd quantumcircuit-gym
conda install -c conda-forge qutip
while read requirement; do conda install --yes $requirement; done < conda_reqs.txt
pip install -r requirements.txt
pip install -e .

In progress: better installation automation

Example use

Most methods displayed in tutorial notebook.