Skip to content

Commit

Permalink
Merge 78e2e08 into 6cc9539
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre committed Jun 21, 2021
2 parents 6cc9539 + 78e2e08 commit 776d497
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 29 additions & 1 deletion doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://tex.stackexchange.com/a/504566/203959>`_
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 <https://github.com/conda-forge/imagemagick-feedstock#installing-imagemagick>`_
or use this `link <https://imagemagick.org/script/download.php>`_ to install
via source. This package along with ``pdfcrop`` and ``pdflatex`` are
needed to display the circuit diagrams.


You `might need to make changes <https://stackoverflow.com/a/52863413/10241324>`_ 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:

Expand Down
3 changes: 3 additions & 0 deletions doc/source/qip-basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 776d497

Please sign in to comment.