Quantikz.jl for drawing quantum circuit diagrams with Julia

quantikz is a great latex package for drawing quantum circuits. I have just released a small Julia package Quantikz.jl which harnesses quantikz to programmatically create circuit diagrams. If pdflatex is installed on your system, the diagrams can be viewed directly from the terminal or notebook.

You can see a small examples notebook for details.

The majority of the functionality is already implemented, but I could use some help in ensuring the package works on diverse systems (and has fallbacks if pdflatex is not available).

This is what its usage looks like:
image

The package is easy to use from inside of other quantum specific packages. The original reason for the creation of this package was the need to draw diagrams in my Clifford Circuit simulator QuantumClifford.jl. I will be making a real announcement about that much more interesting package soon.

7 Likes

Very cool! You may be interested in https://github.com/QuantumBFS/YaoPlots.jl if you’re not aware of it.

1 Like

Thanks, Mason! YaoPlots seems pretty difficult to find on google/duckduckgo, hence me not even knowing about it. Could you elaborate on how tightly it is coupled to Yao (how easy it is to use without knowing anything about Yao)?

I don’t actually know very much about Yao, and even less about YaoPlots. Perhaps @Roger-luo can comment.

It’s based on the pure Julia implementation of plotting package Compose.jl. The benefits of using Compose is everything is handled by Julia side and no need to configure LaTeX. Thus it works for all Julia development environments such as Pluto and vscode in RAM.

The Quantum Block IR is the basic foundation in Yao ecosystem it should be easy to understand. It provides a more composable way to define circuits. YaoPlots visualize this representation as well as ZX diagrams.

I see this as a good alternative since the quality of quantikz is quite good especially for publishing as long as the extra dependency is well handled, since users will need to configure tex if they want to use quantikz and it may be less interactive since there’s a layer of TeX.


I’d hope to have a common representation for circuits so write once run everywhere, e.g one can develop things using the Compose.jl backend and publish the results by generating quantikz. Would be nice if we can join effort on this.

we didn’t announce this package yet since it’s still at early stage so we hope to use it in a small group of users first so that we can bring this more mature stage. In principal all the packages start with Yao are intended to be included in the meta package Yao.jl when they are mature.

2 Likes

Thanks for the details! I have now added YaoPlots to the readme at https://github.com/Krastanov/Quantikz
Let me know if you feel the description is imprecise.

1 Like

thanks for mentioning it! I’d be interested to compile our representation to Quantikz’s IR to get publish quality plotting in TeX at some point too, so we don’t need to define circuits in separate places.

2 Likes