Skip to main content

Qiskit Trebugger

Unitary Fund

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 qiskit-trebugger

PIP will handle the dependencies required for the package automatically and would install the latest version.

  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. It is recommended to use a python virtual environment to install and develop the debugger
  • cd into the qiskit-timeline-debugger directory
  • Use pip install -r requirements.txt to install the project dependencies
  • Next, execute pip install . command to install the debugger

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.
  • The debugger provides two types of views namely jupyter and cli
  • The cli view is the default view and recommender for users who want to use the debugger in a terminal environment
  • The jupyter view is recommended for usage in a jupyter notebook and provides a more interactive and detailed view of the transpilation process.
  • For an example -
from qiskit.providers.fake_provider import FakeCasablanca
from qiskit.circuit.random import random_circuit 
from qiskit_trebugger import Debugger
import warnings

warnings.simplefilter('ignore')
debugger = Debugger(view_type = "jupyter")
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

jupyter view

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.

cli view

1. Transpilation Summary and Statistics

  • A quick summary of the transpilation process for a given circuit.
  • Faster access to information in the CLI view.

2. Keyboard Shortcuts

  • The CLI view provides keyboard shortcuts for easy navigation and access to transpiler information.
  • An interactive status bar at the bottom of the screen provides information about the current state of the debugger.

3. Transpiler Logs and Property sets

  • Emits transpiler logs associated with each of the transpiler passes.
  • Highlights addition to property set and its changes during the transpilation process.

Demonstration and Blog

Contributors

Metadata

Release files for qiskit-trebugger 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qiskit-trebugger 1.1.2
File Size Uploaded
qiskit_trebugger-1.1.2.tar.gz 17.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for qiskit-trebugger 1.1.2
File Interpreter ABI Platform
qiskit_trebugger-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 MB

Release files / qiskit_trebugger-1.1.2.tar.gz

Download URL qiskit_trebugger-1.1.2.tar.gz
Size 17.9 MB
Tags Source
SHA-256 checksum
How to use checksums
73bc48a327168d2bbd2d5661c33d4bac2b26bcb3210a38d61e36fb918a705e8e
BLAKE2b-256 checksum
How to use checksums
a6548897a3fcf75d8ad585fe618c4314ca1a2faf5eb0f4777de32b91f6023a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / qiskit_trebugger-1.1.2-py3-none-any.whl

Download URL qiskit_trebugger-1.1.2-py3-none-any.whl
Size 65.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bb13f486d476f3b6db6084463115acddcd4b6e6f557e4c0b8dba792bada2a0b
BLAKE2b-256 checksum
How to use checksums
1b4815e9501e4e809f9801105628ba0b4c657b0f2db6787aa87355f0c63f6f54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page