netket.errors.InsufficientSamplesForSRWarning

netket.errors.InsufficientSamplesForSRWarning#

exception netket.errors.InsufficientSamplesForSRWarning[source]#

Warning issued when using Stochastic Reconfiguration (SR) with insufficient samples.

This warning is raised when the number of samples is less than or equal to the number of parameters in a Stochastic Reconfiguration calculation. In this regime, the standard QGT-based formulation of SR becomes inefficient and potentially unstable.

Why this matters#

The standard SR/Natural Gradient Descent computes updates as:

\[\delta \theta = \tau (X^TX + \lambda \mathbb{I}_{N_P})^{-1} X^T E^{loc}\]

where \(X \in \mathbb{R}^{N_s \times N_p}\) is the Jacobian of the log-wavefunction, with \(N_p\) the number of parameters and \(N_s\) the number of samples.

When \(N_s \leq N_p\), the matrix \(X^TX\) has rank at most \(N_s\), making it severely under-determined and requiring large regularization. This leads to poor convergence and potentially unstable optimization.