Strilanc / Quirk

A drag-and-drop quantum circuit simulator that runs in your browser. A toy for exploring and understanding small quantum circuits.
http://algassert.com/quirk
Apache License 2.0
922 stars 157 forks source link

Export to LaTeX #486

Closed ShawnGeller closed 2 years ago

ShawnGeller commented 2 years ago

I know that this isn't really crucial to the goal of the project, but it would be nice to have an export to LaTeX using e.g. https://github.com/CQuIC/qcircuit/, as quirk is also a very nice drawing tool.

Strilanc commented 2 years ago

Personally I just take screenshots and put those in my papers. To do better than that, it would be necessary to produce vector graphics like SVG, but in my experience SVGs that have the number of lines and curves that appear in a medium sized Quirk display would grind most pdf readers to a halt. Also, having a whole separate render path with different aesthetic expectations (e.g. papers tend to be less colorful) is a lot of work!

An alternative workaround would be to use a tool that can import quirk URLs and export latex (such as Cirq).

This is a good suggestion, but it's a lot of work for not much marginal gain. So I'm going to close this as "I'm just never gonna get around to it".

ShawnGeller commented 2 years ago

Thanks for the Cirq suggestion, I didn't know about it! I wrote a tiny python script that does this workaround.

akirakyle commented 2 years ago

Something like canvas2svg might be a relatively easy way to do this?