Commit d5cde76
committed
fix(pa): track best per sweep, reject heating, fix CI ruff format
Three fixes following a textbook-correctness audit of population_annealing
(see tasks/test/audit_pa_textbook.py, 11/11 passes):
* Track best_obj after every MCMC sweep, not just at temperature-step
boundaries. Matches qqa.simulated_annealing semantics; previously PA
could miss low-energy transients within a K-sweep batch and report a
worse best_obj than SA on the same trajectory (PA -45 vs SA -48 in the
Δβ=0 head-to-head test on 20-node ER MaxCut).
* Reject heating schedules (beta_end < beta_start) at the API boundary
with ValueError; PA reweighting requires non-decreasing β, otherwise it
silently up-weights the wrong replicas.
* Re-format tests/test_gui_apptest.py to match ruff's CI-scope
invocation. The previous push passed ``ruff format --check .`` locally
but failed CI's ``ruff format --check src tests scripts app`` after a
follow-up edit slipped through unformatted (CI run 24631948353).1 parent 3a49e72 commit d5cde76
2 files changed
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
183 | 192 | | |
184 | 193 | | |
185 | 194 | | |
| |||
252 | 261 | | |
253 | 262 | | |
254 | 263 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
261 | 272 | | |
262 | 273 | | |
263 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 412 | + | |
415 | 413 | | |
416 | 414 | | |
417 | 415 | | |
| |||
0 commit comments