dwavesystems / dwavebinarycsp

Map constraint satisfaction problems with binary variables to binary quadratic models.
https://docs.ocean.dwavesys.com/projects/binarycsp/en/latest
Apache License 2.0
19 stars 27 forks source link

Lots of new warnings on an old problem #91

Closed JoelPasvolsky closed 4 years ago

JoelPasvolsky commented 4 years ago

Description I reran dwavebinarycsp.stitch() on my old multi-gate circuit for the first time in months.

def logic_circuit(a, b, c, d, z):
    not1 = not b
    or2 = b or c
    and3 = a and not1
    or4 = or2 or d
    and5 = and3 and or4
    not6 = not or4
    or7 = and5 or not6
    return (z == or7)

csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
csp.add_constraint(logic_circuit, ['a', 'b', 'c', 'd', 'z'])

It now outputs a lot of warnings:

>>> bqm = dwavebinarycsp.stitch(csp)
...scipy\optimize\_linprog_util.py:763: OptimizeWarning: A_eq does not appear to be of full row rank. To improve performance, check the problem formulation for redundant equality constraints.
  warn(redundancy_warning, OptimizeWarning)
...penaltymodel\lp\generation.py:150: OptimizeWarning: Solving system with option 'cholesky':True failed. It is normal for this to happen occasionally, especially as the solution is approached. However, if you see this frequently, consider setting option 'cholesky' to False.
  A_ub=unnoted_matrix, b_ub=unnoted_bound, bounds=bounds)
...penaltymodel\lp\generation.py:150: OptimizeWarning: Solving system with option 'sym_pos':True failed. It is normal for this to happen occasionally, especially as the solution is approached. However, if you see this frequently, consider setting option 'sym_pos' to False.
  A_ub=unnoted_matrix, b_ub=unnoted_bound, bounds=bounds)
...scipy\optimize\_linprog_ip.py:110: LinAlgWarning: Ill-conditioned matrix (rcond=3.36003e-18): result may not be accurate.
  return sp.linalg.solve(M, r, sym_pos=sym_pos)

Steps To Reproduce Given above

Expected Behavior Previously it ran silently. It can be a good thing to present users with more information about the construction of the BQM and its limitations, but I am concerned that this will be more scary than useful for most new users. They won't know what to make of these warnings and might conclude that the method failed or gave bad results.

Maybe any non-critical warnings can be suppressed unless the user turns on a verbose flag?

Environment

Additional Context dwave-ocean-sdk==1.5.0 dwavebinarycsp==0.0.12 penaltymodel==0.16.2 penaltymodel-cache==0.4.0 penaltymodel-lp==0.1.0 penaltymodel-mip==0.2.1

arcondello commented 4 years ago

I believe this is caused by https://github.com/dwavesystems/penaltymodel/issues/102

m3ller commented 4 years ago

Since dwavesystems/penaltymodel#102 has been resolved, this issue can be closed.