KagomeLattice#
- class KagomeLattice(rows, cols, edge_parameter=1.0, onsite_parameter=0.0, boundary_condition=BoundaryCondition.OPEN)[source]#
Bases:
Lattice
The two-dimensional kagome lattice.
The kagome lattice is a two-dimensional Bravais lattice formed by tiling together equilateral triangles and regular hexagons in an alternating pattern. The lattice is spanned by the primitive lattice vectors \(\vec{a}_{1} = (1, 0)^{\top}\) and \(\vec{a}_{2} = (1/2, \sqrt{3}/2)^{\top}\) with each unit cell consisting of three lattice sites located at \(\vec{r}_0 = \mathbf{0}\), \(\vec{r}_1 = 2\vec{a}_{1}\) and \(\vec{r}_2 = 2 \vec{a}_{2}\), respectively.
This class allows for the simple construction of kagome lattices. For example,
from qiskit_nature.second_q.hamiltonians.lattices import ( BoundaryCondition, KagomeLattice, ) kagome = KagomeLattice( 5, 4, edge_parameter = 1.0, onsite_parameter = 2.0, boundary_condition = BoundaryCondition.PERIODIC )
instantiates a kagome lattice with 5 and 4 unit cells in the x and y direction, respectively, which has weights 1.0 on all edges and weights 2.0 on self-loops. The boundary conditions are periodic for the entire lattice.
- Parameters:
rows (int) – Number of unit cells in the x direction.
cols (int) – Number of unit cells in the y direction.
edge_parameter (complex) – Weight on all the edges, specified as a single value Defaults to 1.0,
onsite_parameter (complex) – Weight on the self-loops, which are edges connecting a node to itself. Defaults to 0.0.
boundary_condition (BoundaryCondition | tuple[BoundaryCondition, BoundaryCondition]) – Boundary condition for each direction. The available boundary conditions are:
BoundaryCondition.OPEN
,BoundaryCondition.PERIODIC
. Defaults toBoundaryCondition.OPEN
.
- Raises:
ValueError – When edge parameter or boundary condition is a tuple, the length of that is not the same as that of size.
Attributes
- boundary_condition#
Boundary condition for the entire lattice.
- Returns:
The boundary condition.
- cols#
Number of unit cells in the y direction.
- Returns:
The number of columns of the lattice.
- edge_parameter#
Weights on all edges.
- Returns:
The parameter for the edges.
- graph#
Return a copy of the input graph.
- node_indexes#
Return the node indexes.
- num_nodes#
Return the number of nodes.
- onsite_parameter#
Weight on the self-loops.
- Returns:
The parameter for the self-loops.
- rows#
Number of unit cells in the x direction.
- Returns:
The number of rows of the lattice.
- size#
Number of unit cells in the x and y direction, respectively.
- Returns:
The size of the lattice.
- weighted_edge_list#
Return a list of weighted edges.
Methods
- draw(*, self_loop=False, style=None)#
Draw the lattice.
- Parameters:
self_loop (bool) – Draw self-loops in the lattice. Defaults to False.
style (LatticeDrawStyle | None) – Styles for rustworkx.visualization.mpl_draw. Please see https://www.rustworkx.org/apiref/rustworkx.visualization.mpl_draw.html for details.
- draw_without_boundary(*, self_loop=False, style=None)[source]#
Draw the lattice with no edges between the boundaries.
- Parameters:
self_loop (bool) – Draw self-loops in the lattice. Defaults to False.
style (LatticeDrawStyle | None) – Styles for rustworkx.visualization.mpl_draw. Please see https://www.rustworkx.org/apiref/rustworkx.visualization.mpl_draw.html for details.
- classmethod from_adjacency_matrix(interaction_matrix)#
Constructs a new lattice from a 2-dimensional adjacency matrix.
This method is equivalent to
PyGraph.from_adjacency_matrix()
or its complex counterpart when given a complex-valued matrix.- Parameters:
interaction_matrix (ndarray) – the adjacency matrix from which to build out the lattice.
- Raises:
ValueError – if the provided adjacency matrix is not a 2-D square matrix.
- Returns:
A new lattice based on the provided adjacency matrix.
- Return type:
- classmethod from_nodes_and_edges(num_nodes, weighted_edges)#
Return an instance of Lattice from the number of nodes and the list of edges.
- to_adjacency_matrix(weighted=False)#
Return its adjacency matrix from weighted edges. The weighted edge list is interpreted as the upper triangular matrix. Defaults to False.
- uniform_parameters(uniform_interaction, uniform_onsite_potential)#
Returns a new lattice with uniform parameters but otherwise identical structure.