deltakit.decode.utils.pij_and_dem_edge_diff#

deltakit.decode.utils.pij_and_dem_edge_diff(dem: DetectorErrorModel, pij: dict[frozenset[int], float], is_hypergraph: bool = False) tuple[set, set]#

Given a stim.DetectorErrorModel and Pij dict, compare the two to see if they contain the same edges w.r.t nodes in the edges. Return a tuple of sets containing the difference for the dem and Pij respectively.

Parameters:
  • dem (stim.DetectorErrorModel) – DEM to compare with Pij.

  • pij (PijData) – Pij to compare with DEM.

  • is_hypergraph (bool) – Specifies whether DEM/Pij describe a hypergraph or not. Default value is False.

Returns:

Tuple containing a set for the dem and pij that contain the elements contained in the dem/pij but not contained in the pij/dem respectively.

Return type:

Tuple[Set, Set]