diff --git a/tests/notebooks/test_mcx.py b/tests/notebooks/test_mcx.py index 6cc354335..c8e217627 100644 --- a/tests/notebooks/test_mcx.py +++ b/tests/notebooks/test_mcx.py @@ -29,8 +29,8 @@ def test_notebook(tb: TestbookNotebookClient) -> None: ) validate_quantum_program_size( tb.ref_pydantic("qprog_4"), - expected_width=80, # actual width: 69 - expected_depth=1700, # actual depth: 494 ; also was 920; also was 1550 + expected_width=90, # actual width: 75 + expected_depth=200, # actual depth: 80 ) # test notebook content diff --git a/tutorials/basic_tutorials/mcx/mcx.ipynb b/tutorials/basic_tutorials/mcx/mcx.ipynb index 15a8f6d33..b6fe6c499 100644 --- a/tutorials/basic_tutorials/mcx/mcx.ipynb +++ b/tutorials/basic_tutorials/mcx/mcx.ipynb @@ -94,7 +94,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Quantum program link: https://platform.classiq.io/circuit/31s7JrRZWYNAeLtLEUrHCxXO4YG\n" + "Quantum program link: https://platform.classiq.io/circuit/37tMs9Yhgj9Pm4fwVmLh1Jxp46E\n" ] } ], @@ -161,8 +161,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Synthesized MCX depth is 271\n", - "Quantum program link: https://platform.classiq.io/circuit/31s7KotFMIZjxx3juBOv79YSLsT\n" + "Synthesized MCX depth is 239\n", + "Quantum program link: https://platform.classiq.io/circuit/37tMslkNlfM2VnGuz4HydLQoBu3\n" ] } ], @@ -173,7 +173,7 @@ " max_width=MAX_WIDTH_2, optimization_parameter=OptimizationParameter.DEPTH\n", ")\n", "preferences_2 = Preferences(\n", - " backend_service_provider=\"IBM Quantum\", backend_name=\"ibm_brisbane\"\n", + " backend_service_provider=\"IBM Quantum\", backend_name=\"ibm_boston\"\n", ")\n", "\n", "\n", @@ -200,8 +200,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Synthesized MCX cx-count is 168\n", - "Quantum program link: https://platform.classiq.io/circuit/31s7M6am6IJ7wZmDVRu37xNFyZt\n" + "Synthesized MCX cx-count is 156\n", + "Quantum program link: https://platform.classiq.io/circuit/37tMtbAcVYs38SdWEox00DnEVvC\n" ] } ], @@ -214,7 +214,6 @@ ")\n", "\n", "qprog_3 = synthesize(main, constraints=constraints_3, preferences=preferences_3)\n", - "write_qmod(main, \"mcx_14_ctrl_cx\")\n", "print(f\"Synthesized MCX cx-count is {qprog_3.transpiled_circuit.count_ops['cx']}\")\n", "show(qprog_3)" ] @@ -231,7 +230,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "id": "17", "metadata": {}, "outputs": [ @@ -239,7 +238,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Quantum program link: https://platform.classiq.io/circuit/31s7uF4G5NptT3aWBiBdWKmRGHj\n" + "Quantum program link: https://platform.classiq.io/circuit/37tNCjf0PYRVDNj0F1ASEyVxWqx\n" ] } ], @@ -251,7 +250,7 @@ " my_mcx(cntrl, target)\n", "\n", "\n", - "constraints_4 = Constraints(max_depth=1000)\n", + "constraints_4 = Constraints(optimization_parameter=\"depth\")\n", "preferences_4 = Preferences(optimization_level=0)\n", "qprog_4 = synthesize(main, constraints=constraints_4, preferences=preferences_4)\n", "show(qprog_4)" diff --git a/tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.qmod b/tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.qmod deleted file mode 100644 index e5bec39dd..000000000 --- a/tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.qmod +++ /dev/null @@ -1,11 +0,0 @@ -qfunc my_mcx(cntrl: qbit[], target: qbit) { - control (cntrl) { - X(target); - } -} - -qfunc main(output cntrl: qbit[], output target: qbit) { - allocate(14, cntrl); - allocate(target); - my_mcx(cntrl, target); -} diff --git a/tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.synthesis_options.json b/tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.synthesis_options.json deleted file mode 100644 index 471ba89f7..000000000 --- a/tutorials/basic_tutorials/mcx/mcx_14_ctrl_cx.synthesis_options.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "constraints": { - "optimization_parameter": "no_opt" - }, - "preferences": { - "custom_hardware_settings": { - "basis_gates": [ - "h", - "tdg", - "p", - "y", - "cz", - "s", - "t", - "u1", - "u2", - "x", - "rz", - "rx", - "u", - "cy", - "sdg", - "z", - "cx", - "sx", - "id", - "ry", - "sxdg", - "r" - ], - "is_symmetric_connectivity": true - }, - "debug_mode": true, - "machine_precision": 8, - "optimization_level": 1, - "output_format": ["qasm"], - "pretty_qasm": true, - "random_seed": 1690742597, - "synthesize_all_separately": false, - "timeout_seconds": 300, - "transpilation_option": "auto optimize" - } -}