Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@
"constraints = Constraints(max_width=num_qubits)\n",
"qmod = set_constraints(qmod, constraints)\n",
"qmod = set_preferences(qmod, preferences)\n",
"qprog = await synthesize_async(qmod)"
"qprog = synthesize(qmod)"
]
},
{
Expand All @@ -921,7 +921,7 @@
},
"outputs": [],
"source": [
"res_proposed = await execute_async(qprog)"
"res_proposed = execute(qprog)"
]
},
{
Expand Down Expand Up @@ -958,7 +958,7 @@
"source": [
"# Collected job data by id\n",
"print(\"Job ID:\", res_proposed.id)\n",
"restored_job_proposed = await ExecutionJob.from_id_async(res_proposed.id)\n",
"restored_job_proposed = ExecutionJob.from_id(res_proposed.id)\n",
"print(restored_job_proposed.status)"
]
},
Expand All @@ -981,7 +981,7 @@
},
"outputs": [],
"source": [
"result_proposed = await restored_job_proposed.result_async()"
"result_proposed = restored_job_proposed.result()"
]
},
{
Expand Down Expand Up @@ -1294,7 +1294,7 @@
"constraints = Constraints(max_width=num_qubits) #, optimization_parameter=OptimizationParameter.WIDTH\n",
"qmod = set_constraints(qmod, constraints)\n",
"qmod = set_preferences(qmod, preferences)\n",
"qprog = await synthesize_async(qmod)"
"qprog = synthesize(qmod)"
]
},
{
Expand All @@ -1306,7 +1306,7 @@
},
"outputs": [],
"source": [
"res_trotter = await execute_async(qprog)"
"res_trotter = execute(qprog)"
]
},
{
Expand Down Expand Up @@ -1343,7 +1343,7 @@
"source": [
"# Collected job data by id\n",
"print(\"Job ID:\", res_trotter.id)\n",
"restored_job_trotter = await ExecutionJob.from_id_async(res_trotter.id)\n",
"restored_job_trotter = ExecutionJob.from_id(res_trotter.id)\n",
"print(restored_job_trotter.status)"
]
},
Expand All @@ -1366,7 +1366,7 @@
},
"outputs": [],
"source": [
"result_trotter = await res_trotter.result_async()"
"result_trotter = res_trotter.result()"
]
},
{
Expand Down Expand Up @@ -1713,7 +1713,7 @@
"constraints = Constraints(max_width=num_qubits)\n",
"qmod = set_constraints(qmod, constraints)\n",
"qmod = set_preferences(qmod, preferences)\n",
"qprog = await synthesize_async(qmod)\n",
"qprog = synthesize(qmod)\n",
"# show(qprog)"
]
},
Expand All @@ -1726,7 +1726,7 @@
},
"outputs": [],
"source": [
"res_proposed_custom = await execute_async(qprog)"
"res_proposed_custom = execute(qprog)"
]
},
{
Expand Down Expand Up @@ -1763,7 +1763,7 @@
"source": [
"# Collected job data by id\n",
"print(\"Job ID:\", res_proposed_custom.id)\n",
"restored_job_proposed_custom = await ExecutionJob.from_id_async(res_proposed_custom.id)\n",
"restored_job_proposed_custom = ExecutionJob.from_id(res_proposed_custom.id)\n",
"print(restored_job_proposed_custom.status)"
]
},
Expand All @@ -1786,7 +1786,7 @@
},
"outputs": [],
"source": [
"result_proposed_custom = await res_proposed_custom.result_async()"
"result_proposed_custom = res_proposed_custom.result()"
]
},
{
Expand Down Expand Up @@ -2083,12 +2083,12 @@
" return main\n",
"\n",
"# Function to synthesize circuit and collect CX count and depth\n",
"async def synthesize_and_collect(main, num_qubits):\n",
"def synthesize_and_collect(main, num_qubits):\n",
" # Define and synthesize model\n",
" qmod = create_model(main, execution_preferences=ExecutionPreferences(num_shots=1, backend_preferences=backend_preferences))\n",
" qmod = set_constraints(qmod, Constraints(max_width=num_qubits))\n",
" qmod = set_preferences(qmod, preferences)\n",
" qprog = await synthesize_async(qmod)\n",
" qprog = synthesize(qmod)\n",
"\n",
" # Extract CX count and depth from synthesized circuit\n",
" circuit = QuantumProgram.from_qprog(qprog)\n",
Expand Down Expand Up @@ -2155,20 +2155,20 @@
" main = v_operator(num_qubits, steps)\n",
"\n",
" # Collect data for V-circuit\n",
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
" cx_count = synthesize_and_collect(main, num_qubits)\n",
" cx_counts_proposed.append(cx_count)\n",
"\n",
" main = v_operator_custom(num_qubits, steps)\n",
"\n",
" # Collect data for V-circuit\n",
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
" cx_count = synthesize_and_collect(main, num_qubits)\n",
" cx_counts_proposed_custom.append(cx_count)\n",
"\n",
" # Define Suzuki-Trotter quantum function\n",
" main = suzuki_trotter_step(num_qubits, steps)\n",
"\n",
" # Collect data for Trotter-circuit\n",
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
" cx_count = synthesize_and_collect(main, num_qubits)\n",
" cx_counts_trotter.append(cx_count)\n",
"\n",
"qubits_analysis_results= {\n",
Expand Down Expand Up @@ -2388,20 +2388,20 @@
" main = v_operator(num_qubits, steps)\n",
"\n",
" # Collect data for V-circuit\n",
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
" cx_count = synthesize_and_collect(main, num_qubits)\n",
" cx_counts_proposed.append(cx_count)\n",
"\n",
" main = v_operator_custom(num_qubits, steps)\n",
"\n",
" # Collect data for V-circuit\n",
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
" cx_count = synthesize_and_collect(main, num_qubits)\n",
" cx_counts_proposed_custom.append(cx_count)\n",
"\n",
" # Define Suzuki-Trotter quantum function\n",
" main = suzuki_trotter_step(num_qubits, steps)\n",
"\n",
" # Collect data for Trotter-circuit\n",
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
" cx_count = synthesize_and_collect(main, num_qubits)\n",
" cx_counts_trotter.append(cx_count)\n",
"\n",
"step_analysis_results = {\n",
Expand Down Expand Up @@ -2479,7 +2479,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -2493,7 +2493,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.1"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/timeouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ time_marching.qmod: 400
solving_qlsp_with_aqc.ipynb: 800
solving_qlsp_with_aqc.qmod: 800
combinatorial_qmod_workshop_for_maxcut.ipynb: 250
advection.ipynb: 500
advection_equation_2nd_place_submission.ipynb: 500
Qmod_workshop4finance.ipynb: 400
Option_Pricing_Workshop.ipynb: 400
combi_workshop_equality_constriants_PO.ipynb: 700
Expand All @@ -331,4 +331,4 @@ classiq_overview_tutorial.ipynb: 500
Qmod_tutorial_part1.ipynb: 500
Qmod_tutorial_part2.ipynb: 500
synthesis_tutorial.ipynb: 500
Solving_advection_equation.ipynb: 1800
advection_equation_winning_submission.ipynb: 1200