quimb.tensor.geometry¶
Some functions for generating the edges of a lattice.
Functions¶
|
Make sure there are no duplicate edges and that for each |
|
Return the graph edges of a finite 1D chain lattice. |
|
Check |
|
Return the graph edges of a finite 2D square lattice. The nodes |
|
Return the graph edges of a finite 2D hexagonal lattice. There are two |
|
Return the graph edges of a finite 2D triangular lattice. There is a |
|
Return the graph edges of a finite 2D triangular lattice tiled in a |
|
Return the graph edges of a finite 2D kagome lattice. There are |
|
Check |
|
Return the graph edges of a finite 3D cubic lattice. The nodes |
|
Return the graph edges of a finite 3D pyorchlore lattice. There are |
|
Return the graph edges of a finite 3D diamond lattice. There are |
|
Return the graph edges of a finite 3D diamond lattice tiled in a cubic |
|
Return a random tree with |
Module Contents¶
- quimb.tensor.geometry.sort_unique(edges)[source]¶
Make sure there are no duplicate edges and that for each
coo_a < coo_b
.
- quimb.tensor.geometry.edges_1d_chain(L, cyclic=False)[source]¶
Return the graph edges of a finite 1D chain lattice.
- quimb.tensor.geometry.check_2d(coo, Lx, Ly, cyclic)[source]¶
Check
coo
in inbounds for a maybe cyclic 2D lattice.
- quimb.tensor.geometry.edges_2d_square(Lx, Ly, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 2D square lattice. The nodes (sites) are labelled like
(i, j)
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_2d_hexagonal(Lx, Ly, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 2D hexagonal lattice. There are two sites per cell, and note the cells do not form a square tiling. The nodes (sites) are labelled like
(i, j, s)
fors
in'AB'
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_2d_triangular(Lx, Ly, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 2D triangular lattice. There is a single site per cell, and note the cells do not form a square tiling. The nodes (sites) are labelled like
(i, j)
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_2d_triangular_rectangular(Lx, Ly, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 2D triangular lattice tiled in a rectangular geometry. There are two sites per rectangular cell. The nodes (sites) are labelled like
(i, j, s)
fors
in'AB'
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_2d_kagome(Lx, Ly, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 2D kagome lattice. There are three sites per cell, and note the cells do not form a square tiling. The nodes (sites) are labelled like
(i, j, s)
fors
in'ABC'
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.check_3d(coo, Lx, Ly, Lz, cyclic)[source]¶
Check
coo
in inbounds for a maybe cyclic 3D lattice.
- quimb.tensor.geometry.edges_3d_cubic(Lx, Ly, Lz, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 3D cubic lattice. The nodes (sites) are labelled like
(i, j, k)
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
Lz (int) – The number of cells along the z-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly), range(Lz))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_3d_pyrochlore(Lx, Ly, Lz, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 3D pyorchlore lattice. There are four sites per cell, and note the cells do not form a cubic tiling. The nodes (sites) are labelled like
(i, j, k, s)
fors
in'ABCD'
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
Lz (int) – The number of cells along the z-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly), range(Lz))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_3d_diamond(Lx, Ly, Lz, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 3D diamond lattice. There are two sites per cell, and note the cells do not form a cubic tiling. The nodes (sites) are labelled like
(i, j, k, s)
fors
in'AB'
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
Lz (int) – The number of cells along the z-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly), range(Lz))
.
- Returns:
edges
- Return type:
- quimb.tensor.geometry.edges_3d_diamond_cubic(Lx, Ly, Lz, cyclic=False, cells=None)[source]¶
Return the graph edges of a finite 3D diamond lattice tiled in a cubic geometry. There are eight sites per cubic cell. The nodes (sites) are labelled like
(i, j, k, s)
fors
in'ABCDEFGH'
.- Parameters:
Lx (int) – The number of cells along the x-direction.
Ly (int) – The number of cells along the y-direction.
Lz (int) – The number of cells along the z-direction.
cyclic (bool, optional) – Whether to use periodic boundary conditions.
cells (list, optional) – A list of cells to use. If not given the cells used are
itertools.product(range(Lx), range(Ly), range(Lz))
.
- Returns:
edges
- Return type: