netket.graph.Square#
- class netket.graph.Square[source]#
Bases:
Constructs a square lattice of side length Periodic boundary conditions can also be imposed
- Parameters:
length (
int
) – Side length of the square; must always be >=1pbc (
bool
) – Whether the square should have periodic boundary conditions (in both directions)kwargs – Additional keyword arguments are passed on to the constructor of netket.graph.Lattice.
- Return type:
Examples
A 10x10 square lattice with periodic boundary conditions can be constructed as follows:
>>> import netket >>> g=netket.graph.Square(10, pbc=True) >>> print(g.n_nodes) 100