Skip to main content

A timeline debugger for the qiskit transpiler

Project description

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.test.mock import FakeCasablanca
from qiskit.circuit.random import random_circuit 
from qiskit_trebugger import Debugger
import warnings

warnings.simplefilter('ignore')
debugger = Debugger()
backend = FakeCasablanca()
circuit = random_circuit(num_qubits = 4, depth = 5 , seed = 44)
# replace transpile call 
debugger.debug(circuit, optimization_level = 2, backend = backend, initial_layout = list(range(4)))
  • 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.

Demonstration and Blog

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qiskit_trebugger-1.0.0.tar.gz (74.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qiskit_trebugger-1.0.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

Details for the file qiskit_trebugger-1.0.0.tar.gz.

File metadata

  • Download URL: qiskit_trebugger-1.0.0.tar.gz
  • Upload date:
  • Size: 74.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for qiskit_trebugger-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c213dbc1aecd32e1671f0d80d80dfcf1521e3de3b9e8afa9a43ed737e233094d
MD5 29cd5fb5d565c4ff6ef5898a024e2df6
BLAKE2b-256 3ae62a8e12390b6d55737df41c502be5087e0894a5347f1abb683e5cfb7665d1

See more details on using hashes here.

File details

Details for the file qiskit_trebugger-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_trebugger-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca78d617296d14c27adf2ab5879ee564829eb675f2ff1f7a00b9d74e6a42fdf5
MD5 a04a304efece07b247fa5a9ce05b1a0a
BLAKE2b-256 9c67356d67af81f9cdb793daaa506407b6d8032138b6727090643a200ad77b9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page