enfield is a source-to-source compiler that processes a quantum intermediate representation specified by IBM, called Open Quantum Assembly (OpenQASM). It was created in order to serve as a framework to solve a relatively new problem in quantum computing, what we call "qubit allocation". Further information can be found in the work of Maslov et al., and more recently our published work in the Symposium of Code Generation (CGO) 2018.

Qubit Allocation consists in mapping logical qubits to physical qubits. It resembles the problem of register allocation in classical machines, even though it does not cover quantum memory. There are some differences when comparing the two versions of the allocation problem: all computations must be reversible; and the fact that it is not possible to clone qubit states from only one. Furthermore, for some architectures, there are constraints on which two qubits can interact with each other. Therefore, in order to execute the program with the same semantics (i.e.: the interactions between the states of any two qubits must be executed), we may use some transformations, such as: reversals; swaps; and bridges.

With this information, enfield implements some methods that accomplish this job: dynprog; wpm; wqubiter; qubiter; and wpm_random. Because it is architecture-dependent, it lets the user specify whether to use two of the built-in architectures -- ibmqx2 (5 qubits); and ibmqx3 (16 qubits) -- or specify one. You can download it in a docker image as the code below shows or download our most recent version at our GitHub repository. Instructions are available in the README.md file.

$ docker pull ysiraichi/enfield-ae
$ docker run -it ysiraichi/enfield-ae /bin/bash

In the interface on the right, you can paste your OpenQASM code, choose the target quantum architecture and the qubit allocation algorithm to be used (click here for more information). It will then process the given code into a QASM code that does not break any of the architecture coupling restrictions and the total cost needed to implement the algorithm. For more information on IBM's architectures, click here .

Enfield Config
BMT Parameters
Total Cost: