QuantumCircuit.draw()
cannot produce pdf successfully using 'latex'
mode
#10211
Labels
bug
Something isn't working
Environment
What is happening?
Upon calling
QuantumCircuit.draw('latex', 'out.pdf')
,qiskit
fails to produce a pdf output with latex mode. The bug seems to occur not when compiling the pdf, but when qiskit tries to move the pdf from the temporary folder to the target directory.I've looked around on the Internet and found out that this might be a bug due to
os.rename(...)
. (Ref)It seems to due to that
os.rename(...)
cannot handle moving files between filesystems.How can we reproduce the issue?
I've used the following snippet, substituting
<path_to_qasm_file>
to any qasm filepath.The bug though is probably related to filesystems of the device, so it may work just fine on other computers.
What should happen?
The following traceback is produced:
No pdf is outputted. Or more precisely, the pdf is created, but not moved to the target directory, and then the temporary folder is deleted.
Any suggestions?
Currently, if I change
qiskit/visualization/circuit/circuit_visualization.py", line 491
fromto
then it seems to work just fine.
The text was updated successfully, but these errors were encountered: