netket.vqs#

This module defines the variational states, the heart of NetKet itself.

Inheritance diagram of netket.vqs

Abstract Interface#

VariationalState

Abstract class for variational states representing either pure states or mixed quantum states.

VariationalMixedState

Concrete Variational States#

FullSumState

Variational State for a variational quantum state computed on the whole Hilbert space without Monte Carlo sampling by summing over the whole Hilbert space.

MCState

Variational State for a Variational Neural Quantum State.

MCMixedState

Variational State for a Mixed Variational Neural Quantum State.

and the experimental Variational state for a single slater determinant state (which does not use Monte-Carlo sampling)

DeterminantVariationalState

Variational State for fermionic mean-field states (Hartree-Fock ansatz).

Functions#

apply_operator

Apply an operator to a variational state.

local_estimators

Compute per-sample local estimator data for operator op on vstate.

get_local_kernel

Returns the function computing the local estimator for the given variational state and operator.

get_local_kernel_arguments

Returns the samples of vstate used to compute the expectation value of the operator O, and the connected elements and matrix elements.

Freezing parameters#

The following functions return a new variational state in which a subset of the parameters has been frozen (moved from parameters into model_state), so they are automatically excluded from gradient computation and optimizer updates. See the freezing parameters example for a worked example.

freeze_parameters

Freeze a subset of model parameters in a variational state.

unfreeze_parameters

Restore all frozen parameters in vstate to the trainable set.