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:
- Any matrix – for instance,
list of lists.
networkx.Graph.The adjacency matrix is extracted from the graph.
- copybool, default=False
If
True, a hard copy ofadj_matrixis stored. IfFalse, the pointer toadj_matrixis stored.
- Raises:
- TypeError
If
adj_matrixis 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\).
Methods
Return the graph's adjacency matrix.
adjacent(u, v)Return True if vertex
uis adjacent tov.degree(vertex)Return the degree of the given vertex.
Return True if instance of simple graph.
Return the graph's Laplacian matrix.
neighbors(vertex)Return all neighbors of the given vertex.
Determine the cardinality of the edge set.
Return the number of loops in the graph.
Determine the cardinality of the vertex set.
vertex_number(vertex)Return the vertex number given any vertex representation.