I followed this manual in order to visualize my QISKit v0.4.8 quantum circuit by means of the latex_drawer()
function (in newer versions of QISKit the function is circuit_drawer()
). However, I got the following error when running the code:
! LaTeX Error: File `qcircuit.sty' not found.
Is qcircuit.sty
a part of QISKit? What is the best way to fix the issue?
By the way, this is the function that I use to produce the image of a circuit:
def circuit_image(circuit, basis="u1,u2,u3,cx"):
filename = 'circuit'
tmpdir = 'tmp'
if not os.path.exists(tmpdir):
os.makedirs(tmpdir)
filename_tex = filename + ".tex"
filename_pdf = filename + ".pdf"
latex_drawer(circuit, os.path.join(tmpdir, filename_tex), basis=basis)
os.system("pdflatex -output-directory {} {}".format(tmpdir, filename_tex))
images = pdf2image.convert_from_path(os.path.join(tmpdir, filename_pdf))
shutil.rmtree(tmpdir)
return images[0]