- class netket.graph.Grid#
Constructs a hypercubic lattice given its extent in all dimensions.
bool]]) – If True, the grid will have periodic boundary conditions (PBC); if False, the grid will have open boundary conditions (OBC). This parameter can also be a list of booleans with same length as the parameter length, in which case each dimension will have PBC/OBC depending on the corresponding entry of pbc.
bool) – generates nearest-neighbour edges colored according to direction i.e. edges along Cartesian direction #i have color i cannot be used with max_neighbor_order or custom_edges
kwargs – Additional keyword arguments are passed on to the constructor of netket.graph.Lattice.
- Return type:
Construct a 5x10 square lattice with periodic boundary conditions:
>>> import netket >>> g=netket.graph.Grid(extent=[5, 10], pbc=True) >>> print(g.n_nodes) 50
Construct a 2x2x3 cubic lattice with open boundary conditions:
>>> g=netket.graph.Grid(extent=[2,2,3], pbc=False) >>> print(g.n_nodes) 12