Skip to content
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

Fix QuantumCircuit.draw() not outputting pdf in latex mode #10212

Merged
merged 3 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion qiskit/visualization/circuit/circuit_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import os
import subprocess
import tempfile
import shutil
from warnings import warn

from qiskit import user_config
Expand Down Expand Up @@ -495,7 +496,7 @@ def _latex_circuit_drawer(
image = trim_image(image)
if filename:
if filename.endswith(".pdf"):
os.rename(base + ".pdf", filename)
shutil.move(base + ".pdf", filename)
else:
try:
image.save(filename)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

fixes:
- |
Fixed a regression in the LaTeX drawer of :meth:`.QuantumCircuit.draw`
when temporary files are placed on a separate filesystem to the working
directory. See
`#10211 <https://github.com/Qiskit/qiskit-terra/issues/10211>`__.