netket.operator.BoseHubbard

class netket.operator.BoseHubbard

A Bose Hubbard model Hamiltonian operator.

__init__(self: netket._C_netket.operator.BoseHubbard, hilbert: netket._C_netket.hilbert.Hilbert, U: float, V: float = 0.0, mu: float = 0.0) → None

Constructs a new BoseHubbard given a hilbert space and a Hubbard interaction strength. The chemical potential and the hopping term can be specified as well.

Parameters
  • hilbert – Hilbert space the operator acts on.

  • U – The Hubbard interaction term.

  • V – The hopping term.

  • mu – The chemical potential.

Examples

Constructs a BoseHubbard operator for a 2D system.

>>> import netket as nk
>>> g = nk.graph.Hypercube(length=3, n_dim=2, pbc=True)
>>> hi = nk.hilbert.Boson(n_max=3, n_bosons=6, graph=g)
>>> op = nk.operator.BoseHubbard(U=4.0, hilbert=hi)
>>> print(op.hilbert.size)
9

Methods

__init__(self, hilbert, U, V, mu)

Constructs a new BoseHubbard given a hilbert space and a Hubbard interaction strength.

get_conn(self, v, 1]])

Member function finding the connected elements of the Operator.

to_dense(self)

Returns the dense matrix representation of the operator.

to_linear_operator(self)

Converts Operator to scipy.sparse.linalg.LinearOperator.

to_sparse(self)

Returns the sparse matrix representation of the operator.

Attributes

hilbert

Hilbert space of operator.

get_conn(self: netket._C_netket.Operator, v: numpy.ndarray[float64[m, 1]]) → Tuple[scipy.sparse.csc_matrix[float64], numpy.ndarray[complex128[m, 1]]]

Member function finding the connected elements of the Operator. Starting from a given visible state v, it finds all other visible states v’ such that the matrix element \(O(v,v')\) is different from zero. In general there will be several different connected visible units satisfying this condition, and they are denoted here \(v'(k)\), for \(k=0,1...N_{\mathrm{connected}}\).

Parameters

v – A constant reference to the visible configuration.

property hilbert

Hilbert space of operator.

Type

netket.hilbert.Hilbert

to_dense(self: netket._C_netket.Operator) → numpy.ndarray[complex128[m, n]]

Returns the dense matrix representation of the operator. Note that, in general, the size of the matrix is exponential in the number of quantum numbers, and this operation should thus only be performed for low-dimensional Hilbert spaces.

This method requires an indexable Hilbert space.

to_linear_operator(self: object) → object

Converts Operator to scipy.sparse.linalg.LinearOperator.

This method requires an indexable Hilbert space.

to_sparse(self: netket._C_netket.Operator) → scipy.sparse.csr_matrix[complex128]

Returns the sparse matrix representation of the operator. Note that, in general, the size of the matrix is exponential in the number of quantum numbers, and this operation should thus only be performed for low-dimensional Hilbert spaces or sufficiently sparse operators.

This method requires an indexable Hilbert space.