neuralqx.graph.half_ladder_graph module

class HalfLadderGraph(length, connected=False, *, plot=False, non_planar=False)

Bases: Graph

This Graph is one which represents half a ladder. That is, it looks like this:

5 6 7 8 9 | | | | | 0—1—2—3—4

where the integers represent vertices and the lines represent edges (oriented in incrementing order).

If you specify connected = True, then it will create a loop graph, connected in the example above the vertex 4 to 0.

In this context, the vertices lying on the main graph (0, 1, 2, 3, 4) are called k-vertices and the edges connecting them are called k-edges. The vertices (5, 6, 7, 8, 9) which branch out from the k-vertices are called μ-vertices. In similar fashion, edges connecting the k- and μ- vertices are called μ-edges.

Note

This half ladder implementation contains extra information such as the k- and μ- vertices/edges because it was initially developed for a certain spherically symmetric model.

property edges_k
property edges_mu
property vertices_k
property vertices_mu
property is_connected
get_edges_at_k_vertex(vertex, dual_rep=False)

This function returns the μ-edge and the two k-edges attached to the requested vertex. The requested vertex needs to be a k-vertex.

Return type:

tuple[list, list]

Returns:

a tuple where the first entry is the μ-edge and the second entry is a list of the two k-edges, or the dual vertex representation if dual_rep = True

has_k_vertex_neighbours(vertex, direction)

A helper to check if a given k-vertex has neighbours in either direction based on the specified direction argument (right for right neighbour, left for left neighbour). Returns True if found, otherwise False.

Parameters:
  • vertex (int) – a k-vertex to check neighbours for

  • direction (str) – left or right to check for left or right k-vertex neighbours

Return type:

bool

Returns:

True if the requested neighbour is found, otherwise False

get_kminus_kplus(vertex, dual_rep=False)

A helper function to return the two neighbouring k-edges for a given k-vertex. This returns a list of two lists, whereby the first list contains the left k-edge and the second contains the right k-edge. If either is not found, the respective list is empty.

Parameters:
  • vertex (int) – a k-vertex to get the attached k-edges

  • dual_rep (bool) – return the k-edges in the dual representation

Returns: