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.

Inheritance diagram of netket.operator, netket.experimental.operator

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.

AbstractOperator

Abstract class for quantum Operators.

AbstractSuperOperator

Generic base class for super-operators acting on the tensor product (DoubledHilbert) space β„‹βŠ—β„‹, where β„‹ is the physical space.

DiscreteOperator

This class is the base class for operators defined on a discrete Hilbert space.

DiscreteJaxOperator

Abstract base class for discrete operators that can be manipulated inside of jax function transformations.

ContinuousOperator

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.

BoseHubbardJax

BoseHubbardNumba

An extended Bose Hubbard model Hamiltonian operator, containing both on-site interactions and nearest-neighboring density-density interactions.

GraphOperator

A graph-based quantum operator.

LocalOperatorJax

Jax implementation of an operator composed of a sum of local terms, each of which acts on a small number of sites.

LocalOperatorNumba

Numba implementation of an operator composed of a sum of local terms, each of which acts on a small number of sites.

IsingJax

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)}\).

IsingNumba

The Transverse-Field Ising Hamiltonian \(-h\sum_i \sigma_i^{(x)} +J\sum_{\langle i,j\rangle} \sigma_i^{(z)}\sigma_j^{(z)}\).

Heisenberg

Constructs an Heisenberg operator given a hilbert space and a graph providing the connectivity of the lattice.

PauliStringsJax

Jax-compatible version of netket.operator.PauliStrings.

PauliStringsNumba

A Hamiltonian consisting of the sum of products of Pauli operators.

LocalLiouvillian

LocalLiouvillian super-operator, acting on the DoubledHilbert (tensor product) space β„‹βŠ—β„‹.

Fermions#

Operators and functions to work with fermions are the following:

FermionOperator2ndJax

A fermionic operator in \(2^{nd}\) quantization using pure jax dark magic for indexing.

FermionOperator2ndNumba

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.

experimental.operator.ParticleNumberConservingFermioperator2nd

Particle-number conserving fermionc operator

experimental.operator.ParticleNumberAndSpinConservingFermioperator2nd

Particle-number conserving and spin-Z-conserving fermionc operator

experimental.operator.FermiHubbardJax

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.

KineticEnergy

This is the kinetic energy operator (hbar = 1).

PotentialEnergy

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.PermutationOperator

Permutation operator on a spin or boson space.

permutation.PermutationOperatorFermion

Operators corresponding to the permutation of the orbitals belonging to a second quantized fermionic space.

permutation.construct_permutation_operator

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.

SumOperator

Base class for sum of quantum operators.

ProductOperator

Base class for product of quantum operators.

EmbedOperator

Pre-defined operators#

Those are easy-to-use constructors for a LocalOperator.

boson.create

Builds the boson creation operator \(\hat{a}^\dagger\) acting on the site-th of the Hilbert space hilbert.

boson.destroy

Builds the boson destruction operator \(\hat{a}\) acting on the site-th of the Hilbert space hilbert.

boson.identity

Builds the \(\mathbb{I}\) identity operator.

boson.number

Builds the number operator \(\hat{a}^\dagger\hat{a}\) acting on the site-th of the Hilbert space hilbert.

boson.proj

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.

spin.identity

Builds the \(\mathbb{I}\) identity operator.

spin.sigmax

Builds the \(\sigma^x\) operator acting on the site-th of the Hilbert space hilbert.

spin.sigmay

Builds the \(\sigma^y\) operator acting on the site-th of the Hilbert space hilbert.

spin.sigmaz

Builds the \(\sigma^z\) operator acting on the site-th of the Hilbert space hilbert.

spin.sigmap

Builds the \(\sigma^{+} = \frac{1}{2}(\sigma^x + i \sigma^y)\) operator acting on the site-th of the Hilbert space hilbert.

spin.sigmam

Builds the \(\sigma^{-} = \frac{1}{2}(\sigma^x - i \sigma^y)\) operator acting on the site-th of the Hilbert space hilbert.

fermion.create

Builds the fermion creation operator \(\hat{a}^\dagger\) acting on the site-th of the Hilbert space hilbert.

fermion.destroy

Builds the fermion destruction operator \(\hat{a}\) acting on the site-th of the Hilbert space hilbert.

fermion.number

Builds the number operator \(\hat{a}^\dagger\hat{a}\) acting on the site-th of the Hilbert space hilbert.

Utilities#

to_sparse_cached

Returns the sparse matrix representation of the operator with caching.

_local_operator.LocalOperator

_local_operator.LocalOperatorBase

Base implementation of an operator composed of a sum of local terms, each of which acts on a small number of sites.

_ising.Ising

_ising.IsingBase

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)}\).

_pauli_strings.PauliStrings

_pauli_strings.PauliStringsBase

A Hamiltonian consisting of the sum of products of Pauli operators, acting on any number of sites.

_fermion2nd.FermionOperator2nd

_fermion2nd.FermionOperator2ndBase

A fermionic operator in \(2^{nd}\) quantization.

_sum.SumContinuousOperator

This class implements the action of the _expect_kernel()-method of ContinuousOperator for a sum of ContinuousOperator objects.

_sum.SumGenericOperator

_sum.SumDiscreteJaxOperator

_sum.SumDiscreteOperator

_prod.ProductGenericOperator

_prod.ProductDiscreteOperator

_prod.ProductDiscreteJaxOperator