QECPolicy

class guppyft.code.steane.encode.QECPolicy(style: ~guppyft.code.steane.encode.QECStyle = QECStyle.Steane, threshold: int = 1, costs: ~guppyft.code.steane.encode.QECPolicy.OperationCosts = <factory>)[source]

Policy to determine when QEC cycles are injected.

Each logical block accumulates a cost based on costs. Once a block’s accumulated cost reaches threshold, a QEC cycle of the given style is performed on that block and its counter is reset.

style

The style of syndrome extraction to use (see QECStyle).

Type:

guppyft.code.steane.encode.QECStyle

threshold

Threshold at which a QEC cycle is triggered.

Type:

int

costs

See OperationCosts.

Type:

guppyft.code.steane.encode.QECPolicy.OperationCosts

class OperationCosts[source]

Configuration for operation costs. Used e.g. for applying QEC cycles.

__setattr__(key: str, value: Any) None[source]

Set a non-negative cost for a known logical operation.

__eq__(other)

Return self==value.

__init__(style: ~guppyft.code.steane.encode.QECStyle = QECStyle.Steane, threshold: int = 1, costs: ~guppyft.code.steane.encode.QECPolicy.OperationCosts = <factory>) None
__repr__()

Return repr(self).