netket.graph.Hypercube

Contents

netket.graph.Hypercube#

class netket.graph.Hypercube[source]#

Bases:

Constructs a hypercubic lattice with equal side length in all dimensions. Periodic boundary conditions can also be imposed.

Parameters:
  • length (int) – Side length of the hypercube; must always be >=1

  • n_dim (int) – Dimension of the hypercube; must be at least 1.

  • pbc (bool) – Whether the hypercube should have periodic boundary conditions (in all directions)

  • kwargs – Additional keyword arguments are passed on to the constructor of netket.graph.Lattice.

Return type:

Lattice

Examples

A 10x10x10 cubic lattice with periodic boundary conditions can be constructed as follows:

>>> import netket
>>> g = netket.graph.Hypercube(10, n_dim=3, pbc=True)
>>> print(g.n_nodes)
1000