Skip to content

Commit 4d46738

Browse files
matanvax2orsa-classiq
authored andcommitted
Fix pre-commit formatting
1 parent 98946b3 commit 4d46738

File tree

40 files changed

+447
-452
lines changed

40 files changed

+447
-452
lines changed

algorithms/algebraic/hidden_shift/hidden_shift.ipynb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@
285285
" )\n",
286286
"\n",
287287
"\n",
288-
"qmod_complex = create_model(\n",
289-
" main, constraints=constraints\n",
290-
") # same constraints\n",
288+
"qmod_complex = create_model(main, constraints=constraints) # same constraints\n",
291289
"qprog_complex = synthesize(qmod_complex)\n",
292290
"show(qprog_complex)"
293291
]
@@ -396,9 +394,7 @@
396394
" hidden_shift_no_dual(f_qfunc, g_qfunc, target, ind)\n",
397395
"\n",
398396
"\n",
399-
"qmod_no_dual = create_model(\n",
400-
" main, constraints=constraints\n",
401-
") # same constraints\n",
397+
"qmod_no_dual = create_model(main, constraints=constraints) # same constraints\n",
402398
"qprog_no_dual = synthesize(qmod_no_dual)\n",
403399
"show(qprog_no_dual)"
404400
]

algorithms/hamiltonian_simulation/hamiltonian_simulation_with_block_encoding/hamiltonian_simulation_with_block_encoding.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@
807807
" jacobi_anger_phases_expcos, gqsp_degree, be_hamiltonian, state\n",
808808
" )\n",
809809
"\n",
810-
" bind(state, [data, block])\n"
810+
" bind(state, [data, block])"
811811
]
812812
},
813813
{
@@ -1055,7 +1055,7 @@
10551055
" allocate(state)\n",
10561056
" inplace_prepare_amplitudes(state_to_evolve, 0.0, state.data)\n",
10571057
" qsvt_hamiltonian_evolution(phases_cos, phases_sin, be_hamiltonian, state)\n",
1058-
" bind(state, [data, block])\n"
1058+
" bind(state, [data, block])"
10591059
]
10601060
},
10611061
{
@@ -1353,7 +1353,7 @@
13531353
" be_hamiltonian,\n",
13541354
" state,\n",
13551355
" )\n",
1356-
" bind(state, [data, block])\n"
1356+
" bind(state, [data, block])"
13571357
]
13581358
},
13591359
{

algorithms/hhl/hhl/hhl.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@
826826
{
827827
"cell_type": "code",
828828
"execution_count": 17,
829-
"id": "45",
829+
"id": "44",
830830
"metadata": {
831831
"colab": {
832832
"base_uri": "https://localhost:8080/",
@@ -878,15 +878,15 @@
878878
},
879879
{
880880
"cell_type": "markdown",
881-
"id": "46",
881+
"id": "45",
882882
"metadata": {},
883883
"source": [
884884
"We explored the HHL algorithm for solving linear systems using exact and approximated Hamiltonian simulations. The exact method, with a smaller circuit depth, is computationally less intensive but lacks scalability. In contrast, the approximated method, with a greater circuit depth, offers flexibility and can handle larger, more complex systems. This trade-off underscores the importance of selecting the appropriate method based on the problem's size and complexity."
885885
]
886886
},
887887
{
888888
"cell_type": "markdown",
889-
"id": "47",
889+
"id": "46",
890890
"metadata": {},
891891
"source": [
892892
"## Technical Notes\n",
@@ -899,7 +899,7 @@
899899
},
900900
{
901901
"cell_type": "markdown",
902-
"id": "48",
902+
"id": "47",
903903
"metadata": {},
904904
"source": [
905905
"### Generalizations\n",
@@ -962,7 +962,7 @@
962962
},
963963
{
964964
"cell_type": "markdown",
965-
"id": "49",
965+
"id": "48",
966966
"metadata": {},
967967
"source": [
968968
"## References\n",

algorithms/qml/qsvm_pauli_feature_map/qsvm_pauli_feature_map.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
" invert(lambda: pauli_kernel(data2, PAULIS, AFFINES, CONNECTIVITY, REPS, qba))\n",
334334
"\n",
335335
"\n",
336-
"QSVM_PAULI_Z_ZZ = create_model(main)\n"
336+
"QSVM_PAULI_Z_ZZ = create_model(main)"
337337
]
338338
},
339339
{

algorithms/qml/quantum_autoencoder/quantum_autoencoder.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,7 @@
621621
" coded=decoded[0:NUM_ENCODING_QUBITS],\n",
622622
" trash=decoded[NUM_ENCODING_QUBITS:NUM_QUBITS],\n",
623623
" )\n",
624-
" )\n",
625-
"\n",
626-
"\n"
624+
" )"
627625
]
628626
},
629627
{

algorithms/simon/simon.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
"\n",
610610
"\n",
611611
"qmod_4 = create_model(main)\n",
612-
"# qmod_4 = update_execution_preferences(qmod_4, num_shots=50 * NUM_QUBITS)\n"
612+
"# qmod_4 = update_execution_preferences(qmod_4, num_shots=50 * NUM_QUBITS)"
613613
]
614614
},
615615
{

algorithms/vqls/lcu_vqls/vqls_with_lcu.ipynb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@
513513
},
514514
{
515515
"cell_type": "markdown",
516-
"id": "30",
516+
"id": "29",
517517
"metadata": {},
518518
"source": [
519519
"We run the classical optimizer to get the optimal parameters:"
@@ -522,7 +522,7 @@
522522
{
523523
"cell_type": "code",
524524
"execution_count": 11,
525-
"id": "31",
525+
"id": "30",
526526
"metadata": {},
527527
"outputs": [
528528
{
@@ -570,7 +570,7 @@
570570
},
571571
{
572572
"cell_type": "markdown",
573-
"id": "32",
573+
"id": "31",
574574
"metadata": {},
575575
"source": [
576576
"### Measuring the Quantum Solution\n",
@@ -581,7 +581,7 @@
581581
{
582582
"cell_type": "code",
583583
"execution_count": 12,
584-
"id": "33",
584+
"id": "32",
585585
"metadata": {},
586586
"outputs": [],
587587
"source": [
@@ -597,7 +597,7 @@
597597
{
598598
"cell_type": "code",
599599
"execution_count": 13,
600-
"id": "34",
600+
"id": "33",
601601
"metadata": {},
602602
"outputs": [],
603603
"source": [
@@ -610,7 +610,7 @@
610610
{
611611
"cell_type": "code",
612612
"execution_count": 14,
613-
"id": "35",
613+
"id": "34",
614614
"metadata": {},
615615
"outputs": [
616616
{
@@ -638,7 +638,7 @@
638638
{
639639
"cell_type": "code",
640640
"execution_count": 15,
641-
"id": "36",
641+
"id": "35",
642642
"metadata": {},
643643
"outputs": [],
644644
"source": [
@@ -647,7 +647,7 @@
647647
},
648648
{
649649
"cell_type": "markdown",
650-
"id": "37",
650+
"id": "36",
651651
"metadata": {},
652652
"source": [
653653
"### Comparing to the Classical Solution\n",
@@ -659,15 +659,15 @@
659659
},
660660
{
661661
"cell_type": "markdown",
662-
"id": "38",
662+
"id": "37",
663663
"metadata": {},
664664
"source": [
665665
"We use the explicit matrix representation in terms of numerical NumPy arrays."
666666
]
667667
},
668668
{
669669
"cell_type": "markdown",
670-
"id": "39",
670+
"id": "38",
671671
"metadata": {},
672672
"source": [
673673
"Classical calculation:"
@@ -676,7 +676,7 @@
676676
{
677677
"cell_type": "code",
678678
"execution_count": 16,
679-
"id": "40",
679+
"id": "39",
680680
"metadata": {},
681681
"outputs": [],
682682
"source": [
@@ -686,7 +686,7 @@
686686
},
687687
{
688688
"cell_type": "markdown",
689-
"id": "41",
689+
"id": "40",
690690
"metadata": {},
691691
"source": [
692692
"Calculating the classical $\\vec{x}$ that solves the equation:"
@@ -695,7 +695,7 @@
695695
{
696696
"cell_type": "code",
697697
"execution_count": 17,
698-
"id": "42",
698+
"id": "41",
699699
"metadata": {},
700700
"outputs": [
701701
{
@@ -719,7 +719,7 @@
719719
},
720720
{
721721
"cell_type": "markdown",
722-
"id": "43",
722+
"id": "42",
723723
"metadata": {},
724724
"source": [
725725
"To compare the classical to the quantum results we compute the post-processing by applying $A$ to our optimal vector $|\\psi\\rangle_o$, normalizing it, then calculating the inner product squared of this vector and the solution vector, $|b\\rangle$! We can put this all into code as follows:"
@@ -728,7 +728,7 @@
728728
{
729729
"cell_type": "code",
730730
"execution_count": 18,
731-
"id": "44",
731+
"id": "43",
732732
"metadata": {},
733733
"outputs": [
734734
{
@@ -749,7 +749,7 @@
749749
{
750750
"cell_type": "code",
751751
"execution_count": 19,
752-
"id": "45",
752+
"id": "44",
753753
"metadata": {},
754754
"outputs": [
755755
{
@@ -783,15 +783,15 @@
783783
},
784784
{
785785
"cell_type": "markdown",
786-
"id": "46",
786+
"id": "45",
787787
"metadata": {},
788788
"source": [
789789
"The classical cost function basically agrees with the algorithm result."
790790
]
791791
},
792792
{
793793
"cell_type": "markdown",
794-
"id": "47",
794+
"id": "46",
795795
"metadata": {},
796796
"source": [
797797
"## References\n",

applications/cfd/heat_eq_qsvt/heat_eq_qsvt.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@
939939
{
940940
"cell_type": "code",
941941
"execution_count": 61,
942-
"id": "26",
942+
"id": "25",
943943
"metadata": {},
944944
"outputs": [
945945
{

applications/chemistry/molecular_energy_curve/molecular_energy_curve.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
},
241241
{
242242
"cell_type": "markdown",
243-
"id": "8",
243+
"id": "7",
244244
"metadata": {},
245245
"source": [
246246
"## Graph Creation"
@@ -249,7 +249,7 @@
249249
{
250250
"cell_type": "code",
251251
"execution_count": 6,
252-
"id": "9",
252+
"id": "8",
253253
"metadata": {},
254254
"outputs": [
255255
{
@@ -280,7 +280,7 @@
280280
},
281281
{
282282
"cell_type": "markdown",
283-
"id": "10",
283+
"id": "9",
284284
"metadata": {},
285285
"source": [
286286
"This graph presents the ground state for the $H_{2}$ molecule as a function of the distance between the two hydrogen atoms. Note that both the HF solution and Classiq VQE present decent results around the global minima. For further distances, Classiq VQE stays close to the exact solution while the HF solution gradually deviates. The source of this lack of correspondence is with the lack of flexible correlations within the HF model, which is enabled within the VQE scope.\n",

0 commit comments

Comments
 (0)