netket.operator#
The Operator module defines the common interfaces used to interact with quantum operators and super-operators, as well as several concrete implementations of different operators such as netket.hilbert.LocalOperator, netket.hilbert.Ising and others.
NetKetβs operators are all sub-classes of the abstract class netket.hilbert.AbstractOperator, which defines a small set of API respected by all implementations. The inheritance diagram for the class hierarchy of the Operators included with NetKet is shown below (you can click on the nodes in the graph to go to their API documentation page). Dashed nodes represent abstract classes that cannot be instantiated, while the others are concrete and they can be instantiated.

Abstract Classes#
Below you find a list of all public classes defined in this module Those classes cannot be directly instantiated, but you can inherit from one of them if you want to define new hilbert spaces.
Abstract class for quantum Operators. |
|
Generic base class for super-operators acting on the tensor product (DoubledHilbert) space βββ, where β is the physical space. |
|
This class is the base class for operators defined on a discrete Hilbert space. |
|
Abstract base class for discrete operators that can be manipulated inside of jax function transformations. |
|
This class is the abstract base class for operators defined on a continuous Hilbert space. |
Concrete Classes#
Below you find a list of all concrete Operators that you can create on DiscreteHilbert spaces.
An extended Bose Hubbard model Hamiltonian operator, containing both on-site interactions and nearest-neighboring density-density interactions. |
|
A graph-based quantum operator. |
|
Jax implementation of an operator composed of a sum of local terms, each of which acts on a small number of sites. |
|
Numba implementation of an operator composed of a sum of local terms, each of which acts on a small number of sites. |
|
Jax-based implementation of the Transverse-Field Ising Hamiltonian \(-h\sum_i \sigma_i^{(x)} +J\sum_{\langle i,j\rangle} \sigma_i^{(z)}\sigma_j^{(z)}\). |
|
The Transverse-Field Ising Hamiltonian \(-h\sum_i \sigma_i^{(x)} +J\sum_{\langle i,j\rangle} \sigma_i^{(z)}\sigma_j^{(z)}\). |
|
Constructs an Heisenberg operator given a hilbert space and a graph providing the connectivity of the lattice. |
|
Jax-compatible version of |
|
A Hamiltonian consisting of the sum of products of Pauli operators. |
|
LocalLiouvillian super-operator, acting on the DoubledHilbert (tensor product) space βββ. |
Fermions#
Operators and functions to work with fermions are the following:
A fermionic operator in \(2^{nd}\) quantization using pure jax dark magic for indexing. |
|
A fermionic operator in \(2^{nd}\) quantization, using Numba for indexing. |
In the experimental submodule there is also an implementation of a particle-number conserving operator which can be more efficient than the generic FermionOperator2ndJax.
|
Particle-number conserving fermionc operator |
|
Particle-number conserving and spin-Z-conserving fermionc operator |
Fermi-Hubbard Hamiltonian based on the generic ParticleNumberAndSpinConservingFermioperator2nd |
Note in particular the pyscf module that can be used to convert molecules from pyscf to netket format. The support for PyScf is still experimental, and can be found in Fermions and PyScf
Continuous space operators#
This is a list of operators that you can define on ContinuousHilbert spaces.
This is the kinetic energy operator (hbar = 1). |
|
Returns the local potential energy defined in afun |
Permutation operators#
Operators representing permutations, mainly used to express the lattice symmetries for wavefunction symmetrization in symmetries, as described in Representation theory in NetKet.
Permutation operator on a spin or boson space. |
|
Operators corresponding to the permutation of the orbitals belonging to a second quantized fermionic space. |
|
Return the appropriate permutation operator depending on the type of Hilbert space. |
Internal operators#
Operators used internally to implement symmetry representations. They are public but low-level; prefer the higher-level constructors in netket.symmetry.
Composing different operators together#
Operators of different types, but acting on the same Hilbert space, can be combined by means of the operators described below. This is also useful to parametrize in a jax-friendly way time-dependent Hamiltonians.
Base class for sum of quantum operators. |
|
Base class for product of quantum operators. |
|
Pre-defined operators#
Those are easy-to-use constructors for a LocalOperator.
Builds the boson creation operator \(\hat{a}^\dagger\) acting on the site-th of the Hilbert space hilbert. |
|
Builds the boson destruction operator \(\hat{a}\) acting on the site-th of the Hilbert space hilbert. |
|
Builds the \(\mathbb{I}\) identity operator. |
|
Builds the number operator \(\hat{a}^\dagger\hat{a}\) acting on the site-th of the Hilbert space hilbert. |
|
Builds the projector operator \(|n\rangle\langle n |\) acting on the site-th of the Hilbert space hilbert and collapsing on the state with n bosons. |
|
Builds the \(\mathbb{I}\) identity operator. |
|
Builds the \(\sigma^x\) operator acting on the site-th of the Hilbert space hilbert. |
|
Builds the \(\sigma^y\) operator acting on the site-th of the Hilbert space hilbert. |
|
Builds the \(\sigma^z\) operator acting on the site-th of the Hilbert space hilbert. |
|
Builds the \(\sigma^{+} = \frac{1}{2}(\sigma^x + i \sigma^y)\) operator acting on the site-th of the Hilbert space hilbert. |
|
Builds the \(\sigma^{-} = \frac{1}{2}(\sigma^x - i \sigma^y)\) operator acting on the site-th of the Hilbert space hilbert. |
|
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. |
Utilities#
Returns the sparse matrix representation of the operator with caching. |
Base implementation of an operator composed of a sum of local terms, each of which acts on a small number of sites. |
|
Jax-based implementation of the Transverse-Field Ising Hamiltonian \(-h\sum_i \sigma_i^{(x)} +J\sum_{\langle i,j\rangle} \sigma_i^{(z)}\sigma_j^{(z)}\). |
|
A Hamiltonian consisting of the sum of products of Pauli operators, acting on any number of sites. |
|
A fermionic operator in \(2^{nd}\) quantization. |
|
This class implements the action of the _expect_kernel()-method of ContinuousOperator for a sum of ContinuousOperator objects. |
|