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

More efficient stop window #55

Open bqth29 opened 8 months ago

bqth29 commented 8 months ago

💬 Pull Request Description

When the Stop Window detects that an agent has converged, it is stored in the window's memory and a boolean tensor is sent back to the optimizer to indicate which agents still have not converged. Thus, the oscillators corresponding to converged agents are removed which reduces the computation size and time.

✔️ Check list

🚀 New features

None.

🐞 Bug fixes

None.

📣 Supplementary information

None.

codecov[bot] commented 8 months ago

Codecov Report

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

Project coverage is 100.00%. Comparing base (6194a9e) to head (5f22d94).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #55 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 36 36 Lines 1600 1537 -63 ========================================= - Hits 1600 1537 -63 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bqth29 commented 4 months ago

Possible bug when combining this new window with the keyboard interrupt feature from #51: if the user stops the optimization manually between the moment when the window is reduced but not the oscillators in the optimizer, this may create shape conflicts when combining both in the final spins that are returned. Need to discuss this.