Skip to content

Commit 8a3491b

Browse files
committed
fixed mcx tutorial
1 parent 4d46738 commit 8a3491b

File tree

4 files changed

+11
-66
lines changed

4 files changed

+11
-66
lines changed

tests/notebooks/test_mcx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def test_notebook(tb: TestbookNotebookClient) -> None:
2929
)
3030
validate_quantum_program_size(
3131
tb.ref_pydantic("qprog_4"),
32-
expected_width=80, # actual width: 69
33-
expected_depth=1700, # actual depth: 494 ; also was 920; also was 1550
32+
expected_width=90, # actual width: 75
33+
expected_depth=200, # actual depth: 80
3434
)
3535

3636
# test notebook content

tutorials/basic_tutorials/mcx/mcx.ipynb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"name": "stdout",
9595
"output_type": "stream",
9696
"text": [
97-
"Quantum program link: https://platform.classiq.io/circuit/31s7JrRZWYNAeLtLEUrHCxXO4YG\n"
97+
"Quantum program link: https://platform.classiq.io/circuit/37tMs9Yhgj9Pm4fwVmLh1Jxp46E\n"
9898
]
9999
}
100100
],
@@ -161,8 +161,8 @@
161161
"name": "stdout",
162162
"output_type": "stream",
163163
"text": [
164-
"Synthesized MCX depth is 271\n",
165-
"Quantum program link: https://platform.classiq.io/circuit/31s7KotFMIZjxx3juBOv79YSLsT\n"
164+
"Synthesized MCX depth is 239\n",
165+
"Quantum program link: https://platform.classiq.io/circuit/37tMslkNlfM2VnGuz4HydLQoBu3\n"
166166
]
167167
}
168168
],
@@ -173,7 +173,7 @@
173173
" max_width=MAX_WIDTH_2, optimization_parameter=OptimizationParameter.DEPTH\n",
174174
")\n",
175175
"preferences_2 = Preferences(\n",
176-
" backend_service_provider=\"IBM Quantum\", backend_name=\"ibm_brisbane\"\n",
176+
" backend_service_provider=\"IBM Quantum\", backend_name=\"ibm_boston\"\n",
177177
")\n",
178178
"\n",
179179
"\n",
@@ -200,8 +200,8 @@
200200
"name": "stdout",
201201
"output_type": "stream",
202202
"text": [
203-
"Synthesized MCX cx-count is 168\n",
204-
"Quantum program link: https://platform.classiq.io/circuit/31s7M6am6IJ7wZmDVRu37xNFyZt\n"
203+
"Synthesized MCX cx-count is 156\n",
204+
"Quantum program link: https://platform.classiq.io/circuit/37tMtbAcVYs38SdWEox00DnEVvC\n"
205205
]
206206
}
207207
],
@@ -214,7 +214,6 @@
214214
")\n",
215215
"\n",
216216
"qprog_3 = synthesize(main, constraints=constraints_3, preferences=preferences_3)\n",
217-
"write_qmod(main, \"mcx_14_ctrl_cx\")\n",
218217
"print(f\"Synthesized MCX cx-count is {qprog_3.transpiled_circuit.count_ops['cx']}\")\n",
219218
"show(qprog_3)"
220219
]
@@ -231,15 +230,15 @@
231230
},
232231
{
233232
"cell_type": "code",
234-
"execution_count": 8,
233+
"execution_count": 9,
235234
"id": "17",
236235
"metadata": {},
237236
"outputs": [
238237
{
239238
"name": "stdout",
240239
"output_type": "stream",
241240
"text": [
242-
"Quantum program link: https://platform.classiq.io/circuit/31s7uF4G5NptT3aWBiBdWKmRGHj\n"
241+
"Quantum program link: https://platform.classiq.io/circuit/37tNCjf0PYRVDNj0F1ASEyVxWqx\n"
243242
]
244243
}
245244
],
@@ -251,7 +250,7 @@
251250
" my_mcx(cntrl, target)\n",
252251
"\n",
253252
"\n",
254-
"constraints_4 = Constraints(max_depth=1000)\n",
253+
"constraints_4 = Constraints(optimization_parameter=\"depth\")\n",
255254
"preferences_4 = Preferences(optimization_level=0)\n",
256255
"qprog_4 = synthesize(main, constraints=constraints_4, preferences=preferences_4)\n",
257256
"show(qprog_4)"

tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.qmod

Lines changed: 0 additions & 11 deletions
This file was deleted.

tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.synthesis_options.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)