Skip to the content.

QAMP Spring 2022 Transpiler Hackathon

Our Qiskit Advocate Mentorship Project for Spring, 2022 is a Transpiler Hackathon.

Our Github organization is here.

View this document formatted on GitHub Pages

Table of Contents

TOC created by gh-md-toc

Our team (listed in alphabetical order by last name):

Vishnu Ajith

Harshit Gupta

Pulkit Sinha

Oskar Słowik

Jack Woehr (mentor)

Blog

2022-06-13

QAMP Spring 2022 final presentation video

2022-05-05

QAMP Spring 2022 Checkpoint Presentation #2

2022-04-28

In attendance Harshit Gupta, Oskar Słowik, Jack Woehr, Matthew Treinish

Progress

Tasks

General

2022-04-11

In attendance Harshit Gupta, Oskar Słowik, Jack Woehr

Progress

PR 7193 for 7181 - Harshit submitted substantial improvements PR 7875 for 7296 - Harshit submitted … work in progress …add Gate attribute qubit_symmetric 7113 .. if PR 7193 gets accepted would simplify tackling 7113. 7705 .. Oscar benchmarking 7485 .. BasisTranslator taking up to 1G of memory … attractive and substantial issue because level 1,2,3 all use BasisTranslator

Tasks

2022-04-07 QAMP Spring 2022 Checkpoint #1

Our Checkpoint #1 presentation PDF

2022-04-04

In attendance Harshit Gupta, Oskar Słowik, Jack Woehr

Presentation

Issues

2022-03-28

In attendance Vishnu Ajith, Harshit Gupta, Oskar Słowik, Jack Woehr

Discussion

We discussed an apparent anomaly in DAG generation as exemplified by Harshit’s example:

from qiskit.converters import circuit_to_dag
from qiskit import QuantumCircuit
from qiskit.circuit import QuantumRegister, ClassicalRegister
from qiskit.visualization import dag_drawer

qr = QuantumRegister(3)
cr = ClassicalRegister(3)
circ_reg = QuantumCircuit(qr, cr)
circ_reg.h(qr[0])
circ_reg.h(qr[1])
circ_reg.measure(qr[0], cr[0])
circ_reg.measure(qr[1], cr[1])
circ_reg.x(qr[0]).c_if(cr, 0x3)
circ_reg.measure(qr[0], cr[0])
circ_reg.measure(qr[1], cr[1])
circ_reg.measure(qr[2], cr[2])

# direct
circ_no_reg = QuantumCircuit(3, 3)
circ_no_reg.h([0, 1])
circ_no_reg.measure([0, 1, 2], [0, 1, 2])
circ_no_reg.x(0).c_if(circ_no_reg.cregs[0], 0x3)
circ_no_reg.measure([0, 1], [0, 1])

# print("Circuit is :", circ_no_reg.draw())

dag_in = circuit_to_dag(circ_no_reg)
dag_in_reg = circuit_to_dag(circ_reg)

dag_drawer(dag_in, scale=0.7, filename="dag_in_no_reg.png")
dag_drawer(dag_in_reg, scale=0.7, filename="dag_in_with_reg.png")

The circuits are semantically equivalent but draw quite different DAGs. Harshit will run this by Matthew Treinish.

Agenda / Tasks

2022-03-24

In attendance Harshit Gupta, Pulkit Sinha, Jack Woehr

Agenda for this week

Focus on parallelization / depth reduction pass

There are promising heuristic strategies but not all guarantee either a solution nor an optimal solution.

Create transpiler pass DagDependencyReducer which will wrapper 3 algorithms

  1. GlobalMaxDAGDepthReducer
  2. InteractiveDAGDepthReducer
  3. IterativeDAGDepthReducer

The 3 algorithms will be coded (at first) in individual files. The question arose in the discussion whether the team should present 3 separate PRs for the 3 algorithms. We decided that we should submit as one PR and let the IBM engineers decide how to mix and match.

PR development layout

  1. Create local branch dagdependencyreducer
  2. Check in an empty Transpiler pass as dagdependencyreducer.py
  3. Push branch to our fork.
  4. Team clones our qiskit-terra fork.
  5. Team does git fetch then git checkout dagdependencyreducer
  6. From the dagdependencyreducer branch, create sub-branches of the branch as follows:
  7. git checkout -b GlobalMaxDAGDepthReducer
  8. git push -u origin GlobalMaxDAGDepthReducer
  9. Repeat from dagdependencyreducer branch for InteractiveDAGDepthReducer and IterativeDAGDepthReducer

As work progresses on individual sub-branches, the team can:

Continue development …

Tasks

  1. Incorporate qubit args in the GlobalMaxDAGDepthReducer (Harshit)
  2. Write basic code for InteractiveDAGDepthReducer and IterativeDAGDepthReducer (Pulkit)

2022-03-14

Our team met today with Kevin Krsulich of the IBM Q team to examine promising transpiler issues to address. Two major issues that came up in discussion are:

Additionally, team member Harshit Gupta is currently finishing up work he previously undertook on the following to issues:

For this coming week, the team is going to all work together on finishing up issue 7387 (“better convergence”) with Harshit, in part, to become oriented in the transpiler. Then we will proceed to one of the major issues, either dividing into two groups to address both 7705 and 7113, or working together on one or both of those issues.

Our team may also undertake inter alia to address a few smaller issues that can more easily be closed. Jack Woehr will sift through the transpiler issues for smaller issues.

2022-03-04:

Our team of Harshit Gupta, Vishnu Ajith, Oskar Słowik, and Jack Woehr met today via Zoom. We discussed the following points

A blue-sky thought about Optimization

Project plan

First step

Matthew Treinish requests that the team help out with #7113 Add support for BackendV2 and Target to transpiler