Grid(extent=None, *, length=None, pbc=True)¶
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.
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
- Return type