Skip to content

Exact-solve for ground state in MockDWaveSampler on small problems#476

Merged
randomir merged 8 commits intodwavesystems:masterfrom
randomir:fix-mock-sampler-ground-state-on-small-problems
Oct 28, 2022
Merged

Exact-solve for ground state in MockDWaveSampler on small problems#476
randomir merged 8 commits intodwavesystems:masterfrom
randomir:fix-mock-sampler-ground-state-on-small-problems

Conversation

@randomir
Copy link
Member

By default, problems of size 16 and smaller will be sampled with greedy sampler and then an ExactSolver-determined ground state will be injected.

Implements a suggestion from #474 (comment).

Close #474.

@randomir randomir force-pushed the fix-mock-sampler-ground-state-on-small-problems branch from 042345f to 7b06046 Compare October 27, 2022 15:31
@randomir randomir force-pushed the fix-mock-sampler-ground-state-on-small-problems branch from efa503a to 2bbc9fb Compare October 28, 2022 14:22
@randomir randomir requested a review from jackraymond October 28, 2022 14:26
Scipy 1.9.3 on python 3.10 on windows has issues with numpy
compatibility; pin to an older version (that works across the whole
range of supported pythons) as a temporary workaround.

Note: scipy is used (only) by dwave-drivers, i.e. only by
`VirtualGraphComposite` in dwave-system.
@randomir randomir force-pushed the fix-mock-sampler-ground-state-on-small-problems branch from 2bbc9fb to e1d0f25 Compare October 28, 2022 14:34
Copy link
Contributor

@jackraymond jackraymond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps docstring could be improved, since it is not clear how sampleset are impacted. Perhaps the docstring for the sample function would be the appropriate place.
Functionally looks good, I wonder if it would be a good idea to set an explicit upper bound on exact_solver_cutoff to prevent users being surprised by slow regimes or ExactSolver errors.

@randomir
Copy link
Member Author

randomir commented Oct 28, 2022

Thanks @jackraymond, I updated the docstring as suggested, except that I kept a reference to ExactSolver (IMO, it's important for users to understand why and how slow this can get), and I did not impose an upper bound on the cutoff (the default is fine, and if someone decides to modify it, they should read the docs and understand the consequences - which are now much clearer, I think, thanks to your suggestions).

@randomir randomir force-pushed the fix-mock-sampler-ground-state-on-small-problems branch from e0546a5 to d870d58 Compare October 28, 2022 19:08
@randomir randomir merged commit 97ac44f into dwavesystems:master Oct 28, 2022
@randomir randomir deleted the fix-mock-sampler-ground-state-on-small-problems branch October 28, 2022 19:21
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

Successfully merging this pull request may close these issues.

Allow greedy substitute sampler in MockDWaveSampler to try harder

3 participants