You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: qualtran/resource_counting/qubit_counts.ipynb
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,8 @@
52
52
"id": "58f0823f-f76f-4adb-8f2a-a25d1e2ee070",
53
53
"metadata": {},
54
54
"source": [
55
+
"## Example: a bloq with an interior allocation\n",
56
+
"\n",
55
57
"For illustrative purposes, we use a bloq that has two $n$ bit registers, but allocates an additional $n$ bit register as part of its decomposition. Looking purely at the signature, you would conclude that the bloq uses $2n$ qubits; but by looking at the decomposition we can see that at its maximum circuit width it uses $3n$ qubits. "
56
58
]
57
59
},
@@ -91,6 +93,25 @@
91
93
"costs = query_costs(bloq, [QubitCount()])\n",
92
94
"GraphvizCallGraph(g, costs).get_svg()"
93
95
]
96
+
},
97
+
{
98
+
"cell_type": "markdown",
99
+
"id": "e421621b-cbb4-4603-acab-2b65f8cbf08c",
100
+
"metadata": {},
101
+
"source": [
102
+
"You can call `get_cost_value` on a composite bloq directly."
0 commit comments