utility.graph

Contents

utility.graph#

Contains graph algorithm utility functions (mainly for placement and routing steps)

Functions#

calculate_score(source, graph, machine_name)

Defines a score for a node by using cz fidelities on neighbouring couplers and state 1 readout fidelity

circuit_graph(tape)

builds a bidirectional graph from the two qubits gates in a circuit

find_best_neighbour(wire, topology, machine_name)

Finds the neighbour to a node which has the highest mean fidelity

find_best_wire(graph, machine_name[, ...])

find node with highest degree in graph

find_biggest_group(graph)

Returns the biggest array of connected components in the graph

find_closest_wire(source, machine_graph, ...)

find node in graph that is closest to given node, while skipping nodes from the excluding list

find_largest_common_subgraph_ismags(circuit, ...)

Uses IMAGS to find the largest common graph between two graphs

find_largest_common_subgraph_vf2(circuit, ...)

Uses vf2 and combinations to find the largest common graph between two graphs

is_directly_connected(operation, ...)

Checks if a 2 qubits operation is mapped to a coupler in the machine

machine_graph(machine_name, use_benchmark, ...)

builds a bidirectional graph from the qubits and coupler of a machine

node_with_shortest_path_from_selection(...)

find the unmapped node node in graph minus mapped nodes that has shortest path to given source node

path_length(path)

the length of a path

shortest_path(start, end, graph, machine_name)

find the shortest path between node start and end