-
Notifications
You must be signed in to change notification settings - Fork 81
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
Unexpected behaviour for dimod.make_quadratic #1385
Comments
In the def eval_energy(merged_dict, X):
''' evaluate energy of PUSO/BUSO '''
energy = 0.
for idx, val in merged_dict.items():
energy += val * np.prod([X[int(i)] for i in idx]) # <--- change here
return energy and you should get agreement in the energies. That's also why flipping the sign of the strength gets agreement. |
You are totally right, thanks a lot for looking at this! If you don't mind, I would like to add an additional question: A bit more context if you have time: |
Correct. Though be aware the the variable type does affect the number of aux variables. See dimod/dimod/higherorder/utils.py Line 321 in 23c4b52
Yeah, there are many different methods. They cite a few in that paper. I don't know of an inclusive list. My guess is that they are using additional aux variables to keep the total bias applied to any one variable low. You can "spread out" the bias with additional aux variables. We don't do that in Hope this helps! |
Description
dimod.make_quadratic has a keyword argument
strength
. According to the docs, this variable should take positive values. However, positive values seem to return incorrect results, while negative values do work.To Reproduce
Expected behavior
The 2 plots generated by the code above should be similar (as they represent the energy landscape before and after quadratization). This isn't the case for positive values of
strength
, while it is for negative valuesEnvironment:
The text was updated successfully, but these errors were encountered: