rigetti / pyquil

A Python library for quantum programming using Quil.
http://docs.rigetti.com
Apache License 2.0
1.4k stars 342 forks source link

Generating the symbolic representation of a circuit #1444

Open BoltzmannEntropy opened 2 years ago

BoltzmannEntropy commented 2 years ago

Hello, I would like to program a circuit and then, print it's symbolic representation much like Mathematica / SymPy Quantum. For instance:

image

Or:

image

Is that possible?

BoltzmannEntropy commented 2 years ago

Anyone ...?

genos commented 2 years ago

It's not as well documented as it used to be, but the pyquil.latex section could be useful.

Note the warning:

For this to work, you need two external programs, pdflatex and convert, to be installed and accessible via your shell path.

Further, your LaTeX installation should include class and style files for standalone, geometry, tikz, and quantikz. If it does not, you need to install these yourself.

BoltzmannEntropy commented 2 years ago

Thanks @genos but that is not was I was asking for ... I don't need to plot the circuit in LaTeX, I want a symbolic representation just like the example I provided:

image
genos commented 2 years ago

Sorry, @BoltzmannEntropy! I was confused by the circuit diagram in the “or” section of your note.