Skip to content

Commit 1ad79d2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cc33ffe commit 1ad79d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/qibo/hamiltonians/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,16 @@ def term(index: int):
503503
ind_j, ind_k = int(ind_j), int(ind_k)
504504
x_j = term(ind_j)
505505
x_k = term(ind_k)
506-
hamiltonian += float(adjacency_matrix[ind_j, ind_k]) * (x_j + x_k - 2 * x_j * x_k)
506+
hamiltonian += float(adjacency_matrix[ind_j, ind_k]) * (
507+
x_j + x_k - 2 * x_j * x_k
508+
)
507509

508510
if penalty_coeff != 0.0:
509511
penalty = 0
510512
for elem, weight in enumerate(node_weights):
511-
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+
)
512516

513517
hamiltonian += penalty_coeff * (penalty**2)
514518

0 commit comments

Comments
 (0)