Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Update visualization diagram documentation for resource estimator #822

Merged
merged 5 commits into from
Aug 24, 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
227 changes: 215 additions & 12 deletions samples/azure-quantum/resource-estimation/estimation-dynamics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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[<item index>].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[<item index>].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[<item index>].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[<item index>].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",
Expand Down Expand Up @@ -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": {},
Expand All @@ -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"
]
}
Expand Down
42 changes: 42 additions & 0 deletions samples/azure-quantum/resource-estimation/estimation-qiskit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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."
]
Expand Down
42 changes: 42 additions & 0 deletions samples/azure-quantum/resource-estimation/estimation-qsharp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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."
]
Expand Down
Loading