New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes installation instructions for circuit diagrams #65
Conversation
Don't merge this yet. I need to add some information for jupyter notebook and pdflatex being part of texlive installation. |
doc/source/installation.rst
Outdated
|
||
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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions/comments:
pdflatex
is not a separate package is it? It is part of LaTeX.- The official ImageMagick installer is not from source, it is a binary distribution.
- Let's not recommend
conda install imagemagick
. I remember neither you nor I succeeded on this, right? - We also need Ghostscript for the pdf to png conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pdflatex is not a separate package is it? It is part of LaTeX.
Yes, I haven't pushed the new changes yet. I have made a note that they should not install pdflatex
via pip. I made the mistake and I think that guy also had a similar issue.
Let's not recommend conda install imagemagick. I remember neither you nor I succeeded on this, right?
I will have to double check how it worked for me. I tried way too many things and forgot how I installed it. I think apt-get
might have worked for me.
The official ImageMagick installer is not from source, it is a binary distribution.
Thanks ! I linked the wrong page.
We also need Ghostscript for the pdf to png conversion.
I don't think I had to install it separately. I can check which package installed it as a dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I had to install it separately. I can check which package installed it as a dependency.
Ok, I remember I did apt-get ghostscript
.
I will have to double check how it worked for me. I tried way too many things and forgot how I installed it. I think apt-get might have worked for me.
Sure, just if it takes too much time, there is no need to put it on high priority. We can slowly work this out. The decomposition has higher priority ;)
Thanks for updating this guide and making the doc better!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to put it on high priority. We can slowly work this out
I have linked source installation instructions for now. We can update the instructions later about using apt-get
if someone runs into new issues.
Also, I don't think I have pdf2svg
installed. Is that an option for conversion when circuit.svg
is used instead of circuit.png
?
Co-authored-by: Boxi Li <etamin1201@gmail.com>
…ip-qip into circuit_diagram
Just a note that we're looking into rendering circuit diagrams with matplotlib (like in https://github.com/sympy/sympy/blob/46e00feeef5204d896a2fbec65390bd4145c3902/sympy/physics/quantum/circuitplot.py#L49-L288) which should remove the dependency on TeX. (Which is not to say we shouldn't merge these instructions if they're ready -- it's not entirely clear how long the matplotlib rendering will take and users of the current version might appreciate more complete instructions anyway). |
Yes, I remember the discussion from last meeting. The instructions are ready for now. |
@purva-thakre Shall we merge this or do you still have more stuff to add? |
I don't any any more new stuff to add. |
Instructions for installing circuit diagram packages on Linux have been updated.
For more information, see #60.