LineLattice#

class LineLattice(num_nodes, edge_parameter=1.0, onsite_parameter=0.0, boundary_condition=BoundaryCondition.OPEN)[ソース]#

ベースクラス: HyperCubicLattice

Line lattice.

パラメータ:
  • num_nodes (int) – The number of sites.

  • edge_parameter (complex) – Weight on the edges. 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) – Boundary condition. The available boundary conditions are: BoundaryCondition.OPEN, BoundaryCondition.PERIODIC. Defaults to BoundaryCondition.OPEN.

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#

Number of nodes

戻り値:

The number of nodes for the line lattice

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)#

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