deltakit.core.decoding_graphs.inverse_logical_at_boundary#

deltakit.core.decoding_graphs.inverse_logical_at_boundary(decoding_graph: NXDecodingGraph, logical: set[DecodingEdge]) set[DecodingEdge]#

Given a decoding graph and a logical, that is assumed to be along the boundary, return another logical constructed of all the edges incident to the boundary that are not in the given logical.

On a surface code for example, if we gave the logical as the edges along one side of the surface, this function would return the logical made of the edges along the opposite side of the surface.

Parameters:
  • decoding_graph (NXDecodingGraph) – Decoding graph the logicals are defined over.

  • logical (Set[DecodingEdge]) – The logical to get the boundary inverse of. If this given logical is not consisting of only edges along the boundary, then an exception will be raised.

Returns:

A logical along the boundary, the inverse of the given logical.

Return type:

Set[DecodingEdge]

Raises:

ValueError – Exception raised if the the logical is not entirely along the boundary of the graph. This includes if the logical has an edge not in the graph.