Skip to content

Commit 69489fb

Browse files
Adam GitterAdamg-classiq
authored andcommitted
removed all and
1 parent d8c31ef commit 69489fb

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

community/Hackathons/QInnovision_2025/advection_equation/advection_equation_winning_submission.ipynb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@
899899
"constraints = Constraints(max_width=num_qubits)\n",
900900
"qmod = set_constraints(qmod, constraints)\n",
901901
"qmod = set_preferences(qmod, preferences)\n",
902-
"qprog = await synthesize_async(qmod)"
902+
"qprog = synthesize(qmod)"
903903
]
904904
},
905905
{
@@ -921,7 +921,7 @@
921921
},
922922
"outputs": [],
923923
"source": [
924-
"res_proposed = await execute_async(qprog)"
924+
"res_proposed = execute(qprog)"
925925
]
926926
},
927927
{
@@ -958,7 +958,7 @@
958958
"source": [
959959
"# Collected job data by id\n",
960960
"print(\"Job ID:\", res_proposed.id)\n",
961-
"restored_job_proposed = await ExecutionJob.from_id_async(res_proposed.id)\n",
961+
"restored_job_proposed = ExecutionJob.from_id(res_proposed.id)\n",
962962
"print(restored_job_proposed.status)"
963963
]
964964
},
@@ -981,7 +981,7 @@
981981
},
982982
"outputs": [],
983983
"source": [
984-
"result_proposed = await restored_job_proposed.result_async()"
984+
"result_proposed = restored_job_proposed.result()"
985985
]
986986
},
987987
{
@@ -1294,7 +1294,7 @@
12941294
"constraints = Constraints(max_width=num_qubits) #, optimization_parameter=OptimizationParameter.WIDTH\n",
12951295
"qmod = set_constraints(qmod, constraints)\n",
12961296
"qmod = set_preferences(qmod, preferences)\n",
1297-
"qprog = await synthesize_async(qmod)"
1297+
"qprog = synthesize(qmod)"
12981298
]
12991299
},
13001300
{
@@ -1306,7 +1306,7 @@
13061306
},
13071307
"outputs": [],
13081308
"source": [
1309-
"res_trotter = await execute_async(qprog)"
1309+
"res_trotter = execute(qprog)"
13101310
]
13111311
},
13121312
{
@@ -1343,7 +1343,7 @@
13431343
"source": [
13441344
"# Collected job data by id\n",
13451345
"print(\"Job ID:\", res_trotter.id)\n",
1346-
"restored_job_trotter = await ExecutionJob.from_id_async(res_trotter.id)\n",
1346+
"restored_job_trotter = ExecutionJob.from_id(res_trotter.id)\n",
13471347
"print(restored_job_trotter.status)"
13481348
]
13491349
},
@@ -1366,7 +1366,7 @@
13661366
},
13671367
"outputs": [],
13681368
"source": [
1369-
"result_trotter = await res_trotter.result_async()"
1369+
"result_trotter = res_trotter.result()"
13701370
]
13711371
},
13721372
{
@@ -1713,7 +1713,7 @@
17131713
"constraints = Constraints(max_width=num_qubits)\n",
17141714
"qmod = set_constraints(qmod, constraints)\n",
17151715
"qmod = set_preferences(qmod, preferences)\n",
1716-
"qprog = await synthesize_async(qmod)\n",
1716+
"qprog = synthesize(qmod)\n",
17171717
"# show(qprog)"
17181718
]
17191719
},
@@ -1726,7 +1726,7 @@
17261726
},
17271727
"outputs": [],
17281728
"source": [
1729-
"res_proposed_custom = await execute_async(qprog)"
1729+
"res_proposed_custom = execute(qprog)"
17301730
]
17311731
},
17321732
{
@@ -1763,7 +1763,7 @@
17631763
"source": [
17641764
"# Collected job data by id\n",
17651765
"print(\"Job ID:\", res_proposed_custom.id)\n",
1766-
"restored_job_proposed_custom = await ExecutionJob.from_id_async(res_proposed_custom.id)\n",
1766+
"restored_job_proposed_custom = ExecutionJob.from_id(res_proposed_custom.id)\n",
17671767
"print(restored_job_proposed_custom.status)"
17681768
]
17691769
},
@@ -1786,7 +1786,7 @@
17861786
},
17871787
"outputs": [],
17881788
"source": [
1789-
"result_proposed_custom = await res_proposed_custom.result_async()"
1789+
"result_proposed_custom = res_proposed_custom.result()"
17901790
]
17911791
},
17921792
{
@@ -2083,12 +2083,12 @@
20832083
" return main\n",
20842084
"\n",
20852085
"# Function to synthesize circuit and collect CX count and depth\n",
2086-
"async def synthesize_and_collect(main, num_qubits):\n",
2086+
"def synthesize_and_collect(main, num_qubits):\n",
20872087
" # Define and synthesize model\n",
20882088
" qmod = create_model(main, execution_preferences=ExecutionPreferences(num_shots=1, backend_preferences=backend_preferences))\n",
20892089
" qmod = set_constraints(qmod, Constraints(max_width=num_qubits))\n",
20902090
" qmod = set_preferences(qmod, preferences)\n",
2091-
" qprog = await synthesize_async(qmod)\n",
2091+
" qprog = synthesize(qmod)\n",
20922092
"\n",
20932093
" # Extract CX count and depth from synthesized circuit\n",
20942094
" circuit = QuantumProgram.from_qprog(qprog)\n",
@@ -2155,20 +2155,20 @@
21552155
" main = v_operator(num_qubits, steps)\n",
21562156
"\n",
21572157
" # Collect data for V-circuit\n",
2158-
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
2158+
" cx_count = synthesize_and_collect(main, num_qubits)\n",
21592159
" cx_counts_proposed.append(cx_count)\n",
21602160
"\n",
21612161
" main = v_operator_custom(num_qubits, steps)\n",
21622162
"\n",
21632163
" # Collect data for V-circuit\n",
2164-
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
2164+
" cx_count = synthesize_and_collect(main, num_qubits)\n",
21652165
" cx_counts_proposed_custom.append(cx_count)\n",
21662166
"\n",
21672167
" # Define Suzuki-Trotter quantum function\n",
21682168
" main = suzuki_trotter_step(num_qubits, steps)\n",
21692169
"\n",
21702170
" # Collect data for Trotter-circuit\n",
2171-
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
2171+
" cx_count = synthesize_and_collect(main, num_qubits)\n",
21722172
" cx_counts_trotter.append(cx_count)\n",
21732173
"\n",
21742174
"qubits_analysis_results= {\n",
@@ -2388,20 +2388,20 @@
23882388
" main = v_operator(num_qubits, steps)\n",
23892389
"\n",
23902390
" # Collect data for V-circuit\n",
2391-
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
2391+
" cx_count = synthesize_and_collect(main, num_qubits)\n",
23922392
" cx_counts_proposed.append(cx_count)\n",
23932393
"\n",
23942394
" main = v_operator_custom(num_qubits, steps)\n",
23952395
"\n",
23962396
" # Collect data for V-circuit\n",
2397-
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
2397+
" cx_count = synthesize_and_collect(main, num_qubits)\n",
23982398
" cx_counts_proposed_custom.append(cx_count)\n",
23992399
"\n",
24002400
" # Define Suzuki-Trotter quantum function\n",
24012401
" main = suzuki_trotter_step(num_qubits, steps)\n",
24022402
"\n",
24032403
" # Collect data for Trotter-circuit\n",
2404-
" cx_count = await synthesize_and_collect(main, num_qubits)\n",
2404+
" cx_count = synthesize_and_collect(main, num_qubits)\n",
24052405
" cx_counts_trotter.append(cx_count)\n",
24062406
"\n",
24072407
"step_analysis_results = {\n",
@@ -2479,7 +2479,7 @@
24792479
"provenance": []
24802480
},
24812481
"kernelspec": {
2482-
"display_name": "Python 3",
2482+
"display_name": "Python 3 (ipykernel)",
24832483
"language": "python",
24842484
"name": "python3"
24852485
},
@@ -2493,7 +2493,7 @@
24932493
"name": "python",
24942494
"nbconvert_exporter": "python",
24952495
"pygments_lexer": "ipython3",
2496-
"version": "3.10.1"
2496+
"version": "3.11.7"
24972497
}
24982498
},
24992499
"nbformat": 4,

0 commit comments

Comments
 (0)