Skip to content

Commit

Permalink
updates installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre committed Jun 21, 2021
1 parent b57fa16 commit 78e2e08
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
27 changes: 18 additions & 9 deletions doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,36 @@ In addition
are used to build and test the documentation.

.. _circuit_plot_packages:

Plotting Circuits
------------------
In order to plot circuits, following packages are needed.
In order to plot circuits, following packages are needed - ``LaTex``, ``ImageMagick``,
``QCircuit``, ``pdfcrop`` and ``pdflatex``.

``texlive`` is one of the packages that could be installed for `LaTeX`.
**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.

.. code-block::
* ``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.

apt-get texlive texlive-latex-base texlive-latex-recommended texlive-latex-extra
``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.


``ImageMagick`` is needed to display the circuit diagrams. The installation
instructions are available `here <https://github.com/conda-forge/imagemagick-feedstock#installing-imagemagick>`_.
You `might need to make changes <https://stackoverflow.com/a/52863413/10241324>`_ to ``policy.xml`` if following error occurs :

You `might need <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.>`_ to make changes to ``policy.xml`` if following error occurs :
.. code-block:: text
.. code-block::
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:

Install qutip-qip from source code
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 78e2e08

Please sign in to comment.