quantax.optimizer.Updater#

class quantax.optimizer.Updater#

Base class of update strategies for QNGD optimizers. It defines how an optimization step is generated around the core equation solve, including the persistent buffers it carries (momentum, initial guesses, …). A concrete updater implements two methods:

  • init returns the buffers as a dict of arrays;

  • update returns (step, buffers), where core_solve(Obar, Ebar, **solver_kwargs) solves \(\bar O \dot \theta = \bar \epsilon\) and forwards extra keyword arguments to the numerical solver.

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.