pytc.vmc.sampling.sample

pytc.vmc.sampling.sample(ansatz, n_walkers=100, n_steps=1000, step_size=1.0, thinning=10, burn_in_steps=1000, initial_walkers=None, use_importance_sampling=False, params=None, key=None, move_type='one', report_interval=100, max_vmap_batch_size=0)[source]

Perform MCMC sampling for quantum wavefunction.

Parameters:
  • ansatz – Wavefunction object with __call__ method that returns ψ(R)

  • n_walkers (int) – Number of parallel walkers

  • n_steps (int) – Number of MCMC steps for each walker

  • step_size (float) – Standard deviation of Gaussian proposal for regular MCMC or time step for importance sampling (typically 0.01-0.05)

  • thinning (int) – Keep only every thinning steps to reduce autocorrelation

  • burn_in_steps (int) – Number of initial MCMC steps to discard (equilibration)

  • initial_walkers – Optional initial positions, otherwise initialized near nuclei

  • use_importance_sampling (bool) – Whether to use importance sampling with drift

  • params – Parameters for the ansatz, including jastrow and linear coefficients

  • key – PRNG key

  • move_type (str)

  • report_interval (int)

  • max_vmap_batch_size (int)

Returns:

Dictionary with sampling results and statistics

Return type:

Dict[str, Any]