netket.optimizer#

This module provides some optimisers, implementations of the Quantum Geometric Tensor and preconditioners such as SR.

Optimizers#

Optimizers in NetKet are simple wrappers of optax optimizers. If you want to write a custom optimizer or use more advanced ones, we suggest you have a look at optax documentation.

Check it out for up-to-date information on available optimisers.

Warning

Even if optimisers in netket.optimizer are optax optimisers, they have slightly different names (they are capitalised) and the argument names have been rearranged and renamed. This was chosen in order not to break our API from previous versions

In general, we advise you to directly use optax, as it is much more powerful, provides more optimisers, and it’s extremely easy to use step-dependent schedulers.

Adam

Adam Optimizer.

AdaGrad

AdaGrad Optimizer.

Sgd

Stochastic Gradient Descent Optimizer.

Momentum

Momentum-based Optimizer.

RmsProp

RMSProp optimizer.

Preconditioners#

This module also provides an implementation of the Stochastic Reconfiguration/Natural gradient preconditioner.

SR

Stochastic Reconfiguration or Natural Gradient preconditioner for the gradient.

Quantum Geometric Tensor#

It also provides the following implementation of the quantum geometric tensor:

qgt.QGTAuto

Automatically select the 'best' Quantum Geometric Tensor computing format according to some rather untested heuristic.

qgt.QGTOnTheFly

Lazy representation of an S Matrix computed by performing 2 jvp and 1 vjp products, using the variational state's model, the samples that have already been computed, and the vector.

qgt.QGTJacobianPyTree

Semi-lazy representation of an S Matrix where the Jacobian O_k is precomputed and stored as a PyTree.

qgt.QGTJacobianDense

Semi-lazy representation of an S Matrix where the Jacobian O_k is precomputed and stored as a dense matrix.

Dense solvers#

And the following dense solvers for Stochastic Reconfiguration:

solver.cholesky

Solve the linear system using a Cholesky Factorisation.

solver.LU

Solve the linear system using a LU Factorisation.

solver.pinv

Solve the linear system using jax's implementation of the pseudo-inverse.

solver.pinv_smooth

Solve the linear system by building a pseudo-inverse from the eigendecomposition obtained from jax.numpy.linalg.eigh().

solver.solve

Solve the linear system.

solver.svd

Solve the linear system using Singular Value Decomposition.