diff --git a/samples/azure-quantum/resource-estimation/estimation-dynamics.ipynb b/samples/azure-quantum/resource-estimation/estimation-dynamics.ipynb index ded643f595c3..73bfd6f82eef 100644 --- a/samples/azure-quantum/resource-estimation/estimation-dynamics.ipynb +++ b/samples/azure-quantum/resource-estimation/estimation-dynamics.ipynb @@ -332,20 +332,164 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, we are presenting the experimental results using a summary table." - ] + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Visualizing and understanding the results\n", + "\n", + "### Result summary table" + ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "results.summary_data_frame(labels=labels)" - ] + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "results.summary_data_frame(labels=labels)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Space chart\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The distribution of physical qubits used for the execution of the algorithm instructions and the supporting T factories can provide us valuable information to guide us in applying space and time optimizations. We can visualize this distribution for each set of qubit parameters to understand the differences in physical qubit distribution for each configuration.\n", + "\n", + "To show the space chart for a configuration from our experiment, use the following syntax:\n", + "\n", + "```\n", + " # Use the index of the desired configuration you want to visualize to get the results for that configuration.\n", + " \n", + " results[].diagram.space\n", + "\n", + " # For example, this command will produce a chart showing the distribution of physical qubits for the Gate-based µs, 10⁻³ configuration set.\n", + " results[0].diagram.space \n", + "```\n", + "\n", + "Below, let's visualize the space diagrams for each configuration." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> You must run the `results[].diagram.space` command in a separate code cell per label.\n", + ">\n", + "> You cannot visualize the time and space diagrams in the same cell.\n", + ">\n", + "> If you run an algorithm which only has one configured set of qubit parameters and one result set, specifying the label would not be necessary. You could simply run `result.diagram.time`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# \"Gate-based µs, 10⁻³\"\n", + "results[0].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# \"Gate-based µs, 10⁻⁴\"\n", + "results[1].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# \"Gate-based ns, 10⁻³\"\n", + "results[2].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# \"Gate-based ns, 10⁻⁴\"\n", + "results[3].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# \"Majorana ns, 10⁻⁴\"\n", + "results[4].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + " # \"Majorana ns, 10⁻⁶\"\n", + "results[5].diagram.space" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Time chart\n", + "We can also visualize the time required to execute the algorithm as it relates to each T factory invocation runtime and the number of T factory invocations.\n", + "\n", + "\n", + "To show the time chart for a configuration from our experiment, use the following syntax:\n", + "\n", + "```\n", + " # Use the index of the desired configuration you want to visualize to get the results for that configuration.\n", + " \n", + " results[].diagram.time\n", + "\n", + " # For example, this command will produce a chart showing the distribution of physical qubits for the Gate-based µs, 10⁻³ configuration set.\n", + " results[0].diagram.time\n", + "```\n", + "\n", + "Below, let's visualize the space diagrams for each configuration set." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> You must run the `results[].diagram.time` command in a separate code cell per label.\n", + ">\n", + "> You cannot visualize the time and space diagrams in the same cell.\n", + ">\n", + "> If you run an algorithm which only has one configured set of qubit parameters and one result set, specifying the label would not be necessary. You could simply run `result.diagram.time`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Feel free to try out different configuration sets by changing the index. \n", + "# This example produces the time diagram for the Gate-based µs, 10⁻³ configuration set.\n", + "results[0].diagram.time" + ] }, { "cell_type": "markdown", @@ -418,6 +562,64 @@ "most cases the code distance is higher." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To better understand how the balanced implementation changed the space distribution and runtime of the algorithm, try visualizing the new result set using the space and time diagrams discussed above." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Feel free to try out different configuration sets by changing the index. \n", + "# This example produces the time diagram for the Gate-based µs, 10⁻³ configuration set.\n", + "results_balanced[0].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Feel free to try out different configuration sets by changing the index. \n", + "# This example produces the time diagram for the Gate-based µs, 10⁻³ configuration set.\n", + "results_balanced[0].diagram.time" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You could even compare the previous implementation with the balanced implementation by re-running the space and time diagrams with the original result set and comparing to the new diagrams." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Feel free to try out different configuration sets by changing the index. \n", + "# This example produces the time diagram for the Gate-based µs, 10⁻³ configuration set.\n", + "results[0].diagram.space" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Feel free to try out different configuration sets by changing the index. \n", + "# This example produces the time diagram for the Gate-based µs, 10⁻³ configuration set.\n", + "results[0].diagram.time" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -433,6 +635,7 @@ " model instance\n", "* explore space- and time-trade-offs by changing the value for\n", " `logical_depth_factor`\n", + "* Visualize these trade-offs with the space and time diagrams\n", "* use other or customized qubit parameters" ] } diff --git a/samples/azure-quantum/resource-estimation/estimation-qiskit.ipynb b/samples/azure-quantum/resource-estimation/estimation-qiskit.ipynb index 71482d054b0c..3604239543df 100644 --- a/samples/azure-quantum/resource-estimation/estimation-qiskit.ipynb +++ b/samples/azure-quantum/resource-estimation/estimation-qiskit.ipynb @@ -168,6 +168,47 @@ "result" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The distribution of physical qubits used for the execution of the algorithm instructions and the supporting T factories can provide us valuable information to guide us in applying space and time optimizations. We can visualize this distribution to better understand the estimated space requirements for our algorithm." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "result.diagram.space" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also visualize the time required to execute the algorithm as it relates to each T factory invocation runtime and the number of T factory invocations." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">\n", + "> *You cannot visualize the time and space diagrams in the same cell.*\n", + ">" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "result.diagram.time" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -616,6 +657,7 @@ "\n", "* Try estimating the resources for a different Qiskit program.\n", "* Explore how qubit parameters and QEC schemes affect the error correction code distance of the logical qubit.\n", + "* Visualize your and compare your results from different parameter sets with the space and time diagrams.\n", "* Use the output data to derive logical qubit properties.\n", "* Learn how to setup complex resource estimation experiments in the _Advanced analysis of estimates_ notebook." ] diff --git a/samples/azure-quantum/resource-estimation/estimation-qsharp.ipynb b/samples/azure-quantum/resource-estimation/estimation-qsharp.ipynb index 4a4522d63612..095e066ee8ab 100644 --- a/samples/azure-quantum/resource-estimation/estimation-qsharp.ipynb +++ b/samples/azure-quantum/resource-estimation/estimation-qsharp.ipynb @@ -125,6 +125,47 @@ "result" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The distribution of physical qubits used for the execution of the algorithm instructions and the supporting T factories can provide us valuable information to guide us in applying space and time optimizations. We can visualize this distribution to better understand the estimated space requirements for our algorithm." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "result.diagram.space" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also visualize the time required to execute the algorithm as it relates to each T factory invocation runtime and the number of T factory invocations." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">\n", + "> *You cannot visualize the time and space diagrams in the same cell.*\n", + ">" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "result.diagram.time" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -568,6 +609,7 @@ "\n", "* Try estimating the resources for a different Q# program.\n", "* Explore how qubit parameters and QEC schemes affect the error correction code distance of the logical qubit.\n", + "* Visualize your and compare your results from different parameter sets with the space and time diagrams.\n", "* Use the output data to derive logical qubit properties.\n", "* Learn how to setup complex resource estimation experiments in the _Advanced analysis of estimates_ notebook." ]