Lattice(basis_vectors, extent, *, pbc=True, atoms_coord=)¶
A lattice built translating a unit cell and adding edges between nearest neighbours sites.
The unit cell is defined by the
basis_vectorsand it can contain an arbitrary number of atoms. Each atom is located at an arbitrary position and is labelled by an integer number, meant to distinguish between the different atoms within the unit cell. Periodic boundary conditions can also be imposed along the desired directions. There are three different ways to refer to the lattice sites. A site can be labelled by a simple integer number (the site index) or by its coordinates (actual position in space).
__init__(basis_vectors, extent, *, pbc=True, atoms_coord=)¶
Constructs a new
Latticegiven its side length and the features of the unit cell.
basis_vectors – The basis vectors of the unit cell.
extent – The number of copies of the unit cell.
bool) – If
Truethen the constructed lattice will have periodic boundary conditions, otherwise open boundary conditions are imposed (default=``True``).
atoms_coord – The coordinates of different atoms in the unit cell (default=one atom at the origin).
Constructs a rectangular 3X4 lattice with periodic boundary conditions.
>>> import netket >>> g=netket.graph.Lattice(basis_vectors=[[1,0],[0,1]],extent=[3,4]) >>> print(g.n_nodes) 12
Coordinates of atoms in the unit cell.
List containing the adjacency list of the graph where each node is represented by an integer in [0, n_nodes)
Symmetry group containing the automorphisms of the graph
- Return type
List containing the distances between the nodes. The fact that some node may not be reachable from another is represented by -1
Iterator over the edges of the graph