Initiation of the project
qprof idea came just after the implementation of the quantum wave equation solver using QatHS, when I reached the optimisation step. Once again the issue was the lack of proper tooling around quantum computing frameworks: I wanted to optimise my implementation, but no tool I was aware of was capable of analysing the quantum circuits I generated and to give me the numbers I want.
Goal of the project
The target of this project was to produce a
gprof-compatible tool: a program that would analyse quantum circuits and output a summary in the exact same format as
The constraint on the output format (that should be exactly the same as
gprof) was motivated by several points:
gprofis nearly 40 years old and is still recognised as one of the standard tools to profile code nowadays. As such, I came to the conclusion that its output format should be the result of many years of polishing and is probably a good starting point.
- There exist a plethora of tools that plug themselves to
gprofpost-processing its output. I was mostly looking at the excellent
gprof2dottool that generates a
gprofoutput. Having an output format compatible with
gprofmade the usage of all these tools possible and easy.
Conclusion of the project
I am still working on this project actively. It has already been tested on a big implementation involving a lot of nested calls: QatHS. The results are already quite nice as you can see on the following call graphs, generated with
Graphviz' dot tool using quantum circuits from
The next step will be to update the existing (but not published)
qiskit plugin for
qprof. This will allow
qprof to analyse quantum circuits implemented with
Thanks to its modular implementation,
qprof should be trivial to extend to any library using the quantum circuit model.