Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

HMC Parameters

Tuning the Hybrid Monte Carlo (HMC) updating scheme in ALF. HMC is available for models with continuous auxiliary fields (OP_V%type=3).

Reference: The algorithm is derived in the documentation (PDF), Section on Hybrid Monte Carlo.

Parameters

All HMC parameters are set in the &VAR_QMC namelist in the parameters file.

ParameterDefaultTypeDescription
HMC.false.LogicalEnable HMC updates
Delta_t_Langevin_HMC0.0RealLeap-frog integration step size δtm\delta t_m
Leapfrog_Steps0IntegerNumber of leap-frog steps NLFN_\text{LF} per trajectory
N_HMC_sweeps1IntegerNumber of HMC trajectories between sequential sweeps
Sequential.true.LogicalKeep sequential single-site updates active alongside HMC

The trajectory length is TmT_m = Delta_t_Langevin_HMC × Leapfrog_Steps.

Example

&VAR_QMC
HMC                    = .true.
Sequential             = .true.
Delta_t_Langevin_HMC   = 0.1d0
Leapfrog_Steps         = 10
N_HMC_sweeps           = 5
NSweep                 = 100
NBin                   = 20
Nwrap                  = 10
/

Guidelines

Step Size and Acceptance Rate

The leap-frog integrator introduces an O(δtm2)\mathcal{O}(\delta t_m^2) discretization error in the Hamiltonian. The Metropolis accept/reject step corrects for this, but large errors lead to low acceptance.

Trajectory Length

Combining with Sequential Updates

Always keep Sequential = .true. when using HMC. The documentation explicitly warns:

“In order to address potential ergodicity issues it is crucial to integrate both sequential and hybrid molecular dynamics moves, rather than relying solely on hybrid molecular dynamics.”

N_HMC_sweeps controls how many HMC trajectories are performed between sequential sweeps. Increasing this value shifts the balance toward HMC moves.

Mass Matrix (Apply_B_HMC)

The HMC Hamiltonian is:

H(p,s)=12pTM1p+S(s)H(\mathbf{p}, \mathbf{s}) = \frac{1}{2} \mathbf{p}^T M^{-1} \mathbf{p} + S(\mathbf{s})

where MM is a positive-definite mass matrix. It is factored as M1=BTBM^{-1} = B^T B, with the constraint Ker(B)={0}\text{Ker}(B) = \{0\}.

By default, M=1M = \mathbf{1} (identity) — the base implementation of Apply_B_HMC in the code is a no-op.

A non-trivial mass matrix can precondition the dynamics:

To use a custom mass matrix, override the Apply_B_HMC subroutine in your Hamiltonian submodule. It receives a force/momentum array and a logical flag ltrans:

Note: No shipped Hamiltonians currently override Apply_B_HMC. This is an advanced feature for users who understand the mode structure of their model.

Validation

The documentation provides a validation benchmark: 6-site Hubbard chain at βt=4\beta t = 4:

MethodH\langle H \rangle
HMC only2.81715±0.00023-2.81715 \pm 0.00023
Discrete sequential2.81706±0.00013-2.81706 \pm 0.00013

Use small exact-diagonalization benchmarks like this to validate your HMC setup before production runs.

Known Pitfalls