qldpc.circuits.memory.alpha_syndrome

Classes to define the AlphaSyndrome syndrome measurement strategies.

Attributes

DEFAULT_SINTER_DECODER

GateSchedule

Classes

AlphaSyndrome

AlphaSyndrome strategy for constructing a syndrome measurement circuit.

TreeNode

Node of a tree for Monte Carlo tree search (MCTS).

TreeState

The state of an MCTS tree, representing a (possibly incomplete) gate schedule.

Module Contents

class qldpc.circuits.memory.alpha_syndrome.AlphaSyndrome(noise_model: qldpc.circuits.noise_model.NoiseModel, decoder: sinter.Decoder | str = DEFAULT_SINTER_DECODER, iters_per_step: int = 1000, shots_per_iter: int = 10000, exploration_weight: float = math.sqrt(2), *, verbose: bool = True, seed: int | None = None)[source]

Bases: qldpc.circuits.memory.syndrome_measurement.SyndromeMeasurementStrategy

AlphaSyndrome strategy for constructing a syndrome measurement circuit.

Uses Monte-Carlo tree search (MCTS) to suppress hook errors. Currently only supports CSS codes.

For more information, see the paper at https://arxiv.org/abs/2601.12509.

WARNING: This strategy is extremely SLOW due to unsolved problem with multiprocessing and MCTS.

get_circuit(code: qldpc.codes.QuditCode, qubit_ids: qldpc.circuits.bookkeeping.QubitIDs | None = None) → tuple[stim.Circuit, qldpc.circuits.bookkeeping.MeasurementRecord][source]

Construct a circuit to measure the syndromes of a quantum error-correcting code.

Parameters:
  • code – The code whose syndromes we want to measure.

  • qubit_ids – Integer indices for the data and check (syndrome readout) qubits. Defaults to QubitIDs.from_code(code).

Returns:

A syndrome measurement circuit. circuits.MeasurementRecord: The record of measurements in the circuit.

Return type:

stim.Circuit

exploration_weight
iters_per_step = 1000
noise_model
random
shots_per_iter = 10000
sinter_decoding_kwargs: dict[str, str | dict[str, sinter.Decoder]]
verbose = True
class qldpc.circuits.memory.alpha_syndrome.TreeNode(state: TreeState, parent: TreeNode | None = None)[source]

Node of a tree for Monte Carlo tree search (MCTS).

TreeNode is agnostic to the problem being solved by MCTS. All problem data is handled by the TreeState.

References: - https://en.wikipedia.org/wiki/Monte_Carlo_tree_search

backpropagate(reward: float) → None[source]

Increase the value of this node and all of its parents.

best_child(exploration_weight: float) → TreeNode[source]

Select a child of this node with the highest UCB score.

expand() → TreeNode[source]

Construct a child of this node.

is_fully_expanded() → bool[source]

Have we constructed all children of this node?

is_terminal() → bool[source]

Is this a terminal node of the tree, which specifies a complete schedule?

simulate(rng: random.Random | None = None) → TreeState[source]

Select transitions at random until we reach a terminal node, and return its state.

children: list[TreeNode] = []
parent = None
state
unvisited
value = 0.0
visits = 0
class qldpc.circuits.memory.alpha_syndrome.TreeState[source]

The state of an MCTS tree, representing a (possibly incomplete) gate schedule.

static head(gates: collections.abc.Sequence[tuple[int, int]]) → TreeState[source]

A TreeState in which no gates have been scheduled.

is_terminal() → bool[source]

Have all gates been scheduled?

select(gate_index: int) → TreeState[source]

Append the gate at the given index to the gate schedule.

to_schedule() → GateSchedule[source]

Convert this TreeState into a gate schedule.

The schedule is provided as a list whose t-th entry is a list of gates to apply at time t. Unscheduled gates are excluded from the returned schedule.

transitions() → list[int][source]

The indices of gates that still need to be scheduled.

gate_to_time: list[int | None]
gates: list[tuple[int, int]]
target_to_min_time: list[int]
qldpc.circuits.memory.alpha_syndrome.DEFAULT_SINTER_DECODER
qldpc.circuits.memory.alpha_syndrome.GateSchedule