pytc.vmc.optimization.evaluate_ref_var

pytc.vmc.optimization.evaluate_ref_var(ansatz, params, n_walkers=100, step_size=1.0, burn_in_steps=1000, initial_walkers=None, key=None, move_type='one', max_vmap_batch_size=0, n_eval_batches=1, n_mcmc_per_eval=1, clip_multiplier=5.0)[source]

Evaluate reference-variance / local-energy statistics at FIXED params.

Unlike optimize_ref_var, this never updates params – it exists for controlled experiments where the params must be held bit-identical across runs to isolate a single variable (walker count, burn-in, warm-start convention). It also surfaces the raw local-energy tail (clipped fraction, max|E_L|) that the production loss function discards after clipping, since that tail is the object of the W-scaling hypothesis under test.

Parameters:
  • ansatz – Wavefunction object (SlaterJastrow).

  • params – Frozen [jastrow_params, linear_coeffs] – never updated.

  • n_walkers (int) – Number of parallel walkers.

  • step_size (float) – MCMC proposal std dev.

  • burn_in_steps (int) – Burn-in steps before the first eval batch. Pass 0 when initial_walkers is an already-equilibrated checkpoint (the fresh-vs-continued-walkers experiment).

  • initial_walkers – Optional Walker state (e.g. from mcmc_utils.load_walkers) or raw positions.

  • key – PRNG key.

  • move_type (str) – “one” or “all” for MCMC electron moves.

  • max_vmap_batch_size (int) – If >0, use folx.batched_vmap for memory efficiency.

  • n_eval_batches (int) – Number of independent stat batches to record.

  • n_mcmc_per_eval (int) – MCMC steps to decorrelate walkers between batches.

  • clip_multiplier (float) – Same clipping window as the production loss (mean +/- multiplier * MAD); only used to report clipped_fraction/variance, never to modify walkers.

Returns:

“batches”: list of per-batch dicts (cost, mean_energy,

energy_mad, clipped_fraction, max_abs_local_energy, acceptance).

”final_walkers”: Walker state after the last batch, host-local

(pass to mcmc_utils.save_walkers to checkpoint).

Return type:

Dictionary with