Skip to content

Commit

Permalink
[docs] Extend the visualization tutorial with LaTex example (#2041)
Browse files Browse the repository at this point in the history
  • Loading branch information
khalatepradnya authored and bettinaheim committed Aug 5, 2024
1 parent 4582e9e commit 8b381ed
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 27 additions & 3 deletions docs/sphinx/examples/python/tutorials/visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,34 @@
"\n",
" r1(3.14159, q[0])\n",
" tdg(q[1])\n",
" s(q[2])\n",
" s(q[2])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(cudaq.draw(kernel_to_draw))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(cudaq.draw('latex', kernel_to_draw))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Copy this output string into any LaTeX editor and export it to PDF.\n",
"\n",
"circuit = cudaq.draw(kernel_to_draw)\n",
"print(circuit)"
"<img src=\"images/circuit_pdf.png\" alt=\"Circuit in PDF format\" width=\"500\" height=\"250\">"
]
}
],
Expand Down

0 comments on commit 8b381ed

Please sign in to comment.