We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc33ffe commit 1ad79d2Copy full SHA for 1ad79d2
src/qibo/hamiltonians/models.py
@@ -503,12 +503,16 @@ def term(index: int):
503
ind_j, ind_k = int(ind_j), int(ind_k)
504
x_j = term(ind_j)
505
x_k = term(ind_k)
506
- hamiltonian += float(adjacency_matrix[ind_j, ind_k]) * (x_j + x_k - 2 * x_j * x_k)
+ hamiltonian += float(adjacency_matrix[ind_j, ind_k]) * (
507
+ x_j + x_k - 2 * x_j * x_k
508
+ )
509
510
if penalty_coeff != 0.0:
511
penalty = 0
512
for elem, weight in enumerate(node_weights):
- penalty += float(weight) * (term(elem) - symbols.I(elem, backend=backend) / 2)
513
+ penalty += float(weight) * (
514
+ term(elem) - symbols.I(elem, backend=backend) / 2
515
516
517
hamiltonian += penalty_coeff * (penalty**2)
518
0 commit comments