Quantum Bayesian Networks

January 31, 2017

Qubiter and IBM-QASM2 can now communicate via sign language

Filed under: Uncategorized — rrtucci @ 5:15 pm

I’ve always liked mime (Marcel Marceau, Charlie Chaplin,…), physical comedy (using body motions as a source of humor, like Italians do) and the closely related sign-language for the deaf. Sign language can be extremely clever, inventive and expressive. For example, this is how to say Donald Trump in sign-language:
trump-in-sign-language

But enough about Trump, who threatens to suck the air and joy out of every conversation. The official purpose of this blog post is to advertise the fact that now Qubiter (https://github.com/artiste-qb-net/qubiter) can convert quantum circuits from its native language to that of IBM, so that you can generate quantum circuits using Qubiter and then run them on the IBM hardware (assuming that those circuits have only 5 qubits and less than about 80 gates)

Recently, the folks at IBM Quantum Experience (IBM-QE) have introduced some very nice enhancements to their QC cloud service. The graphical user interface (GUI) of their website has been revamped. They have also opened two new repositories on GitHub,

  1. IBMQuantum/QASM
  2. IBMResearch/python-sdk-quantum-experience

Repo 1 introduces their new “intermediate level language” QASM2.0 with a paper in Latex/pdf that teaches the in and outs of their language. This repo also includes samples of qasm2 scripts of two types: some that can be run on their current hardware, and some that can’t be but can still be simulated using their numerical simulator.

Repo 2 gives some Python code for accessing the IBM-QE service via a python script or Jupyter notebook.

To keep up with these IBM enhancements, Qubiter now includes a new file called Qubiter_to_IBMqasm.py This file contains a class of the same name that translates Qubiter “English files” to IBM QASM files. You can write a simple Python script that reads the qasm file produced by the class Qubiter_to_IBMqasm and inputs that string into the code of Repo 2. That way, you don’t even have to visit the IBM-QE website to run your q circuit on their hardware. Alternatively, you can manually copy&paste the qasm file produced by the new Qubiter class into the “QASM Editor” at the IBM-QE website.

The current IBM-QE hardware doesn’t allow all possible CNOTs among its 5 qubits. Out of the 5 qubits 0, 1, …, 4, only qubits 1, 2 and 4 can be physical targets of an elementary CNOT. Also, some pairs of qubits cannot be the two ends of an elementary CNOT because they are physically disconnected. The class Qubiter_to_IBMqasm overcomes both of these limitations. It allows CNOTs among any pair of qubits. Every elementary CNOT that is disallowed is replaced by a compound CNOT; i.e., either 1 or 4 elementary CNOTs (and a bunch of Hadamards) that is equivalent to the original CNOT and is allowed.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: