deltakit.decode.utils.create_correlation_matrix#
- deltakit.decode.utils.create_correlation_matrix(pij_data: dict[frozenset[int], float], graph: NXDecodingGraph, plot_boundary_edges: bool = False) tuple[ndarray[tuple[Any, ...], dtype[float64]], dict[tuple[float, ...], list[int]]]#
Generate a correlation matrix for a given Pij matrix. Will plot qubit labels as major ticks, minor ticks within the major ticks are rounds (time). Matrix will be symmetric.
- Parameters:
pij_data (PijData) – Pij values calculated from experimental data
graph (NXDecodingGraph) – Accompanying graph for Pij data.
plot_boundary_edges (bool) – Boolean to specify whether the boundary edges/nodes should be plotted on the heatmap. These will be the entries along the direct diagonal from bottom-left to top-right. Default value is False.
- Returns:
Returns the correlation matrix and coordinate mapping. E.g, if all nodes are [0,1,2,3] then 2 & 3 correspond to the parity checks 0 & 1 in the future, respectively. E.g, {0: [0, 2], 1: [1, 3]}
- Return type:
Tuple[List[List[float]], Dict[Tuple[int, …], List[int]]]