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

Abstract Interface#
Abstract class for variational states representing either pure states or mixed quantum states. |
|
Concrete Variational States#
Variational State for a variational quantum state computed on the whole Hilbert space without Monte Carlo sampling by summing over the whole Hilbert space. |
|
Variational State for a Variational Neural Quantum State. |
|
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)
Variational State for fermionic mean-field states (Hartree-Fock ansatz). |
Functions#
Apply an operator to a variational state. |
|
Compute per-sample local estimator data for operator op on vstate. |
|
Returns the function computing the local estimator for the given variational state and operator. |
|
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 a subset of model parameters in a variational state, removing them from gradient/QGT calculations. |
|
Restore all frozen parameters in vstate to the trainable set. |
Local-value kernels#
MCState computes the local estimators of jax operators with the kernels chosen by get_local_kernel().
The packed kernel below is an alternative, with the same arguments, that evaluates the network only on the connected configurations that differ from the sample.
MCState uses it in place of the default kernels if the experimental flag NETKET_EXPERIMENTAL_PACKED_KERNEL is set (off by default), for instance with nk.config.netket_experimental_packed_kernel = True; it can also be called explicitly.
It is experimental: it can change in a minor release, with a note in the changelog.
local_value kernel for MCState and jax-compatible operators that evaluates \(\log\psi\) only on the connected configurations \(x' \neq x\). |