Skip to content

wang-landau: free_energy_kT is max(ln g) - ln g - #185

Merged
mlund merged 1 commit into
mainfrom
fix/158-wl-free-energy-sign
Nov 24, 2026
Merged

mlund merged 1 commit into
mainfrom
fix/158-wl-free-energy-sign

Conversation

@mlund

@mlund mlund commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Fixes #158.

  • The +kT ln g bias flattens sampling when ln g = −F/kT + c, so the column held −F. Now F/kT = max(ln g) − ln g (1D and 2D), minimum 0.
  • Tests: unit test on the written file; integration test tests/wang_landau.rs runs WL on the umbrella_1d linear potential and checks the slope against f/kT (0.410 vs 0.401 kT/Å; −0.410 before the fix). 0.6 s.
  • examples/calvados3/plot_pmf.py: drop the negation that compensated (disabled block).
  • Breaking: existing free_energy.csv files have the opposite sign.

The +kT ln g bias flattens sampling when ln g = -F/kT + c, so the
column held -F. Tested against the analytic slope of a linear potential.
@mlund
mlund merged commit 492ecf0 into main Nov 24, 2026
2 checks passed
@mlund
mlund deleted the fix/158-wl-free-energy-sign branch November 24, 2026 08:46
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.

Wang-Landau free_energy_kT column has the wrong sign

1 participant