Skip to content

Commit 170c4ea

Browse files
set width optimization
1 parent e3b5b2a commit 170c4ea

File tree

8 files changed

+103
-99
lines changed

8 files changed

+103
-99
lines changed

applications/cfd/linear_qls_for_hybrid_solvers/cheb_lcu_solver_banded_be.synthesis_options.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66
"preferences": {
77
"custom_hardware_settings": {
88
"basis_gates": [
9-
"cx",
10-
"p",
9+
"cz",
1110
"ry",
12-
"sxdg",
1311
"tdg",
14-
"u2",
15-
"t",
16-
"rx",
12+
"sdg",
13+
"y",
1714
"rz",
15+
"h",
1816
"x",
17+
"r",
18+
"cy",
19+
"z",
20+
"cx",
1921
"sx",
20-
"h",
22+
"u1",
23+
"s",
24+
"sxdg",
2125
"id",
22-
"sdg",
23-
"cz",
24-
"r",
26+
"t",
27+
"p",
28+
"u2",
2529
"u",
26-
"y",
27-
"u1",
28-
"z",
29-
"cy",
30-
"s"
30+
"rx"
3131
],
3232
"is_symmetric_connectivity": true
3333
},
@@ -36,7 +36,7 @@
3636
"optimization_level": 1,
3737
"output_format": ["qasm"],
3838
"pretty_qasm": true,
39-
"random_seed": 2328475797,
39+
"random_seed": 967204371,
4040
"synthesize_all_separately": false,
4141
"timeout_seconds": 300,
4242
"transpilation_option": "auto optimize"

applications/cfd/linear_qls_for_hybrid_solvers/cheb_lcu_solver_pauli_be.synthesis_options.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66
"preferences": {
77
"custom_hardware_settings": {
88
"basis_gates": [
9-
"cx",
10-
"p",
9+
"cz",
1110
"ry",
12-
"sxdg",
1311
"tdg",
14-
"u2",
15-
"t",
16-
"rx",
12+
"sdg",
13+
"y",
1714
"rz",
15+
"h",
1816
"x",
17+
"r",
18+
"cy",
19+
"z",
20+
"cx",
1921
"sx",
20-
"h",
22+
"u1",
23+
"s",
24+
"sxdg",
2125
"id",
22-
"sdg",
23-
"cz",
24-
"r",
26+
"t",
27+
"p",
28+
"u2",
2529
"u",
26-
"y",
27-
"u1",
28-
"z",
29-
"cy",
30-
"s"
30+
"rx"
3131
],
3232
"is_symmetric_connectivity": true
3333
},
@@ -36,7 +36,7 @@
3636
"optimization_level": 1,
3737
"output_format": ["qasm"],
3838
"pretty_qasm": true,
39-
"random_seed": 2936002542,
39+
"random_seed": 3880106879,
4040
"synthesize_all_separately": false,
4141
"timeout_seconds": 300,
4242
"transpilation_option": "auto optimize"

applications/cfd/linear_qls_for_hybrid_solvers/qls_chebyshev_lcu.ipynb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@
415415
"Performing numpy Chebyshev interpolation, with degree 1293 and trimming to degree 32\n",
416416
"Chebyshec LCU size: 4 qubits.\n",
417417
"Normalization factor for inversion: 0.2754793041517278\n",
418-
"time to syn: 120.26335096359253\n",
419-
"time to exe: 66.34956789016724\n",
420-
"Quantum program link: https://platform.classiq.io/circuit/32BGRqpWUBNWoCYvf6SFGpOBw2Y\n"
418+
"time to syn: 121.38798403739929\n",
419+
"time to exe: 59.68091106414795\n",
420+
"Quantum program link: https://platform.classiq.io/circuit/32BR1I7187rgHY3r4V1m9sbaNTe\n"
421421
]
422422
}
423423
],
@@ -429,6 +429,7 @@
429429
" be_method=\"banded\",\n",
430430
" cheb_approx_type=\"trimmed\",\n",
431431
" preferences=prefs,\n",
432+
" constraints=Constraints(optimization_parameter=\"width\"),\n",
432433
" qmod_name=\"cheb_lcu_solver_banded_be\",\n",
433434
")\n",
434435
"show(qprog_cheb_lcu_banded)"
@@ -449,9 +450,9 @@
449450
"Performing numpy Chebyshev interpolation, with degree 899 and trimming to degree 32\n",
450451
"Chebyshec LCU size: 4 qubits.\n",
451452
"Normalization factor for inversion: 0.37096704248608536\n",
452-
"time to syn: 54.925143241882324\n",
453-
"time to exe: 27.34259819984436\n",
454-
"Quantum program link: https://platform.classiq.io/circuit/32BGdCa7f0T2qj491uJ1WWzGAlz\n"
453+
"time to syn: 102.73084592819214\n",
454+
"time to exe: 20.385194063186646\n",
455+
"Quantum program link: https://platform.classiq.io/circuit/32BRHueP7xyNN7fBDiMm2NSvECD\n"
455456
]
456457
}
457458
],
@@ -463,24 +464,25 @@
463464
" be_method=\"pauli\",\n",
464465
" cheb_approx_type=\"trimmed\",\n",
465466
" preferences=prefs,\n",
467+
" constraints=Constraints(optimization_parameter=\"width\"),\n",
466468
" qmod_name=\"cheb_lcu_solver_pauli_be\",\n",
467469
")\n",
468470
"show(qprog_cheb_lcu_pauli)"
469471
]
470472
},
471473
{
472474
"cell_type": "code",
473-
"execution_count": 12,
475+
"execution_count": 11,
474476
"id": "6fd7f6dd-878d-4b1e-bde0-2e424fdea562",
475477
"metadata": {},
476478
"outputs": [
477479
{
478480
"data": {
479481
"text/plain": [
480-
"[<matplotlib.lines.Line2D at 0x302824b50>]"
482+
"[<matplotlib.lines.Line2D at 0x30590e390>]"
481483
]
482484
},
483-
"execution_count": 12,
485+
"execution_count": 11,
484486
"metadata": {},
485487
"output_type": "execute_result"
486488
},
@@ -518,7 +520,7 @@
518520
},
519521
{
520522
"cell_type": "code",
521-
"execution_count": 14,
523+
"execution_count": 12,
522524
"id": "8f2bed6f-0cda-4f54-9d67-a28464823730",
523525
"metadata": {},
524526
"outputs": [],

applications/cfd/linear_qls_for_hybrid_solvers/qls_qsvt.ipynb

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
},
182182
{
183183
"cell_type": "code",
184-
"execution_count": 5,
184+
"execution_count": 4,
185185
"id": "ffdd07ee-3941-4ba8-8415-f45c1eff4d53",
186186
"metadata": {},
187187
"outputs": [],
@@ -278,7 +278,7 @@
278278
},
279279
{
280280
"cell_type": "code",
281-
"execution_count": 6,
281+
"execution_count": 5,
282282
"id": "78da6677-d323-4b2b-abee-3986b046aed3",
283283
"metadata": {},
284284
"outputs": [],
@@ -302,7 +302,7 @@
302302
},
303303
{
304304
"cell_type": "code",
305-
"execution_count": 7,
305+
"execution_count": 6,
306306
"id": "3e8339d8-b65d-45fc-a53f-a0722769348d",
307307
"metadata": {},
308308
"outputs": [],
@@ -318,7 +318,7 @@
318318
},
319319
{
320320
"cell_type": "code",
321-
"execution_count": 8,
321+
"execution_count": 7,
322322
"id": "9361c4e0-9bfb-4633-9498-890126fcf93e",
323323
"metadata": {},
324324
"outputs": [
@@ -343,7 +343,7 @@
343343
},
344344
{
345345
"cell_type": "code",
346-
"execution_count": 9,
346+
"execution_count": 8,
347347
"id": "ab8cfc39-9fe0-4de6-b36e-14ae565ab35e",
348348
"metadata": {},
349349
"outputs": [
@@ -356,9 +356,9 @@
356356
"The Chebyshev LCU requires 9 qubits\n",
357357
"Performing convex optimization for the Chebyshev interpolation, with degree 101\n",
358358
"Max relative error value: 0.017025127162188403\n",
359-
"time to syn: 144.70839500427246\n",
360-
"time to exe: 39.970914125442505\n",
361-
"Quantum program link: https://platform.classiq.io/circuit/329xB2Pv43hXYQ4UvExBOB47pwK\n"
359+
"time to syn: 146.27435111999512\n",
360+
"time to exe: 33.56966781616211\n",
361+
"Quantum program link: https://platform.classiq.io/circuit/32BPbtdbOD4uIQw80Xgel5Ejvjt\n"
362362
]
363363
}
364364
],
@@ -369,14 +369,15 @@
369369
" poly_degree,\n",
370370
" be_method=\"banded\",\n",
371371
" preferences=prefs,\n",
372+
" constraints=Constraints(optimization_parameter=\"width\"),\n",
372373
" qmod_name=\"qsvt_solver_banded_be\",\n",
373374
")\n",
374375
"show(qprog_banded)"
375376
]
376377
},
377378
{
378379
"cell_type": "code",
379-
"execution_count": 10,
380+
"execution_count": 9,
380381
"id": "f22c6a5a-66a3-4d57-a2e7-a877d222627d",
381382
"metadata": {},
382383
"outputs": [
@@ -389,9 +390,9 @@
389390
"The Chebyshev LCU requires 9 qubits\n",
390391
"Performing convex optimization for the Chebyshev interpolation, with degree 101\n",
391392
"Max relative error value: 0.06140234945729006\n",
392-
"time to syn: 176.10311889648438\n",
393-
"time to exe: 33.49585008621216\n",
394-
"Quantum program link: https://platform.classiq.io/circuit/329xeOYvUwP77eoIvYthT2nGPzc\n"
393+
"time to syn: 180.07041907310486\n",
394+
"time to exe: 36.84007692337036\n",
395+
"Quantum program link: https://platform.classiq.io/circuit/32BQ5DoazyihYKRCXX8zQCo9htb\n"
395396
]
396397
}
397398
],
@@ -402,24 +403,25 @@
402403
" poly_degree,\n",
403404
" be_method=\"pauli\",\n",
404405
" preferences=prefs,\n",
406+
" constraints=Constraints(optimization_parameter=\"width\"),\n",
405407
" qmod_name=\"qsvt_solver_pauli_be\",\n",
406408
")\n",
407409
"show(qprog_pauli)"
408410
]
409411
},
410412
{
411413
"cell_type": "code",
412-
"execution_count": 11,
414+
"execution_count": 10,
413415
"id": "6fd7f6dd-878d-4b1e-bde0-2e424fdea562",
414416
"metadata": {},
415417
"outputs": [
416418
{
417419
"data": {
418420
"text/plain": [
419-
"<matplotlib.legend.Legend at 0x309bee450>"
421+
"<matplotlib.legend.Legend at 0x312817c10>"
420422
]
421423
},
422-
"execution_count": 11,
424+
"execution_count": 10,
423425
"metadata": {},
424426
"output_type": "execute_result"
425427
},
@@ -459,7 +461,7 @@
459461
},
460462
{
461463
"cell_type": "code",
462-
"execution_count": 14,
464+
"execution_count": 11,
463465
"id": "d2d2c460-7d7f-4a1c-acdd-3cfb7ae7a2bd",
464466
"metadata": {},
465467
"outputs": [],

applications/cfd/linear_qls_for_hybrid_solvers/qsvt_solver_banded_be.synthesis_options.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66
"preferences": {
77
"custom_hardware_settings": {
88
"basis_gates": [
9-
"cx",
10-
"ry",
11-
"y",
9+
"h",
10+
"cy",
1211
"id",
1312
"s",
14-
"x",
15-
"r",
16-
"cy",
13+
"tdg",
14+
"rx",
1715
"sx",
16+
"cz",
17+
"p",
18+
"ry",
1819
"u",
20+
"t",
21+
"cx",
22+
"z",
23+
"r",
1924
"u2",
20-
"tdg",
21-
"u1",
22-
"p",
25+
"sxdg",
2326
"sdg",
24-
"h",
25-
"rz",
26-
"rx",
27-
"z",
28-
"t",
29-
"cz",
30-
"sxdg"
27+
"u1",
28+
"x",
29+
"y",
30+
"rz"
3131
],
3232
"is_symmetric_connectivity": true
3333
},
@@ -36,7 +36,7 @@
3636
"optimization_level": 1,
3737
"output_format": ["qasm"],
3838
"pretty_qasm": true,
39-
"random_seed": 2397616746,
39+
"random_seed": 1666132803,
4040
"synthesize_all_separately": false,
4141
"timeout_seconds": 300,
4242
"transpilation_option": "auto optimize"

0 commit comments

Comments
 (0)