diff --git a/tutorials/basic_tutorials/the_classiq_tutorial/synthesis_tutorial.ipynb b/tutorials/basic_tutorials/the_classiq_tutorial/synthesis_tutorial.ipynb index afed4f01b..0770c77b0 100644 --- a/tutorials/basic_tutorials/the_classiq_tutorial/synthesis_tutorial.ipynb +++ b/tutorials/basic_tutorials/the_classiq_tutorial/synthesis_tutorial.ipynb @@ -24,7 +24,17 @@ }, "outputs": [], "source": [ - "from classiq import *\n", + "from classiq import (\n", + " Constraints,\n", + " OptimizationParameter,\n", + " Output,\n", + " QNum,\n", + " allocate,\n", + " hadamard_transform,\n", + " qfunc,\n", + " show,\n", + " synthesize,\n", + ")\n", "\n", "\n", "@qfunc\n", @@ -79,7 +89,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Opening: https://platform.classiq.io/circuit/2twaSBItXmQT3lgsNKPOCSzYedO?version=0.70.0\n" + "Quantum program link: https://platform.classiq.io/circuit/2yHwgkWygipwYKH1a6n9kIugTmX?login=True&version=0.82.1\n" ] } ], @@ -150,7 +160,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Opening: https://platform.classiq.io/circuit/2twaSjGvvXFX7TCHomoiGKVTHPt?version=0.70.0\n" + "Quantum program link: https://platform.classiq.io/circuit/2yHwhU3Tiy92rpab2DZ0jFRu70p?login=True&version=0.82.1\n" ] } ], @@ -165,6 +175,36 @@ "The new depth and width are 47 and 9, respectively. As expected, we \"pay\" with extra depth for an implementation that uses less qubits." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Visualization\n", + "\n", + "When opening a quantum program using the `show` command, the visualization provides details regarding the quantum circuit's structure and performance. Key characteristics, such as gate count, qubit usage, and circuit depth, are displayed.\n", + "\n", + "The visualization is organized according to the building blocks used during the quantum program construction. These blocks represent modular components or routines in your quantum algorithm. By clicking on the \"+\" sign on a block, you can expand it to reveal the underlying quantum gates, making it easier to inspect, debug, or understand the algorithm's logic at both high and low levels.\n", + "\n", + "This can be seen in the following figure: the left panel represents a high-level view showing the quantum blocks used in the algorithm—such as `hadamard_transform` and `assign x**2 + 1`—while the right panel shows an expanded view of the `assign` block, revealing the underlying quantum gate sequence. Gates include multiple `PHASE` operations and a quantum Fourier transform block (`qft6`), offering insight into the inner workings of this computation.\n", + "\n", + "![Quantum Program Visualization](https://docs.classiq.io/resources/synthesis_tutorial.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Exporting and Sharing\n", + "\n", + "In addition to visualizing a quantum program, the tool provides convenient options to export the quantum circuit in multiple formats, enabling integration with other tools and workflows. Some of them are:\n", + "\n", + "- **QASM**: Allows interoperability with quantum simulators and hardware platforms.\n", + "- **LaTeX**: Produces a high-quality, pictorial representation of the circuit, ready for inclusion in LaTeX files.\n", + "- **JPEG**: Generates a graphical image of the circuit.\n", + "\n", + "To facilitate collaboration, there is a **Share** button that generates a unique link that you can send to anyone who wants to view your circuit directly in their browser — no login required.\n" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -180,7 +220,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -194,7 +234,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.11.9" } }, "nbformat": 4,