Skip to content

Commit

Permalink
Improve error message in MISProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroPierro committed Jul 27, 2023
1 parent cc628a5 commit 9935ca7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lava/lib/optimization/utils/generators/mis.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def get_qubo_matrix(self, w_diag: int = 1, w_off: int = 4) -> np.ndarray:
"""
if w_off <= 2 * w_diag:
raise ValueError(
"Off-diagonal weights must be > 2 x diagonal weights."
"Off-diagonal weights must be > 2 x diagonal weights to ensure"
"a correct formulatin of the problem."
)
q = -w_diag * np.eye(self.num_vertices) + w_off / 2 * self._adjacency
return q.astype(int)
Expand Down

0 comments on commit 9935ca7

Please sign in to comment.