In the past few weeks, I’ve been extending QJava, my burgeoning Java class library for writing quantum computing software. I’ve already used QJava to write several applications. Most recently I used it to write “Quibbs”. Quibbs outputs a quantum circuit in a “modern language” that utilizes a sophisticated vocabulary with goodies such as nested loops, U(2) operations with arbitrarily many controls, and quantum multiplexors. What I’ve done in the past few weeks is to write classes that translate this modern language to a much simpler “primitive language” that avoids most of the goodies. Methinks translator applications that dumb-down a quantum language, will someday be useful, because future QC hardware will only “understand” a primitive language, but the QC programmer will prefer writing programs in a modern language. Furthermore, parallelized software, for simulating a QC on classical computers, prefers as input a quantum circuit written in a primitive language. It’s easier to write parallelized software with such an input.
Figs. 1 and 2, taken from my paper arXiv:1004.2205, define precisely the vocabulary of the modern language. In these tables, , and stand for the Pauli matrices. Also, and , where and . In the modern language, a quantum circuit is specified using two text files: an “English File” and a “Picture File”. For a given circuit, the lines of its English and Picture Files are in 1-1 correspondence. In both of these files, time flows from top to bottom, and each line represents one gate. In the Picture file, the rightmost qubit is labeled 0, the next one as we move from right to left, is labeled 1, the next one 2, and so on. Click here to see a previous blogpost of mine praising the beauty of Picture Files.
The vocabulary of the primitive language is much simpler. It has no loops or multiplexors. It has gates that act on no more than 2 qubits (so no gates with arbitrarily many controls). Okay, we might make an exception and allow a gate that acts on more than 2 qubits. We’ll allow the Toffoli gate, which acts on 3, but only because its name sounds like that of a tasty Italian pastry.
In my software, I go from the modern to the primitive language in several stages:
- Eliminate multiplexors This is done by my previously released Java application “Multiplexor Expander”, which can re-express multiplexors either as an exact SEO (SEO=Sequence of Elementary Operations), or as an approximate SEO (in the “oracular approximation”).
- Reduce number of controls of each gate. Here I eliminate all gates with more than 1 control, except for the Toffoli which has 2. This is done using identities communicated to us from antediluvian times by a famous paper, viz. Phys.Rev.A 52(1995)3457, written by Barenco, Carlo Beneto, et al.—a cast of thousands.
- Eliminate Loops