Skip to content

Commit

Permalink
added group commutator tests
Browse files Browse the repository at this point in the history
```
  • Loading branch information
wrightjandrew committed Apr 25, 2024
1 parent 43ee596 commit 6a41ccf
Show file tree
Hide file tree
Showing 4 changed files with 545 additions and 303 deletions.
798 changes: 524 additions & 274 deletions examples/dbi/dbi_cost_functions_and_d_gradients_tutorial.ipynb

Large diffs are not rendered by default.

Empty file.
48 changes: 20 additions & 28 deletions examples/dbi/dbi_misc.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/qibo/models/dbi/double_bracket.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def backend(self):

def least_squares(self, d: np.array):
"""Least squares cost function. (without the constant term norm(H))"""
h_np = np.diag(np.diag(self.backend.to_numpy(self.h.matrix)))
h_np = self.backend.to_numpy(self.h.matrix)

return np.real(0.5 * np.linalg.norm(d) ** 2 - np.trace(h_np @ d))

Expand Down

0 comments on commit 6a41ccf

Please sign in to comment.