Adding a "no-inline" option to Qiskit transpiler
nelimee opened this issue · comments
Description
Qiskit QuantumCircuit
is able to represent the concept of subroutines (represented with instances of Instruction
), i.e., a re-usable piece of code that implements a function. But Qiskit transpiler and most of its passes are not made to work on such a hierarchical structure, which is why all the preset levels of optimisation start by unrolling the instruction definitions in order to obtain a "flat" quantum circuit. Classical compilers are also performing "unrolling" (called inlining in the classical context) but only on some cases where not inlining would actually hit performance badly.
The benefits of having a transpiler capable of working on the hierarchical structure composed of QuantumCircuit
and Instruction
are multiple:
- It may significantly speed-up Qiskit transpiler on large quantum circuits.
- It may help debugging and profiling transpiled quantum circuits more efficiently.
- As a nice side-effect, it will make it easier to adapt the transpiler to classical-feedback structures such as ifs and for loops.
Deliverables
This is a significant work that will probably require a lot of feedback. As such, here is a list of potential deliverable in increasing level of difficulty/work needed. The expected deliverable(s) will depend on the number and profiles of mentees.
- Prepare a written document summarising the changes that would be needed to the current code base to introduce the "no-inline" feature.
- Fork Qiskit transpiler (qiskit-terra) and provide a proof-of-concept of a transpiler able to transpile
QuantumCircuit
instances containing classical-feedback features. - Fork Qiskit transpiler (qiskit-terra) and provide a proof-of-concept of a transpiler able to transpile
QuantumCircuit
instances containing classical-feedback features and that does not systematically unroll the subroutines found in the circuit. - Introduce an option to let the transpiler optimise gates at the interface of different subroutines.
Mentors details
- Mentor 1
- Name: Adrien Suau
- GitHub ID: @nelimee
- Qiskit Slack ID: @ad_su
- What they do: Last year PhD student in quantum computing and its applications to scientific computing.
Number of mentees
2
Type of mentees
As this is my first experience being a QAMP mentor I feel like 2 mentees maximum would be nice. Nevertheless, if 3 people are very interested in this I might be OK to mentor 3 people, depending on the mentees and the amount of time I will be able to dedicate to this session of QAMP.
- Mentees
- Required:
- Good to very good knowledge of Python 3.
- Good knowledge of Qiskit.
- Nice to have:
- Experience with Qiskit internals.
- Knowledge about Qiskit transpiler internals.
- Prior experience developing something in Qiskit transpiler.
- Required:
Hi @nelimee I am interested in working on this project, I am working as a Quantum Researcher at Deloitte, and I have experience in using Qiskit as well. This will be a good experience for me. Let me know if we can connect on Slack to discuss more.
I’m mentee of this project !
@GemmaDawson Please assign me. I'm Juon Kim (the mentee of this project !)
@GemmaDawson Can you assign me again? I removed it for mistake
Please add your Checkpoint 1 presentation materials.
@nelimee you still need to upload your image.
@rkfqns13 & @Pranshi24 - please upload your Final Showcase presentation materials, and if needed, update the project Title and/or description.
Congratulations on completing all the requirements for QAMP Fall 2022!! 🌟🌟🌟