deltakit.core.decoding_graphs.OrderedSyndrome#

class deltakit.core.decoding_graphs.OrderedSyndrome(detectors: Iterable[int] = (), enforce_mod_2: bool = True)#

Bases: Sequence[int], Set[int]

Immutable ordered mod 2 set of detectors. Where detectors are represented by integers.

Parameters:
  • detectors (Iterable[int], optional) – Detectors to put into this ordered mod 2 collection, by default ().

  • enforce_mod_2 (bool, optional) – Whether to enforce that there’s only an odd number of each detector in the syndrome, by default True.

Methods#

OrderedSyndrome.as_bitstring

Convert OrderedSyndrome to a bitstring, with num_bits bits.

OrderedSyndrome.as_layers

Create a sequence of layers from a syndrome, where each layer is a collection of integers representing the detectors triggered on that layer.

OrderedSyndrome.count

OrderedSyndrome.from_bitstring

Create an ordered syndrome from a bistring.

OrderedSyndrome.from_layers

Create a syndrome from a sequence of layers, where each layer is a collection of integers representing the detectors triggered on that layer.

OrderedSyndrome.index

Raises ValueError if the value is not present.

OrderedSyndrome.isdisjoint

Return True if two sets have a null intersection.

OrderedSyndrome.split_at_symptom

Split OrderedSyndrome in to two lists of detection events in order, ending the first at the given detector event.

OrderedSyndrome.split_by_time_coord

Split the OrderedSyndrome into a time-ordered list of OrderedSyndromes, with layers number of items in the list.