Skip to content

Fix halved potential weight in the Metropolis changePath action - #2

Open
RichardHoekstra wants to merge 1 commit into
tsotchke:mainfrom
RichardHoekstra:fix/changepath-potential-action-weight
Open

Fix halved potential weight in the Metropolis changePath action#2
RichardHoekstra wants to merge 1 commit into
tsotchke:mainfrom
RichardHoekstra:fix/changepath-potential-action-weight

Conversation

@RichardHoekstra

Copy link
Copy Markdown

The (1/2.0) factor in changePath()'s ΔE multiplies the whole bracket, including the VTrial(s, xt) and V(s, j) potential terms. But V()/VTrial() already carry their own 1/2 (the harmonic potential returns x²/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 is 1/√2 ≈ 0.707 instead of the exact 0.5.

Fix: 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, so the kinetic and potential parts of the discretized Euclidean action carry their correct relative weight:

ΔE = (1/2)[ (Δx_new)² − (Δx_old)² ] / Δτ²  +  [ V(xt) − V(x_j) ]

Verification: against an independent reimplementation of the same Metropolis update, the corrected rule converges to the harmonic E₀ = 0.5 within Monte Carlo error across several time-step and seed choices, and tightens toward 0.5 under Δτ refinement. The original rule sits at 0.707 and stays biased as Δτ → 0, i.e. it is a genuine physical bias rather than a discretization artifact.

Scope kept minimal — only the ΔE weighting is touched.

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>
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.

1 participant