18
$\begingroup$

What tools exist for creating quantum circuit diagrams and exporting them as images? Preferably one which runs in Windows, or even better one which runs in the web browser.

$\endgroup$
1

6 Answers 6

19
$\begingroup$

Depending on how involved your circuit is you could use

  • Quantikz (written by @DaftWullie I believe)

or

  • Q-circuit by Bryan Eastin and Steve Flammia.

These are tools to make circuit diagrams in TeX for papers and the like, but you can always make your TeX file just the circuit you want and save it as a pdf. Making complex and incredibly long circuits might be a bit of a hassle and would be better done in an automated tool like the one posted by Davide_sd.

$\endgroup$
3
  • 1
    $\begingroup$ And remember that adobe reader has a snapshot option so you can easily convert it into an image. $\endgroup$
    – DaftWullie
    Oct 31, 2018 at 5:58
  • 1
    $\begingroup$ It’s probably not fair to call qcircuit a predecessor as that sort of implies that quantikz is the newer, updated version. While it is newer, and mirrors much of the functionality, the two things are entirely independent. $\endgroup$
    – DaftWullie
    Oct 31, 2018 at 6:11
  • $\begingroup$ Thats fair! I'll take that like out. $\endgroup$ Oct 31, 2018 at 17:20
8
$\begingroup$

I'm new to the quantum world as well, but so far I've been able to draw my basic simple circuits with Qasm2Circ. It requires:

  • latex2e with xypic (included in tetex)
  • python version 2.3 or greater
  • ghostscript (and epstopdf) (for creation of pdfs)
  • netpbm (for creation of png files)

Hopefully, somebody will be able to list other tools.

$\endgroup$
3
  • $\begingroup$ Do you use this in Windows? $\endgroup$
    – ahelwer
    Oct 30, 2018 at 19:51
  • $\begingroup$ No, I'm using it on Ubuntu. Although, it seems there exist a version for Windows too, check out this Github repo. $\endgroup$
    – Davide_sd
    Oct 30, 2018 at 19:54
  • 1
    $\begingroup$ If you use miktex on windows for doing the latex, then one of the tools it comes with (although you need to know to look for it) is bmeps which you can use for crating image files $\endgroup$
    – DaftWullie
    Oct 31, 2018 at 6:01
8
$\begingroup$

[...] quantum circuit diagrams [...] even better one which runs in the web browser.

Quirk (algassert.com/quirk) runs in browsers and can be used to create simple circuit diagrams. I use it for this purpose all of the time, though it's main purpose is to simulate circuits.

Just drag the gates you want into the circuit, perhaps use the simulation results to check that everything is behaving correctly, and then take a screenshot with e.g. Windows' Snipping Tool. Most browsers also have an option to turn a canvas into an image (e.g. in firefox if you right-click on the circuit you can select 'view image' that you can then download and crop). You can bookmark the circuit to come back to it later, in case you make a small mistake.

The main downside of this approach is a) it requires manual work every time, b) it produces bitmap images instead of vector images, and c) it is somewhat inflexible (e.g. you can't put operations with different controls into the same column).

Example:

It's a mystery

$\endgroup$
7
$\begingroup$
  1. Master of Science degree project developed by Joanna Patrzyk and Bartłomiej Patrzyk at AGH UST in Cracow.

http://www.quide.eu/

It can simulate designed circuits by generating simulator code in C#. Runs under Windows. Available under GPLv3.

  1. IBM Quantum Experience. Its interface runs in web browser.

https://quantumexperience.ng.bluemix.net/qx/editor

It can run on "real" quantum computer. Available for research purposes only.
Here is the agreement: https://quantumexperience.ng.bluemix.net/qx/terms
And user guide: https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=full-user-guide&page=introduction

$\endgroup$
4
$\begingroup$

For drawing in your browser, there is a demo of the Quantikz.jl package you can use:

A quantikz example

Various programming languages have their own circuit drawing libraries as well. For latex code probably the best choice is Quantikz, and if you are programming in Julia you can create a diagram (png or latex code) with the Quantikz.jl library.

$\endgroup$
3
$\begingroup$

One of the best tools to use is the "Quantum Computing" package in Mathematica: http://homepage.cem.itesm.mx/jose.luis.gomez/quantum/

Here you can just input all the useful gates directly and also completely manipulate the Circuits in a complete GUI interface. Screenshot is taken from Gomez's webpage

Moreover, you can also perform all the desired operations over qubits.

$\endgroup$
2
  • $\begingroup$ You're using Version 7? Does it have any problems with newer versions? $\endgroup$
    – AHusain
    Nov 4, 2018 at 13:47
  • $\begingroup$ No, this is an old screenshot. I am using Mathematica 11.3 with this package and it works perfectly without any clash. $\endgroup$ Nov 4, 2018 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.