Experimental API#
In this page we present some experimental interfaces of NetKet. Those are not guaranteed to be API-stable, and might change without notice (other than the changelog) among minor releases. The netket.experimental module mirrors the standard netket module structure, and we suggest to use it as follows:
import netket as nk
import netket.experimental as nkx
Drivers#
Currently NetKet offers an experimental driver implementing Stochastic Reconfiguration with the kernel trick
(originally introduced under the name of minSR by Ao Chen and Markus Heyl). This is slightly more limited in
features than the standard Stochastic Reconfiguration implementation of netket.drivers.VMC
, but can scale to millions of parameters
Energy minimization using Variational Monte Carlo (VMC) and the kernel formulation of Stochastic Reconfiguration (SR). |
Quantum State Reconstruction#
The Quantum State Reconstruction algorithm performs an approximate tomographic reconstruction of measurement data coming from a quantum computer (or similar device) using a Pure or Mixed quantum state.
Quantum state reconstruction driver minimizing KL divergence. |
Samplers#
They are experimental, meaning that we could change them at some point, and we actively seeking for feedback and opinions on their usage and APIs.
Parallel tempering samplers#
An experimental sampler is MetropolisSamplerPmap, which makes use of jax.pmap()
to use different GPUs/CPUs without having to use MPI. It should scale much better over
several CPUs, but you have to start jax with a specific environment variable.
Metropolis-Hastings sampler for an Hilbert space according to a specific transition rule where chains are split among the available devices (jax.devices()). |
Particle-specific samplers#
The following samplers are for 2nd-quantisation fermionic hilbert spaces (netket.experimental.hilbert.SpinOrbitalFermions
).
This sampler moves (or hops) a random particle to a different but random empty mode. |
And the corresponding rules
Exchange rule for particles on a lattice. |
Logging#
This module contains experimental loggers that can be used with the optimization drivers.
HDF5 Logger, that can be passed with keyword argument logger to Monte Carlo drivers in order to serialize the output data of the simulation. |
Variational State Interface#
Loads the variables of a variational state from a .mpack file. |
|
Loads the variables of a variational state from the i-th element of a .tar archive. |
Time Evolution Driver#
Variational time evolution based on the time-dependent variational principle which, when used with Monte Carlo sampling via |
|
Variational time evolution based on the time-dependent variational principle which, when used with Monte Carlo sampling via |
ODE Integrators#
Concrete solvers#
This is a collection of ODE solvers that can be used with the TDVP driver above.
The canonical first-order forward Euler method. |
|
The second order Heun's method. |
|
The second order midpoint method. |
|
The second order Heun's method. |
|
2nd order adaptive solver with 3rd order error control, using the Bogacki–Shampine coefficients |
|
The canonical Runge-Kutta Order 4 method. |
|
Dormand-Prince's 5/4 Runge-Kutta method. |
The corresponding integrator is then automatically constructed within the TDVP driver.
Abstract classes#
Those are the abstract classes you can inherit from to implement your own solver
Abstract base class for ODE solvers. |
|
Base class holding the state of a solver. |
Fermions#
This modules contains hilbert space and operator implementations of fermions in second quantization. It is experimental until it has been thoroughly tested by the community, meaning feedback is welcome.
Hilbert space for 2nd quantization fermions with spin s distributed among n_orbital orbitals. |
A fermionic operator in \(2^{nd}\) quantization, using Numba for indexing. |
|
Builds the fermion creation operator \(\hat{a}^\dagger\) acting on the site-th of the Hilbert space hilbert. |
|
Builds the fermion destruction operator \(\hat{a}\) acting on the site-th of the Hilbert space hilbert. |
|
Builds the number operator \(\hat{a}^\dagger\hat{a}\) acting on the site-th of the Hilbert space hilbert. |
|
Construct a netket operator encoding the electronic hamiltonian of a pyscf molecule in a chosen orbital basis. |
|
Computes the nuclear repulsion energy \(E_{nuc}\), and the T and V tensors encoding the 1-body and 2-body terms in the electronic hamiltonian of a pyscf molecule using the specified molecular orbitals. |
Observables#
This module contains various observables that can be computed starting from various variational states.
Rényi2 bipartite entanglement entropy of a state \(| \Psi \rangle\) between partitions A and B. |
|
Observable computing the variance of a quantum operator \(O\). |