Code Monkey home page Code Monkey logo

qiskit-timeline-debugger's Introduction

Qiskit Trebugger

A new take on debuggers for quantum transpilers. This repository presents a debugger for the qiskit transpiler in the form of a light weight jupyter widget. Built as a project for the Qiskit Advocate Mentorship Program, Fall 2021.

Installation

  1. To install the debugger using pip (a python package manager), use -
pip install -i https://test.pypi.org/simple/ --extra-index https://pypi.org/simple/ qiskit-trebugger
  • PIP will handle the dependencies required for the package automatically and would install the latest version.
  • Currently the project is hosted as a test package and would be hosted on the real index when tests are added.
  1. To directly install via github follow the steps below after using git clone:
git clone https://github.com/TheGupta2012/qiskit-timeline-debugger.git
  • Make sure python3 and pip are installed in your system
  • Use pip install -r requirements to install the debugger dependencies
  • Note : with this method, you can only use the debugger in the installed directory

Usage Instructions

  • After installing the package, import the Debugger instance from qiskit_trebugger package.
  • To run the debugger, simply replace the call to transpile() method of the qiskit module with debug() method of your debugger instance. For an example -
from qiskit import QuantumCircuit
from qiskit.test.mock import FakeCasablanca
from qiskit_trebugger import Debugger

debugger = Debugger()
backend = FakeCasablanca()
circuit = QuantumCircuit(3)
circuit.h(0)
circuit.cx(0,1)
circuit.cx(1,2)
circuit.measure_all()
# replace transpile call 
debugger.debug(circuit, backend = backend)
  • On calling the debug method, a new jupyter widget is displayed providing a complete summary and details of the transpilation process for circuits of < 2000 depth
  • With an easy to use and responsive interface, users can quickly see which transpiler passes ran when, how they changed the quantum circuit and what exactly changed.

Feature Highlights

1. Circuit Evolution

  • See your circuit changing while going through the transpilation process for a target quantum processor.
  • A new custom feature enabling visual diffs for quantum circuits, allows you to see what exactly changed in your circuit using the matplotlib drawer of the qiskit module.

Example

  • Circuit 1

  • Circuit 2

2. Circuit statistics

  • Allows users to quickly scan through how the major properties of a circuit transform during each transpilation pass.
  • Helps to quickly isolate the passes which were responsible for the major changes in the resultant circuit.

3. Transpiler Logs and Property sets

  • Easily parse actions of the transpiler with logs emitted by each of its constituent passes and changes to the property set during transpilation
  • Every log record is color coded according to the level of severity i.e. DEBUG, INFO, WARNING and CRITICAL.

Demo Video

  • Please follow [this](to be added) link for a demonstration of our project.

Contributors

qiskit-timeline-debugger's People

Contributors

thegupta2012 avatar kdk 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.