Skip to content

Commit 8b381ed

Browse files
khalatepradnyabettinaheim
authored andcommitted
[docs] Extend the visualization tutorial with LaTex example (#2041)
1 parent 4582e9e commit 8b381ed

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed
18.6 KB
Loading

docs/sphinx/examples/python/tutorials/visualization.ipynb

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,34 @@
239239
"\n",
240240
" r1(3.14159, q[0])\n",
241241
" tdg(q[1])\n",
242-
" s(q[2])\n",
242+
" s(q[2])"
243+
]
244+
},
245+
{
246+
"cell_type": "code",
247+
"execution_count": null,
248+
"metadata": {},
249+
"outputs": [],
250+
"source": [
251+
"print(cudaq.draw(kernel_to_draw))"
252+
]
253+
},
254+
{
255+
"cell_type": "code",
256+
"execution_count": null,
257+
"metadata": {},
258+
"outputs": [],
259+
"source": [
260+
"print(cudaq.draw('latex', kernel_to_draw))"
261+
]
262+
},
263+
{
264+
"cell_type": "markdown",
265+
"metadata": {},
266+
"source": [
267+
"Copy this output string into any LaTeX editor and export it to PDF.\n",
243268
"\n",
244-
"circuit = cudaq.draw(kernel_to_draw)\n",
245-
"print(circuit)"
269+
"<img src=\"images/circuit_pdf.png\" alt=\"Circuit in PDF format\" width=\"500\" height=\"250\">"
246270
]
247271
}
248272
],

0 commit comments

Comments
 (0)