We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
Additional Context Add any other background information about the problem.
The text was updated successfully, but these errors were encountered:
Note: This issue should be closed.
Sorry, something went wrong.
No branches or pull requests
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
Additional Context
Add any other background information about the problem.
The text was updated successfully, but these errors were encountered: