localuf.decoders.buf

Classes

BUF(code[, dynamic, inclination])

The graph used by Bucket UF.

class localuf.decoders.buf.BUF(code, dynamic=False, inclination='default')[source]

Bases: UF

The graph used by Bucket UF.

Extends decoders.UF.

Attributes:

  • mvl an integer of the minimum vision length of

    all active clusters at the start of a growth round.

Methods:

  • _update_mvl.

  • _demote_cluster.

Overriden attributes:

  • buckets replaces active_clusters and maps each integer

    to a set of all active clusters whose vision length is that integer. It is important that its keys is in ascending order as it is used by _update_mvl().

Overriden methods:

  • reset.

  • load.

  • validate_syndrome.

  • _merge.

  • _update_self_after_union.

Parameters:
  • code (Code)

  • dynamic (bool)

  • inclination (Literal['default', 'west'])

reset()[source]

Factory reset.

Parameters:

no_boundaries – whether to treat all boundary nodes as detectors too.

load(syndrome)[source]

Load a new syndrome.

validate(syndrome, log_history=False)[source]

Grow clusters (always shortest vision first) until they are all valid.

Parameters:

syndrome (set[tuple[int, ...]])

static_merge(cu, cv)[source]

Merge clusters cu and cv along edge uv for static UF.

dynamic_merge(cu, cv, e)[source]

Merge clusters cu and cv along edge uv for dynamic UF.