quantax.optimizer.SpringUpdater#

class quantax.optimizer.SpringUpdater#

Bases: Updater

The SPRING update, a variant of SR with momentum stored in the phi buffer.

If the proposed step contains non-finite values, the phi buffer is left unchanged, so a single corrupted iteration can’t poison the accumulated momentum. The non-finite step is still returned and is expected to be rejected by update.

__init__(mu: float = 0.9)#
Parameters:

mu – The momentum factor.

init(nparams: int) → dict[str, Array]#

Initialize the persistent buffers for nparams parameters.

update(core_solve: Callable[[...], Array], Obar: Array, Ebar: Array, buffers: dict[str, Array]) → tuple[Array, dict[str, Array]]#

Generate the optimization step and the new buffers, given the equation solver core_solve and the current buffers.