Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add quantikz circuit plotting #714

Merged
merged 13 commits into from
Sep 2, 2021

Conversation

braised-babbage
Copy link
Contributor

@braised-babbage braised-babbage commented Jun 2, 2021

This adds rudimentary plotting via LaTeX + Quantikz, usable a few ways. For example, in a Jupyter notebook

plot-circuit-example

or in a SLIME session
plot-circuit-slime

Backends

In general, we always convert the instructions of a parsed program to a diagram, which is basically just a set of lists corresponding to operations on qubit lines, and then emit this as latex source.

What happens next depends on the choice of "backend", cf. methods on the RENDER generic. We currently have three

See src/tools/README.md for installation details.

@braised-babbage
Copy link
Contributor Author

FWIW this implementation is heavily inspired by the pyquil version I wrote in 2019. Perhaps I should make a note about that somewhere...

@colescott
Copy link
Member

Looks great!

Are there any plans to have multiple frontends for this (e.g. slime using something like this)?
If not I am happy to draft up a quick PR for that.

@braised-babbage
Copy link
Contributor Author

Looks great!

Are there any plans to have multiple frontends for this (e.g. slime using something like this)?
If not I am happy to draft up a quick PR for that.

Good question -- I'm still slowly but surely iterating on the features for this, but will take at the possibility of multiple render targets.

@braised-babbage braised-babbage marked this pull request as ready for review September 1, 2021 23:31
@stylewarning stylewarning merged commit 9eb4e9d into quil-lang:master Sep 2, 2021
@stylewarning
Copy link
Member

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants