deltakit.core.decoding_graphs.OrderedDecodingEdges#

class deltakit.core.decoding_graphs.OrderedDecodingEdges(decoding_edges: Iterable[EdgeT] | None = None, mod_2_filter: bool = True)#

Bases: Sequence[EdgeT], Set[EdgeT], Generic[EdgeT]

Immutable ordered mod 2 set of decoding edges.

All decoding edges are thought to be on the same decoding graph. I.e. if the z and x decoding graphs are completely separable, then the z and x errors will be represented in two different OrderedDecodingEdges objects.

Parameters:
  • decoding_edges (Optional[Iterable[EdgeT]], optional) – Iterable of edges to store, in the given order, by default None. Duplicate items are removed if they are present an even number of times. Duplicate items are reduced to a single occurrence if they are present an odd number of times.

  • mod_2_filter (bool, optional) – False disables the modulo 2 filter, in which case the input edges are treated as an ordered set, by default True.

Methods#

OrderedDecodingEdges.append

Appeds edges from another set of OrderedDecodingEdges.

OrderedDecodingEdges.as_bitstring

Convert given edges to a bitstring representation of len(edges) bits from condition of each edge inside _decoding_edges.

OrderedDecodingEdges.count

OrderedDecodingEdges.from_syndrome_indices

Given a list of pairs of syndrome indices, construct the corresponding decoding edges and return in an OrderedDecodingEdges collection.

OrderedDecodingEdges.index

Raises ValueError if the value is not present.

OrderedDecodingEdges.isdisjoint

Return True if two sets have a null intersection.