diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 11a5d316b..85c01d7d4 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -47,7 +47,35 @@ In addition are used to build and test the documentation. -A few other packages such as LaTeX is used for circuit plotting, please refer to the main documentation section for detailed instruction. +.. _circuit_plot_packages: + +Plotting Circuits +------------------ +In order to plot circuits, following packages are needed - ``LaTex``, ``ImageMagick``, +``QCircuit``, ``pdfcrop`` and ``pdflatex``. + +**For Linux** : If you would prefer to avoid installing the full ``texlive`` +package for ``LaTex``, `this link has `_ +some useful discussion on selectively installing smaller packages. ``LaTex`` is needed +to plot the circuits. + +* ``braket`` will be installed as a part of ``texlive-latex-extra`` +* ``qcircuit`` will be installed as a part of ``texlive-pictures`` +* ``pdfcrop`` and ``pdflatex`` are installed when a minimal ``texlive`` is installed. + +``ImageMagick`` can be installed as a conda package via `this link `_ +or use this `link `_ to install +via source. This package along with ``pdfcrop`` and ``pdflatex`` are +needed to display the circuit diagrams. + + +You `might need to make changes `_ to ``policy.xml`` if following error occurs : + +.. code-block:: text + + RuntimeError: convert-im6.q16: not authorized `qcirc.pdf' @ error/constitute.c/ReadImage/412. + convert-im6.q16: no images defined `qcirc.png' @ error/convert.c/ConvertImageCommand/3258. + .. _installation: diff --git a/doc/source/qip-basics.rst b/doc/source/qip-basics.rst index aac62a28e..e7297ccad 100644 --- a/doc/source/qip-basics.rst +++ b/doc/source/qip-basics.rst @@ -290,6 +290,9 @@ produces the pdf and converts it to the png format. On Mac and Linux, ImageMagick can be easily installed with the command conda install imagemagick if you have conda installed. Otherwise, please follow the installation instructions on the ImageMagick documentation. +More information related to installing these packages is also available in the +installation guide (:ref:`circuit_plot_packages`). + On windows, you need to download and install ImageMagick installer. In addition, you also need perl (for ``pdfcrop``) and Ghostscript (additional dependency of ImageMagick for png conversion).