Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline Debugger for the Qiskit Transpiler [continued] #8

Open
TheGupta2012 opened this issue Mar 6, 2023 · 8 comments
Open

Timeline Debugger for the Qiskit Transpiler [continued] #8

TheGupta2012 opened this issue Mar 6, 2023 · 8 comments

Comments

@TheGupta2012
Copy link

Description

  • This proposal continues the Transpiler Debugger project developed during the QAMP Fall 2021.
  • Quantum transpilation deals with the problem of converting an abstract quantum circuit into a physically runnable one depending on the target quantum backend. This involves many steps such as mapping logical to physical qubits, optimizing gate chains, decomposing arbitrary unitary operations into the gate set of the target device, and many more.
  • This project makes transpilation more transparent and accessible, allows different users to open the hood of the qiskit transpiler, helps in identifying expensive gate operations, and provides error handling.
  • Present as a jupyter widget with a simple UI, it can be set up in < 5 lines of code. Other than the users of qiskit, it will be helpful for developers by allowing them to compare different optimization decisions in the transpiler architecture more efficiently.

Current State

Github : Qiskit Timeline Debugger
PyPI : qiskit-trebugger

Deliverables

Given the evolving nature of the qiskit transpiler, the aim of this project will be to extend its existing functionalities along with more robust testing. Some major features include -

  • Adding a CLI View: Since qiskit devs and many users try to use qiskit from the command line itself, adding a CLI view purely based on python will be very helpful. This would contain formatted text-based logs and circuit properties to allow users to see their circuit evolution.
  • Qubit Routing Map: Adding an evolving logical to physical qubit layout map in the visual debugger. With this, a user can see how the routing mechanisms of the transpiler work and change the mapping of the circuit as it goes through the transpilation process. Terra's plot_coupling_map and plot_circuit_layout seem like a great starting point for the same.
  • UI Testing: Frameworks like Cypress and SeleniumBase had been decided but the tests are yet to be formulated. Once added, the visual view of the debugger would be more robust.

These are the initial thoughts about the features to be added, but some more functionalities may be incorporated during QAMP.

Mentors details

Looking for mentor(s)

  • Mentor 1

    • Name: Matthew Trienish
    • GitHub ID: @mtreinish
    • What they do: Qiskit Core Developer, working closely with the transpiler team
  • Mentor 2 : TBD

Number of mentees

1

Type of mentees

I will be continuing the project as a mentee during the cohort.
GitHub : Harshit Gupta

@GemmaDawson
Copy link
Contributor

@TheGupta2012 - please confirm that this project does not require any additional mentees. I would like to mark it as paired, if that is the case 😸

@TheGupta2012
Copy link
Author

Yep, no further mentees required. Thanks!

@GemmaDawson
Copy link
Contributor

@mtreinish - please add a comment so that I may assign this issue to you 😄

@mtreinish
Copy link

Sure, feel free to assign me to the issue.

@TheGupta2012
Copy link
Author

Hey @GemmaDawson , here are the slides for checkpoint 1 -
QAMP Spring 2023 Qiskit Trebugger Checkpoint 1.pdf

@TheGupta2012
Copy link
Author

TheGupta2012 commented May 18, 2023

Also, please find attached below the current design for our CLI Vew (changes imminent!) 😺

image

@GemmaDawson GemmaDawson moved this to Checkpoint 1 Submitted in QAMP Spring 23 May 22, 2023
@TheGupta2012
Copy link
Author

TheGupta2012 commented Jun 5, 2023

Checkpoint 2 - June 2023

Updates

  1. Since the last checkpoint, the design of the CLI view of the debugger has been completed. This includes the addition of horizontal scrolling, squashing bugs in the resizing of the view, and incorporating logs and property sets of each transpilation pass in our design.
  2. Moving ahead from the prototyping phase, the first iteration of the design has been developed. The changes include updating the existing code of the original debugger, modularising the prototype code into separate classes, and integrating the transpiler data model with the new CLI view. The latest commit in repo reflects the same.
  3. The new CLI view has been introduced with a parameter view_type in the debugger's debug method.
  4. Some performance improvements were introduced -
    • Screen refreshing is now being done only once after updating the data structures of each screen component. This reduced screen flicker and optimized scrolling. This was achieved using the noutrefresh and doupdate methods of the curses module.
    • Each transpilation pass is loaded lazily thereby improving the performance of the debugger.

The CLI View of the Debugger

1. Main Panel

Displays an overview of all the transpiler passes executed by the PassManager. Contains the name, runtime, and other important information about circuit statistics

image

2. General Information

Parameters of transpilation such as optimization level, terra version, and backend info

image

3. Overview Window

Overview of the transpilation process with initial and final states of circuit properties

image

4. Pass Panel

Users can index into specific passes by pressing I and then entering the pass index. The view renders information about the pass such as docs, circuit stats, circuit diagrams, logs, and current property set. Navigation is possible between passes by using the N/P keys for next or previous passes

image

image

5. Full Working

debugger cli iteration 1

@GemmaDawson GemmaDawson moved this from Checkpoint 1 Submitted to Checkpoint 2 Submitted in QAMP Spring 23 Jun 30, 2023
@GemmaDawson GemmaDawson moved this from Checkpoint 2 Submitted to Final Showcase Submitted in QAMP Spring 23 Jul 11, 2023
@TheGupta2012
Copy link
Author

Here are the final slides for the project :
Qiskit Trebugger - Final Checkpoint - QAMP Spring '23.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Final Showcase Submitted
Development

No branches or pull requests

4 participants