shinmorino / sqaod

Solvers/annealers for simulated quantum annealing on CPU and CUDA(NVIDIA GPU).
https://github.com/shinmorino/sqaod/wiki
Other
83 stars 21 forks source link

Dense graph solvers are unable to accept upper/lower trianglar matrices. #57

Closed shinmorino closed 6 years ago

shinmorino commented 6 years ago

All dense graph solvers are able to deal only with symmetric matrices. symmetrize() has been added to enable upper/lower triangle matrices, there's a misunderstanding on the equation.

Fix:

  1. Check if a given matrix is symmetric. 1-1. If symmetric, the matrix will be used as is.
  2. If asymmetric, check if the matrix is upper/lower triangular. 2-1 If triangular, symmetrize the mat.
  3. Error: Raise exception.

This fix will be applied to all dense graph solvers and functions.

shinmorino commented 6 years ago

Fixes are committed at 45d9005ead85e4733c680a0b68a8a6e8561d6599. Tests have been added. Py and CPU modules have been tested.

shinmorino commented 6 years ago

This bug is from beta2. Before beta2, sqaod is assumed to accept only symmetric matrices, and beta2 is also able to handle symmetric matrices.

shinmorino commented 6 years ago

Done. 7145fca0115c26810e741786ce1df1f054eb34c6.