HyperCubicLattice#

class HyperCubicLattice(size, edge_parameter=1.0, onsite_parameter=0.0, boundary_condition=BoundaryCondition.OPEN)[source]#

Bases: Lattice

Hyper-cubic lattice in \(d\) dimensions.

The HyperCubicLattice can be initialized with tuples of size, edge_parameters, and boundary_conditions. For example,

from qiskit_nature.second_q.hamiltonians.lattices import (
    BoundaryCondition,
    HyperCubicLattice,
    )

lattice = HyperCubicLattice(
    size = (3, 4, 5),
    edge_parameter = (1.0, -2.0, 3.0),
    onsite_parameter = 2.0,
    boundary_condition = (BoundaryCondition.OPEN, BoundaryCondition.OPEN, BoundaryCondition.OPEN)
    )

is a three-dimensional lattice of size 3 by 4 by 5, which has weights 1.0, -2.0, 3.0 on edges in x, y, and z directions, respectively, and weights 2.0 on self-loops. The boundary conditions are open for all the directions.

প্যারামিটার:
  • size (Tuple[int, ...]) -- Lengths of each dimension.

  • edge_parameter (complex | Tuple[complex, ...]) -- Weights on the edges in each direction. When it is a single value, it is interpreted as a tuple of the same length as size consisting of the same values. Defaults to 1.0.

  • onsite_parameter (complex) -- Weight on the self-loops, which are edges connecting a node to itself. This is uniform over the lattice points. Defaults to 0.0.

  • boundary_condition (BoundaryCondition | Tuple[BoundaryCondition, ...]) -- Boundary condition for each dimension. The available boundary conditions are: BoundaryCondition.OPEN, BoundaryCondition.PERIODIC. When it is a single value, it is interpreted as a tuple of the same length as size consisting of the same values. Defaults to BoundaryCondition.OPEN.

রেইজেস:

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 each dimension.

রিটার্নস:

the boundary condition.

dim#

Dimensions of the hyper cubic lattice.

রিটার্নস:

the dimension.

edge_parameter#

Weights on the edges in each direction.

রিটার্নস:

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

রিটার্নস:

the parameter for the self-loops.

size#

Lengths of each dimension.

রিটার্নস:

the size.

weighted_edge_list#

Return a list of weighted edges.

Methods

copy()#

Return a copy of the lattice.

রিটার্ন টাইপ:

Lattice

draw(*, self_loop=False, style=None)#

Draw the lattice.

প্যারামিটার:
draw_without_boundary(*, self_loop=False, style=None)[source]#

Draw the lattice with no edges between the boundaries.

প্যারামিটার:
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.

প্যারামিটার:

interaction_matrix (ndarray) -- the adjacency matrix from which to build out the lattice.

রেইজেস:

ValueError -- if the provided adjacency matrix is not a 2-D square matrix.

রিটার্নস:

A new lattice based on the provided adjacency matrix.

রিটার্ন টাইপ:

Lattice

classmethod from_nodes_and_edges(num_nodes, weighted_edges)#

Return an instance of Lattice from the number of nodes and the list of edges.

প্যারামিটার:
  • num_nodes (int) -- The number of nodes.

  • weighted_edges (List[Tuple[int, int, complex]]) -- A list of tuples consisting of two nodes and the weight between them.

রিটার্নস:

Lattice generated from lists of nodes and edges.

রিটার্ন টাইপ:

Lattice

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.

প্যারামিটার:

weighted (bool) -- The matrix elements are 0 or 1 when it is False. Otherwise, the weights on edges are returned as the matrix elements.

রিটার্নস:

The adjacency matrix of the input graph.

রিটার্ন টাইপ:

ndarray

uniform_parameters(uniform_interaction, uniform_onsite_potential)#

Returns a new lattice with uniform parameters but otherwise identical structure.

প্যারামিটার:
  • uniform_interaction (complex) -- the value to use for all edge weights.

  • uniform_onsite_potential (complex) -- the value to use for all single-vertex loop weights.

রিটার্নস:

A new lattice with identical structure but uniform parameters.

রিটার্ন টাইপ:

Lattice