Skip to content

Fix Compute_Ratio_Global call sites for log-scale signature change#603

Merged
johanneshofmann87 merged 6 commits into601-global-moves-with-proposal-probability-on-log-scalefrom
copilot/add-global-moves-log-scale
Feb 16, 2026
Merged

Fix Compute_Ratio_Global call sites for log-scale signature change#603
johanneshofmann87 merged 6 commits into601-global-moves-with-proposal-probability-on-log-scalefrom
copilot/add-global-moves-log-scale

Conversation

Copy link

Copilot AI commented Feb 16, 2026

Compute_Ratio_Global signature changed to accept log_T0_proposal_ratio but two call sites (Langevin HMC and parallel tempering) were not updated.

Changes

Prog/Langevin_HMC_mod.F90

  • Variable: T0_Proposal_ratiolog_T0_Proposal_ratio
  • Value: 1.00.0d0
  • Function call updated to pass log value

Prog/Global_mod.F90 (Exchange_Step)

  • Variable: T0_Proposal_ratiolog_T0_Proposal_ratio
  • Value: 1.d00.d0
  • Function call updated to pass log value
! Before (causes type mismatch)
T0_Proposal_ratio = 1.0
Ratiotot = Compute_Ratio_Global(..., T0_Proposal_ratio, ...)

! After (log scale)
log_T0_Proposal_ratio = 0.0d0  ! log(1.0) = 0
Ratiotot = Compute_Ratio_Global(..., log_T0_Proposal_ratio, ...)

All three call sites in the codebase now use the log-scale interface consistently.

Original prompt

This section details on the original issue you should resolve

<issue_title>Global moves with proposal probability on log scale</issue_title>
<issue_description>

In some cases, the proposal probability can be extreamly small or large, reaching the range of double precision. This will cause numerical issues. Hence, the goal is to provide a new subroutine where the T0_proposal_ratio will be on a logarithmic scale. The base implementation can be a wrapper of the current Global_move function to maintain backwards compatibility.</issue_description>

<agent_instructions>There is already an initial implementation of the issue, which introduced the function Global_move_log_T0. In some cases, the proposal probability can be balanced by the Delta_S0_global, so I modified the if condition on low probability in the last commit.
Please check for correctness and possible further improvements.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 16, 2026 12:24
Co-authored-by: johanneshofmann87 <129625831+johanneshofmann87@users.noreply.github.com>
Co-authored-by: johanneshofmann87 <129625831+johanneshofmann87@users.noreply.github.com>
Co-authored-by: johanneshofmann87 <129625831+johanneshofmann87@users.noreply.github.com>
Copilot AI changed the title [WIP] Add global moves with proposal probability on log scale Add Global_move_log_T0 for numerical stability with extreme proposal probabilities Feb 16, 2026
Co-authored-by: johanneshofmann87 <129625831+johanneshofmann87@users.noreply.github.com>
Copilot AI changed the title Add Global_move_log_T0 for numerical stability with extreme proposal probabilities Fix Compute_Ratio_Global call sites for log-scale signature change Feb 16, 2026
@johanneshofmann87 johanneshofmann87 changed the base branch from master to 601-global-moves-with-proposal-probability-on-log-scale February 16, 2026 13:04
@johanneshofmann87 johanneshofmann87 marked this pull request as ready for review February 16, 2026 13:16
@johanneshofmann87 johanneshofmann87 merged commit b05925a into 601-global-moves-with-proposal-probability-on-log-scale Feb 16, 2026
164 of 165 checks passed
@johanneshofmann87 johanneshofmann87 deleted the copilot/add-global-moves-log-scale branch February 16, 2026 13:55
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.

Global moves with proposal probability on log scale

2 participants