Package: qiskit-trebugger
Qiskit TrebuggerA new take on debuggers for quantum transpilers.
This repository presents a debugger for theqiskit transpilerin the form of a light weight jupyter widget. Built as a project for the Qiskit Advocate Mentorship Program, Fall 2021.InstallationTo install the debugger using pip (a python package manager), use -pipinstallqiskit-trebuggerPIP will handle the dependencies required for the package automatically and would install the latest version.To directly install via github follow the steps below after usinggit clone:gitclonehttps://github.com/TheGupta2012/qiskit-timeline-debugger.gitMake surepython3andpipare installed in your system. It is recommended to use a python virtual environment to install and develop the debuggercdinto theqiskit-timeline-debuggerdirectoryUsepip install -r requirements.txtto install the project dependenciesNext, executepip install .command to install the debuggerUsage InstructionsAfter installing the package, import theDebuggerinstance fromqiskit_trebuggerpackage.To run the debugger, simply replace the call totranspile()method of the qiskit module withdebug()method of your debugger instance.The debugger provides two types of views namelyjupyterandcliThecliview is the default view and recommender for users who want to use the debugger in a terminal environmentThejupyterview is recommended for usage in a jupyter notebook and provides a more interactive and detailed view of the transpilation process.For an example -fromqiskit.providers.fake_providerimportFakeCasablancafromqiskit.circuit.randomimportrandom_circuitfromqiskit_trebuggerimportDebuggerimportwarningswarnings.simplefilter('ignore')debugger=Debugger(view_type="jupyter")backend=FakeCasablanca()circuit=random_circuit(num_qubits=4,depth=5,seed=44)# replace transpile calldebugger.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 depthWith 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 Highlightsjupyterview1. Circuit EvolutionSee your circuit changing while going through the transpilation process for a target quantum processor.A new custom feature enablingvisual diffsfor quantum circuits, allows you to see what exactly changed in your circuit using the matplotlib drawer of the qiskit module.ExampleCircuit 1Circuit 22. Circuit statisticsAllows 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 setsEasily parse actions of the transpiler with logs emitted by each of its constituent passes and changes to the property set during transpilationEvery log record is color coded according to the level of severity i.e.DEBUG,INFO,WARNINGandCRITICAL.cliview1. Transpilation Summary and StatisticsA quick summary of the transpilation process for a given circuit.Faster access to information in the CLI view.2. Keyboard ShortcutsThe CLI view provides keyboard shortcuts for easy navigation and access to transpiler information.Aninteractive status barat the bottom of the screen provides information about the current state of the debugger.3. Transpiler Logs and Property setsEmits transpiler logs associated with each of the transpiler passes.Highlights addition to property set and its changes during the transpilation process.Demonstration and BlogHere is ademonstration of TreBuggeras a part of the final showcase for the Qiskit Advocate Mentorship Program, Fall 2021.You can also read about some more details of our project in theQiskit medium blogContributorsAboulkhair FodaHarshit Gupta