GithubHelp home page GithubHelp logo

quantum-chain's Introduction

Quantum-chain

A tool chain to generate nearest neighbour complaint circuit for arbitrary topologies.

Tool chain workflow

The toolchain takes two primary parameters as input

Image of IBMQ16

Let’s say that the circuit C has n qubits and the graph G has k qubits

Topology extraction

Multiple subgraphs of n qubits are extracted from the graph G. Each subgraph has a unique topology and no two subgraphs are isomorphic. A probabilistic approach is used for choosing the subgraph. 128 tries are made to extract the topologies. Let the topology graph be T.

NN-circuit generation

We use an ILP solver to optimally generate a NN-complaint circuit from the input circuit C and a topology graph T. Furthermore, we use n*n steps for generating the NN circuit. Another interesting constraint is the mapping of the individual qubits in the circuit to the vertices in the topology graph T. We consider some random mappings of the qubits to the vertices for generating multiple variants of NN-complaint circuit.

Tool chain usage

Installation

The tool is implemented in Python3 and tested on Ubuntu 18.04. Install the depedencies from requirements.txt.

You need a valid installation of Gurobi along with the Python wrapper. Academic license can be obtained for free via their website.

Running instructions

We demonstrate the usage of the tool by means of an example.

  • sample_ckt.real : Input quantum circuit with 4 qubits (a, b, c and d) sample_ckt.read
  • qx15.gml : Quantum computer graph with 16 qubits
cd quantum-chain
python3 qchain.py ./tests/sample_ckt.real ./tests/qx15.gml 

Output

The output is written to ./genfiles/sample_ckt folder. The name of the subfolder in genfiles is same as the name of the input quantum circuit. Multiple solutions are generated by the tool.

  • sample_ckt_i.cfg : The qubit configuration of i^th solution. The first number denotes the vertex id and the second number indicates the qubit. This file is saved in the following sub-directory under /genfiles/sample_ckt/allmaps/cfg
  • topofiles/qx15_4_2.gml : 2nd Topology graph extracted from qx15 with 4 qubits. Saved in /genfiles/sample_ckt/allmaps/gmlfiles
  • sample_ckt_qx15_4_2_i.real: The ith NN complaint Quantum circuit for topology graph qx15_4_2. Saved in /genfiles/sample_ckt/real
  • i_ibm.txt: The IBM combatible netlist generated from the ith NN compliant Quantum Circuit in .real format. Saved in /genfiles/sample_ckt/netlist_ibm
  • i_fidelity.txt: Fidelity (or, succcess probability) of various mappings of the ith Quantum Circuit. Saved in /genfiles/sample_ckt/fidelity

Remarks

  • The ILP scales exponentially. Large benchmarks might take a long time (read days) to complete execution generating a single solution.
  • Usually quantum computer natively supports a set of gates (target gate library). The tool currently does not check if the input quantum circuit has other gates. Proper synthesis to target gate library must be done before invoking the tool.
  • Some of the qubit interaction graphs are directed. The ILP currently doesnt support directed graphs.

quantum-chain's People

Contributors

debjyoti0891 avatar ashsaki avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.