Skip to content

Commit 805fbff

Browse files
committed
Remove Base Profile sections in circuits sample notebook
Now that the measurement decompositions are handled lower in the stack (see #2230), the examples for how measurements show up differently for circuits from Base profile vs Unrestricted no longer make sense. This removes them. Likewise the section in the wiki on circuits for different profiles should be updated or removed (see https://github.com/microsoft/qsharp/wiki/Circuit-Diagrams-from-Q%23-Code#target-profile)
1 parent 1249d66 commit 805fbff

File tree

1 file changed

+2
-61
lines changed

1 file changed

+2
-61
lines changed

samples/notebooks/circuits.ipynb

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -195,66 +195,7 @@
195195
"cell_type": "markdown",
196196
"metadata": {},
197197
"source": [
198-
"If we generate a circuit for the same program, but targeting the Base profile, the resulting circuit avoids reset gates and uses two qubits instead."
199-
]
200-
},
201-
{
202-
"cell_type": "code",
203-
"execution_count": null,
204-
"metadata": {},
205-
"outputs": [],
206-
"source": [
207-
"qsharp.init(target_profile=qsharp.TargetProfile.Base)"
208-
]
209-
},
210-
{
211-
"cell_type": "code",
212-
"execution_count": null,
213-
"metadata": {
214-
"vscode": {
215-
"languageId": "qsharp"
216-
}
217-
},
218-
"outputs": [],
219-
"source": [
220-
"%%qsharp\n",
221-
"\n",
222-
"operation TwoRandomBits() : Result[] {\n",
223-
" let r1 = RandomBit();\n",
224-
" let r2 = RandomBit();\n",
225-
" return [r1, r2];\n",
226-
"}\n",
227-
"\n",
228-
"operation RandomBit() : Result {\n",
229-
" use q = Qubit();\n",
230-
" H(q);\n",
231-
" MResetZ(q)\n",
232-
"}"
233-
]
234-
},
235-
{
236-
"cell_type": "code",
237-
"execution_count": null,
238-
"metadata": {},
239-
"outputs": [],
240-
"source": [
241-
"Circuit(qsharp.circuit(\"TwoRandomBits()\"))"
242-
]
243-
},
244-
{
245-
"cell_type": "markdown",
246-
"metadata": {},
247-
"source": [
248-
"Regardless of the target chosen, conditionals that compare `Result` values are not permitted during circuit synthesis. This is because they may introduce nondeterminism such that the circuit will look different depending on measurement outcome. Representing conditionals visually is not supported."
249-
]
250-
},
251-
{
252-
"cell_type": "code",
253-
"execution_count": null,
254-
"metadata": {},
255-
"outputs": [],
256-
"source": [
257-
"qsharp.init(target_profile=qsharp.TargetProfile.Unrestricted)"
198+
"Conditionals that compare `Result` values are not permitted during circuit synthesis. This is because they may introduce nondeterminism such that the circuit will look different depending on measurement outcome. Representing conditionals visually is not supported."
258199
]
259200
},
260201
{
@@ -354,7 +295,7 @@
354295
"name": "python",
355296
"nbconvert_exporter": "python",
356297
"pygments_lexer": "ipython3",
357-
"version": "3.11.9"
298+
"version": "3.11.11"
358299
}
359300
},
360301
"nbformat": 4,

0 commit comments

Comments
 (0)