Skip to content

Commit fcbe3b0

Browse files
corrected hhl lanchester
1 parent d1bd323 commit fcbe3b0

File tree

2 files changed

+19
-25
lines changed

2 files changed

+19
-25
lines changed

algorithms/differential_equations/hhl_lanchester/hhl_lanchester.ipynb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,7 @@
615615
"def main(indicator: Output[QBit], test: Output[QBit]) -> None:\n",
616616
"\n",
617617
" state = QArray()\n",
618-
" # free(state)\n",
619-
"\n",
620618
" compared_state = QArray()\n",
621-
" # free(compared_state)\n",
622619
" rescaled_eig = QNum()\n",
623620
" allocate(QPE_RESOLUTION_SIZE, UNSIGNED, QPE_RESOLUTION_SIZE, rescaled_eig)\n",
624621
" prepare_amplitudes(b_list, 0, state)\n",
@@ -661,10 +658,7 @@
661658
"outputs": [],
662659
"source": [
663660
"MAX_WIDTH_SWAP_TEST = 25\n",
664-
"constraints = Constraints(\n",
665-
" max_width=MAX_WIDTH_SWAP_TEST,\n",
666-
" # optimization_parameter=OptimizationParameter.DEPTH,\n",
667-
")\n",
661+
"constraints = Constraints(max_width=MAX_WIDTH_SWAP_TEST)\n",
668662
"preferences = Preferences(\n",
669663
" optimization_level=0, optimization_timeout_seconds=90, transpilation_option=\"none\"\n",
670664
")\n",
@@ -692,7 +686,7 @@
692686
"name": "stdout",
693687
"output_type": "stream",
694688
"text": [
695-
"Quantum program link: https://platform.classiq.io/circuit/35jejQgpemeARnyckevOUff3PsD\n"
689+
"Quantum program link: https://platform.classiq.io/circuit/35tN4TKVCACNL14VMInDJb2alDZ\n"
696690
]
697691
}
698692
],
@@ -740,7 +734,7 @@
740734
"name": "stdout",
741735
"output_type": "stream",
742736
"text": [
743-
"Fidelity between basic HHL and classical solutions: 0.9575437746802776\n"
737+
"Fidelity between basic HHL and classical solutions: 0.9526849928765404\n"
744738
]
745739
}
746740
],
@@ -794,7 +788,7 @@
794788
"name": "stdout",
795789
"output_type": "stream",
796790
"text": [
797-
"Quantum program link: https://platform.classiq.io/circuit/35jewVJCfz6qFWnj4neZxImOmxh\n"
791+
"Quantum program link: https://platform.classiq.io/circuit/35tNJgp5JBnQjy397u9i5ZqNFvs\n"
798792
]
799793
}
800794
],

algorithms/differential_equations/hhl_lanchester/hhl_lanchester.synthesis_options.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@
77
"preferences": {
88
"custom_hardware_settings": {
99
"basis_gates": [
10-
"ry",
11-
"id",
12-
"u1",
1310
"x",
11+
"rz",
12+
"cx",
13+
"p",
1414
"s",
15+
"u1",
16+
"sxdg",
1517
"u",
16-
"cz",
17-
"h",
18+
"rx",
1819
"tdg",
19-
"rz",
20-
"sdg",
21-
"sxdg",
20+
"r",
2221
"sx",
23-
"cx",
22+
"h",
2423
"z",
25-
"rx",
26-
"p",
27-
"t",
28-
"cy",
24+
"cz",
2925
"u2",
3026
"y",
31-
"r"
27+
"sdg",
28+
"id",
29+
"cy",
30+
"ry",
31+
"t"
3232
],
3333
"is_symmetric_connectivity": true
3434
},
@@ -38,7 +38,7 @@
3838
"optimization_timeout_seconds": 90,
3939
"output_format": ["qasm"],
4040
"pretty_qasm": true,
41-
"random_seed": 2019804740,
41+
"random_seed": 3201343675,
4242
"synthesize_all_separately": false,
4343
"timeout_seconds": 300,
4444
"transpilation_option": "none"

0 commit comments

Comments
 (0)