How to generate quantum circuit drawing?

136 views
Skip to first unread message

Farooq Khaleel

unread,
Jun 21, 2021, 2:48:29 AM6/21/21
to QuTiP: Quantum Toolbox in Python
Dear Respected Members of the Group,
I hope you are doing well.
I am trying to reproduce the results of the following post:


in windows 10 environment and with Imagemagick, perl, Ghostscript and Latex are all installed and verified.
However, it seems like it cant generate the qcirc.pdf file. I receive the following error,

Warning (from warnings module):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\qutip_qip\circuit_latex.py", line 128
    warnings.warn("Could not locate system 'pdfcrop':"
UserWarning: Could not locate system 'pdfcrop': image output may have additional margins.
Traceback (most recent call last):
  File "C:\Users\msi-pc\Desktop\farrrrr.py", line 11, in <module>
    q.png
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\qutip_qip\circuit.py", line 1821, in png
    return DisplayImage(self._raw_png(), embed=True)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\qutip_qip\circuit.py", line 1811, in _raw_png
    return _latex.image_from_latex(self.latex_code(), "png")
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\qutip_qip\circuit_latex.py", line 245, in image_from_latex
    out = CONVERTERS[file_type](filename)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\qutip_qip\circuit_latex.py", line 180, in converter
    _run_command((which, *configuration.arguments, in_file, out_file))
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\qutip_qip\circuit_latex.py", line 65, in _run_command
    raise RuntimeError(e.stderr.decode(sys.stderr.encoding)) from None
RuntimeError: magick: unable to open image 'qcirc.pdf': No such file or directory @ error/blob.c/OpenBlob/3537.

I kindly ask for your help with many thanks in advance.
Thank you very much
Yours sincerely,

Nathan Shammah

unread,
Jun 21, 2021, 10:05:24 AM6/21/21
to qu...@googlegroups.com
Dear Farooq,

Maybe it is worth to open an issue on qutip-qip about it, https://github.com/qutip/qutip-qip/ 
I'd say there is something off with ImageMagick, it happened to me I think in the past, but I cannot recall the solution. 

Bests, 

Nathan 


--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/b9432190-296a-4012-9797-7a10bdbfe106n%40googlegroups.com.


--
Dr. Nathan Shammah

Farooq Khaleel

unread,
Jun 21, 2021, 10:34:31 AM6/21/21
to QuTiP: Quantum Toolbox in Python
Dear Dr. Nathan,
I hope you are doing well.
I hope you can remember how you fix it and tell me, please.
I am looking forward for other answers.
Thank you very much for your help.
Yours sincerely,

Farooq Khaleel

unread,
Jun 22, 2021, 8:41:30 AM6/22/21
to QuTiP: Quantum Toolbox in Python
Dear Dr. Nathan,
I hope you are doing well.
Thank you very much for your advice.
The problem solved by BoxiLi at the link you provided for me.
Thank you very much for your help.
Yours sincerely,

Nathan Shammah

unread,
Jun 22, 2021, 8:45:51 AM6/22/21
to qu...@googlegroups.com
Hi Farooq,

I’m glad it got sorted out. Hope you can enjoy these tools as much as I do. 

Best wishes,

Nathan

Reply all
Reply to author
Forward
0 new messages