hiperwalk.WeightedGraph#

class hiperwalk.WeightedGraph(adj_matrix, copy=False)[source]#

Constructs an arbitrary weighted graph.

Parameters:
adj_matrix

The adjacency matrix of the graph (any integer Hermitian matrix). Two input types are accepted:

copybool, default=False

If True, a hard copy of adj_matrix is stored. If False, the pointer to adj_matrix is stored.

Raises:
TypeError

If adj_matrix is not a square matrix.

Notes

The graph \(G(V,E)\) on which the quantum walk takes place is specified by any real Hermitian matrix \(C\).

__init__(adj_matrix, copy=False)[source]#

Methods

adjacency_matrix()

Return the graph's adjacency matrix.

adjacent(u, v)

Return True if vertex u is adjacent to v.

degree(vertex)

Return the degree of the given vertex.

is_simple()

Return True if instance of simple graph.

laplacian_matrix()

Return the graph's Laplacian matrix.

neighbors(vertex)

Return all neighbors of the given vertex.

number_of_edges()

Determine the cardinality of the edge set.

number_of_loops()

Return the number of loops in the graph.

number_of_vertices()

Determine the cardinality of the vertex set.

vertex_number(vertex)

Return the vertex number given any vertex representation.