1QB-Information-Technologies / ccvm

Solve continuous non-convex optimization problems with Coherent Continous-Variable Machine (CCVM) architectures and solvers
GNU Affero General Public License v3.0
9 stars 0 forks source link

Investigate why ccvm_boxqp_plot.py is generating NaN in the metadata #187

Closed KatieO4t1qbit closed 6 months ago

KatieO4t1qbit commented 6 months ago

The ccvm_boxqp_plot.py script cannot be run due to the NaN causing the error reported in #186.

However, the script worked before, I think the issue was introduced somewhere between commit 896897444a4dd473ef590f01062f10f50ab153c8 and commit 3f4b1d9c0eb482685e2305da3d6895345e73e732

UPDATE: This commit seems to be the culprit: 4010bedf4af6d8d9627be872d7adb66b039d3bd6

KatieO4t1qbit commented 6 months ago

My investigation has found that the cause of the bug was from decreasing DL_SCALING_MULTIPLIER from 0.5 to 0.2 (for DL solver, but this is probably true for the equivalent of other solvers). @FarhadK-1QBit, your comment here seems to indicate that this change improves results when using the newer instances. I thought we updated our instances, but can you please take a look and confirm whether this value should be reverted to 0.5 or whether the instance needs to be updated?

FarhadK-1QBit commented 6 months ago

@KatieO4t1qbit , the parameter DL_SCALING_MULTIPLIER should be 0.2 here. This change was intentional. I believe the example files were updated in the PR that made this change so that they don't produce error.

The bottom line is that there are some input variables (in this case pump = 2.0) that can produce invalid results and that cannot be avoided. What we can do now is to produce an error if any of the solution variables or the best objective value is NaN saying that the output is NaN and that the parameters need to be updated.

It is part of the future developments to give a range of values to the user who would know what values would produce valid results but that's a much longer process to implement.

My proposal for a quick solution now is just to identify if there is a Nan value in the json file and give an error that the says "The parameters provided are out of the range of validity of the solver. Please update the input parameters" or something along those lines. For that specific PR that we're getting the error I've suggested a change in the parameters that would get rid of the error.

KatieO4t1qbit commented 6 months ago

Thank you, Farhad! I'll close this issue since changing the pump value fixed the script. There's a different issue for handling the error, so I'll post your suggestion on how to handle it into that ticket :)