Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dwavebinarycsp ignoring min_classical_gap #75

Closed
JoelPasvolsky opened this issue Mar 1, 2019 · 1 comment
Closed

dwavebinarycsp ignoring min_classical_gap #75

JoelPasvolsky opened this issue Mar 1, 2019 · 1 comment

Comments

@JoelPasvolsky
Copy link
Contributor

Description

Setting a min_classical_gap to a non-default values does not affect the BQM from stich()

Steps To Reproduce
In [3]: csp_eq = dwavebinarycsp.ConstraintSatisfactionProblem('SPIN')
In [4]: csp_ne = dwavebinarycsp.ConstraintSatisfactionProblem('SPIN')
In [5]: csp_eq.add_constraint(operator.eq, ['a', 'b'])
In [6]: csp_ne.add_constraint(operator.ne, ['a', 'c'])
In [7]: bqm_eq = dwavebinarycsp.stitch(csp_eq, min_classical_gap=2.0, max_graph_size=2)
In [8]: bqm_ne = dwavebinarycsp.stitch(csp_ne, min_classical_gap=4.0, max_graph_size=2)
In [9]: bqm_ne
Out[9]: BinaryQuadraticModel({'a': 0.0, 'c': 0.0}, {('a', 'c'): 1.0}, 1.0, Vartype.SPIN)
In [10]: bqm_eq
Out[10]: BinaryQuadraticModel({'a': 0, 'b': 0}, {('a', 'b'): -1}, 0.0, Vartype.SPIN)

Difference between energies for gap of 2 is correct:

In [11]: bqm_eq.energy({'a': -1, 'b':-1})
Out[11]: -1.0
In [12]: bqm_eq.energy({'a': -1, 'b':1})
Out[12]: 1.0

Difference between energies for gap of 4 is incorrect (still 2):

In [14]: bqm_ne.energy({'a': -1, 'c':1})
Out[14]: 0.0
In [15]: bqm_ne.energy({'a': -1, 'c':-1})
Out[15]: 2.0

Expected Behavior
A different BQM based on the gap set

Environment

  • OS: Windows 10
  • Python version: 3.something_supported

Additional Context
Add any other background information about the problem.

@m3ller
Copy link
Contributor

m3ller commented Mar 18, 2019

Note: This issue should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants