Fix halved potential weight in the Metropolis changePath action - #2
Open
RichardHoekstra wants to merge 1 commit into
Open
Conversation
The (1/2.0) factor multiplied the entire ΔE bracket, including the VTrial(s, xt) and V(s, j) potential terms. But V()/VTrial() already carry their own 1/2 (e.g. the harmonic potential returns x²/2), so the potential entered the action at half its correct weight. The sampler then drew from an effective oscillator with ω² = 1/2, whose harmonic ground-state energy is 1/√2 ≈ 0.707 rather than the exact 0.5. Scope the 1/2 to the two kinetic links only, and add the potential difference (VTrial - V) at full weight, in all three (j==end / j==0 / bulk) branches. Verified against an independent reimplementation of the same update rule: the corrected version converges to the harmonic E₀ = 0.5 within Monte Carlo error across time-step and seed variations, while the original sits at 0.707 and stays biased under time-step refinement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
(1/2.0)factor inchangePath()'sΔEmultiplies the whole bracket, including theVTrial(s, xt)andV(s, j)potential terms. ButV()/VTrial()already carry their own1/2(the harmonic potential returnsx²/2), so the potential enters the discretized action at half its intended weight.The effect is physical, not cosmetic: the sampler draws from an effective oscillator with
ω² = 1/2, whose harmonic ground state is1/√2 ≈ 0.707instead of the exact0.5.Fix: scope the
1/2to the two kinetic links only, and add the potential difference(VTrial - V)at full weight — in all three (j == end/j == 0/ bulk) branches, so the kinetic and potential parts of the discretized Euclidean action carry their correct relative weight:Verification: against an independent reimplementation of the same Metropolis update, the corrected rule converges to the harmonic
E₀ = 0.5within Monte Carlo error across several time-step and seed choices, and tightens toward0.5underΔτrefinement. The original rule sits at0.707and stays biased asΔτ → 0, i.e. it is a genuine physical bias rather than a discretization artifact.Scope kept minimal — only the
ΔEweighting is touched.