bqth29 / simulated-bifurcation-algorithm

Python CPU/GPU implementation of the Simulated Bifurcation (SB) algorithm to solve quadratic optimization problems (QUBO, Ising, TSP, optimal asset allocations for a portfolio, etc.).
MIT License
103 stars 25 forks source link

Energy-wise stop window #31

Closed bqth29 closed 10 months ago

bqth29 commented 11 months ago

πŸ’¬ Pull Request Description

Following the discussion #30, we decided to slightly change the behavior of the stop window so that the energy is the convergence criterion instead of the spins. This allows to deal with the cases in which there are degenerate energy levels. Thus, even though the spins may oscillate in a constant-energy-space, they would still be considered as steady by the window as they account for the same energy.

Besides, since the Ising energy is the objective function that SB seeks to minimize, setting it as the convergence criterion makes perfect sense.

βœ”οΈ Check list

Before you open the pull request, make sure the following requirements are met.

πŸš€ New features

No new feature was added, except that the stop window now focuses on the energy of the agents instead of the spins.

🐞 Bug fixes

None.

πŸ“£ Supplementary information

None.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Files Coverage Ξ”
...ation/optimizer/simulated_bifurcation_optimizer.py 100.00% <ΓΈ> (ΓΈ)
src/simulated_bifurcation/optimizer/stop_window.py 100.00% <100.00%> (ΓΈ)
tests/test_stop_window.py 100.00% <100.00%> (ΓΈ)

:loudspeaker: Thoughts on this report? Let us know!.