netket.operator.Heisenberg

Contents

netket.operator.Heisenberg#

netket.operator.Heisenberg(hilbert, graph, J=1.0, sign_rule=None, dtype=None, *, acting_on_subspace=None, cls=<class 'netket.operator._local_operator.jax.LocalOperatorJax'>)[source]#

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

Parameters:
  • hilbert (AbstractHilbert) – Hilbert space the operator acts on.

  • graph (AbstractGraph) – The graph upon which this hamiltonian is defined.

  • J (float | Sequence[float]) – The strength of the coupling. Default is 1. Can pass a sequence of coupling strengths with coloured graphs: edges of colour n will have coupling strength J[n]

  • sign_rule (None | bool | Sequence[bool]) – If True, Marshal’s sign rule will be used. On a bipartite lattice, this corresponds to a basis change flipping the Sz direction at every odd site of the lattice. For non-bipartite lattices, the sign rule cannot be applied. Defaults to True if the lattice is bipartite, False otherwise. If a sequence of coupling strengths is passed, defaults to False and a matching sequence of sign_rule must be specified to override it

  • dtype (Union[None, str, type[Any], dtype, _SupportsDType]) – Data type of the matrix elements.

  • acting_on_subspace (None | list[int] | int) – Specifies the mapping between nodes of the graph and Hilbert space sites, so that graph node i ∈ [0, ..., graph.n_nodes - 1], corresponds to acting_on_subspace[i] ∈ [0, ..., hilbert.n_sites]. Must be a list of length graph.n_nodes. Passing a single integer start is equivalent to [start, ..., start + graph.n_nodes - 1].

  • cls (type[_LocalOperatorT])

Return type:

TypeVar(_LocalOperatorT, bound= LocalOperatorBase)

Examples

Constructs a Heisenberg operator for a 1D system.

>>> import netket as nk
>>> g = nk.graph.Hypercube(length=20, n_dim=1, pbc=True)
>>> hi = nk.hilbert.Spin(s=0.5, total_sz=0, N=g.n_nodes)
>>> op = nk.operator.Heisenberg(hilbert=hi, graph=g)
>>> print(op)
LocalOperatorJax(dim=20, #acting_on=20 locations, constant=0.0, dtype=float64)