Skip to main content
17 Decoder Configurations · Stim DEM · Generated API Index

Technical Reference

API overview for QECTOR's decoders. The guided entries below cover the most used classes and functions; their signatures and defaults follow the API index at the end of this page, which is generated from the published 1.0.1 package.

Classes & Functions

BlossomDecoder

Minimum-weight perfect matching (MWPM) decoder via Edmonds' Blossom algorithm. Graphlike inputs only: every qubit may take part in at most two checks. Hypergraph and qLDPC check matrices go to BpOsdDecoder instead.

Signature
BlossomDecoder(check_to_qubits, n_qubits=None, edge_weights=None)
Parameters
NameTypeDefaultDescription
check_to_qubitslist[list[int]]RequiredFor each check, the indices of the qubits it covers
n_qubitsintNoneNumber of data qubits
edge_weights-NoneOptional matching weights, one per qubit; set_edge_weights(weights) changes them later

Types come from the package signature where it is annotated, otherwise from documented usage; "-" means neither states one.

Usage Example
blossomdecoder_usage.pypython
import numpy as np
from qector_decoder_v3 import BlossomDecoder, generate_parity_check_matrix

# Distance-5 repetition code: 5 data qubits, 4 parity checks.
check_to_qubits = [[0, 1], [1, 2], [2, 3], [3, 4]]
H = generate_parity_check_matrix(check_to_qubits, 5)
syndrome = np.array([0, 1, 1, 0], dtype=np.uint8)

decoder = BlossomDecoder(check_to_qubits, n_qubits=5)
correction = np.asarray(decoder.decode(syndrome), dtype=np.uint8)
assert np.array_equal((H @ correction) % 2, syndrome)   # H c = s (mod 2)

API index

Generated from the published qector-decoder-v3 1.0.1 wheel on 2026-11-06: every public name in qector_decoder_v3, with the signature Python reports and the first paragraph of its docstring. 113 names.

  • classAmbiguityClusterDecoder(check_to_qubits, n_qubits=None, error_rate=0.05, ambig_threshold=0.5, max_cluster_size=12)

    C1-02: BP + ambiguity-clustered exact decoding for qLDPC codes.

    4 public methods
    • batch_decode(self, syndromes)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
  • classAutoDecoder(check_to_qubits, n_qubits=None, config: 'BackendConfig | None' = None)

    Workload-aware, self-debugging decoder that routes to CUDA / OpenCL / Rayon / CPU / Fallback.

    8 public methods
    • auto_select(checks, n_qubits, batch_size=1)
    • available_backends(self) -> 'list[str]'
    • batch_decode(self, syndromes) -> 'np.ndarray'
    • calibrate(self, sizes=(64, 256, 1024, 4096, 16384), repeats: 'int' = 3, seed: 'int' = 0)
    • decode(self, syndrome) -> 'np.ndarray'
    • diagnostics(self) -> 'dict'
    • reset_backend_health(self) -> 'None'
    • select(self, batch_size: 'int') -> 'str'
  • classAutoRouter(*, priority: 'str' = 'balanced', hardware: 'HardwareLike' = None, error_rate: 'float' = 0.05, code_family: 'Any' = None, use_native_auto: 'bool' = True) -> 'None'

    Construct, cache, and dispatch the policy-selected decoder for a problem.

    2 public methods
    • decode(self, checks_or_H: 'Any', syndromes: 'Any', **ctx: 'Any') -> 'np.ndarray'
    • explain(self, checks_or_H: 'Any' = None, syndromes: 'Any' = None, **ctx: 'Any') -> 'dict[str, Any]'
  • classBPOSDDecoder(check_to_qubits, n_qubits=None, error_rate=0.1, bp_method=None, osd_order=None)

    Belief Propagation + Ordered Statistics Decoding.

    7 public methods
    • batch_decode(self, syndromes)
    • bp_decode(self, syndrome, max_iterations=20)
    • decode(self, syndrome)
    • decode_batch_flat(self, flat_syndromes, num_shots, stride=None)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • decode_timed(self, syndrome, max_latency_ms=10.0)
  • classBackend()

    Backend identifiers & Fallback Tiers.

  • classBackendConfig(rayon_threshold: 'int' = 8, gpu_threshold: 'int' = 4096, allow_gpu: 'bool' = True, prefer: 'str' = 'cuda', force: 'str | None' = None, enable_auto_debug: 'bool' = True) -> None

    Tunable thresholds and policy for :class:`AutoDecoder`.

  • classBatchDecoder(check_to_qubits, n_qubits=None)

    Parallel batch decoder using Rayon (Rust data parallelism).

    5 public methods
    • batch_decode(self, syndromes)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • parallel_batch_decode(self, syndromes)
  • classBatchedBpDecoder(H: 'Any', *, error_rate: 'float' = 0.05, priors: 'Any' = None, max_iter: 'int' = 30, alpha: 'float' = 1.0, bp_method: 'str' = 'min_sum', prefer_gpu: 'bool' = True) -> 'None'

    Batched belief-propagation decoder over a fixed GF(2) check matrix ``H``.

    1 public methods
    • decode_batch(self, syndromes: 'Any', *, return_llr: 'bool' = False, early_stop: 'bool' = True) -> 'tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, np.ndarray]'
  • classBeliefMatching(matrices: '_Matrices', max_iter: 'int' = 30, bp_shortcut: 'bool' = False)

    Belief-propagation + minimum-weight perfect matching decoder.

    7 public methods
    • decode(self, syndrome) -> 'np.ndarray'
    • decode_batch(self, shots) -> 'np.ndarray'
    • decode_correction(self, syndrome) -> 'np.ndarray'
    • decode_observables(self, syndrome) -> 'np.ndarray'
    • from_detector_error_model(dem: 'Any', max_iter: 'int' = 20) -> 'BeliefMatching'
    • from_numpy_h(H, error_rate: 'float' = 0.05, max_iter: 'int' = 20) -> 'BeliefMatching'
    • from_stim_circuit(circuit, max_iter: 'int' = 20) -> 'BeliefMatching'
  • classBenchmarkSuite(check_to_qubits, n_qubits=None, n_samples=10000, seed=42)

    Production benchmark suite. Wraps Rust-native benchmarking.

    2 public methods
    • run(self)
    • save(self, path, results)
  • classBlossomDecoder(check_to_qubits, n_qubits=None, edge_weights=None)

    Minimum-Weight Perfect Matching (MWPM) decoder via Edmonds' Blossom algorithm.

    6 public methods
    • batch_decode(self, syndromes)
    • batch_decode_weighted(self, syndromes, weights)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • set_edge_weights(self, weights)
  • classBpOsdDecoder(H: 'Any', error_rate: 'float' = 0.05, priors: 'Any' = None, max_iter: 'int' = 30, ms_scale: 'float' = 1.0, osd_order: 'int' = 0, bp_method: 'str' = 'sum_product', use_gpu: 'Any' = None, max_latency_ms: 'float | None' = None, damping: 'float' = 0.0, osd_lambda: 'Any' = None)

    BP + ordered-statistics decoder for general GF(2) check matrices.

    4 public methods
    • batch_decode(self, syndromes) -> 'np.ndarray'
    • decode(self, syndrome) -> 'np.ndarray'
    • decode_correction(self, syndrome) -> 'np.ndarray'
    • decode_observables(self, syndrome, observables_matrix: 'Any' = None) -> 'np.ndarray'
  • classCPUBatchDecoder(check_to_qubits, n_qubits=None)

    SIMD-friendly CPU batch decoder with pooled buffers and SoA transposition.

    3 public methods
    • batch_decode(self, syndromes)
    • batch_decode_par(self, syndromes)
    • decode(self, syndrome)
  • classCUDABatchDecoder(check_to_qubits, n_qubits=None, edge_weights=None)
    3 public methods
    • batch_decode(self, /, syndromes)
    • is_available()
    • reset(self, /)
  • classCUDABpOsdDecoder(check_to_qubits, n_qubits, error_rate)
    1 public methods
    • batch_decode(self, /, syndromes)
  • classColourCodeDecoder(dem: 'Any', max_iter: 'int' = 30, osd_order: 'int' = 0, method: 'str' = 'bposd')

    Colour-code decoder: BP-OSD over the undecomposed hypergraph DEM.

    6 public methods
    • decode(self, syndrome) -> 'np.ndarray'
    • decode_batch(self, syndromes) -> 'np.ndarray'
    • decode_correction(self, syndrome) -> 'np.ndarray'
    • decode_observables(self, syndrome) -> 'np.ndarray'
    • from_detector_error_model(dem: 'Any', max_iter: 'int' = 30, osd_order: 'int' = 0) -> 'ColourCodeDecoder'
    • from_stim_circuit(circuit: 'Any', max_iter: 'int' = 30, osd_order: 'int' = 0) -> 'ColourCodeDecoder'
  • classDecodeResult(correction: 'np.ndarray', syndrome: 'np.ndarray', n_qubits: 'int', n_checks: 'int', weight: 'float | None' = None, logical_flips: 'np.ndarray | None' = None, decode_seconds: 'float | None' = None, backend: 'str' = 'cpu', fallback: 'bool' = False, fallback_reason: 'str' = '', syndrome_valid: 'bool | None' = None, metadata: 'dict' = <factory>) -> None

    Result of decoding a single syndrome, with diagnostics and metadata.

    5 public methods
    • as_uint8(self) -> 'np.ndarray'
    • explain(self) -> 'str'
    • to_dict(self) -> 'dict'
    • to_json(self, indent: 'int' = 2) -> 'str'
    • verify(self, H: 'np.ndarray') -> 'bool'
  • classDecoderName()

    String identifiers for the routable decoders.

  • classDecoderPool(check_to_qubits=None, n_qubits=None, decoder_type: 'str' = 'fast_union_find', n_workers: 'int | None' = None, num_threads: 'int | None' = None)

    Multi-process decoder pool for parallel syndrome decoding.

    2 public methods
    • close(self)
    • decode(self, syndromes) -> 'np.ndarray'
  • classDetectorGraph(check_to_qubits, syndrome, check_positions=None, check_types=None, base_weights=None, n_qubits=None)

    Detector graph used by the GNN and hybrid decoder paths.

    1 public methods
    • update_syndrome(self, syndrome)
  • classFastUnionFindDecoder(check_to_qubits, n_qubits=None, edge_weights=None)

    Union-Find with a zero-allocation hot path, reusable buffers and a C ABI.

    7 public methods
    • batch_decode(self, syndromes)
    • decode(self, syndrome)
    • decode_batch_flat(self, flat_syndromes, num_shots, stride=None)
    • decode_batch_into_flat(self, flat_syndromes, num_shots, corrections, stride=None)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • set_edge_weights(self, edge_weights)
  • classGNNBeliefMatcher(check_to_qubits, n_qubits=None, *, gnn=None, hidden_size: 'int' = 32, n_layers: 'int' = 2, train_samples: 'int' = 0, error_rate: 'float' = 0.05, train_epochs: 'int' = 3, seed=None)

    End-to-end GNN-guided minimum-weight perfect matching decoder.

    2 public methods
    • batch_decode(self, syndromes) -> 'np.ndarray'
    • decode(self, syndrome) -> 'np.ndarray'
  • classGNNPredecoder(node_feat_dim=None, edge_feat_dim=None, hidden_size=16, n_layers=2)

    Graph Neural Network Pre-Decoder for dynamic edge weight prediction.

    6 public methods
    • forward(self, graph)
    • load_weights(self, path)
    • new_standard(hidden_size=16, n_layers=2)
    • predict_with_node_probs(self, graph)
    • save_weights(self, path)
    • train(self, graphs, targets, n_epochs)
  • classGNNTrainer(check_to_qubits, n_qubits, error_rate=0.1)

    End-to-end GNN training pipeline with Blossom teacher model.

    3 public methods
    • generate_dataset(self, n_samples)
    • train(self, gnn, n_samples, n_epochs)
    • train_bp(self, gnn, n_samples, n_epochs, max_bp_iter=20)
  • classHardwareProfile(cuda_rust: 'bool' = False, gpu: 'bool' = False) -> None

    Resolved view of the GPU capability the policy should assume.

    2 public methods
    • as_dict(self) -> 'dict[str, bool]'
    • detect() -> 'HardwareProfile'
  • classHybridCascadeDecoder(check_to_qubits, n_qubits=None, edge_weights=None, max_accept_weight=None, escalation=None, error_rate=None)

    Hybrid cascading decoder: Union-Find pre-filter + Blossom/BP-OSD escalation.

    6 public methods
    • batch_decode(self, syndromes)
    • batch_decode_timed(self, syndromes, max_latency_ms=10.0)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • decode_timed(self, syndrome, max_latency_ms=10.0)
  • classHybridDecoder(check_to_qubits, n_qubits=None, check_positions=None, check_types=None, base_weights=None, gnn_hidden_size=64, gnn_n_layers=3)

    GNN Pre-Decoder + SparseBlossom hybrid decoder.

    12 public methods
    • batch_decode_hybrid(self, syndromes)
    • batch_decode_standard(self, syndromes)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_heuristic(self, syndrome)
    • decode_hybrid(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • decode_standard(self, syndrome)
    • load_weights(self, path)
    • save_weights(self, path)
    • train(self, n_samples, n_epochs, error_rate=0.1)
    • train_bp(self, n_samples, n_epochs, error_rate=0.1, max_bp_iter=20)
  • classLERBenchmark()

    Logical Error Rate benchmark suite.

    1 public methods
    • run_all(self)
  • classLookupTableDecoder(check_to_qubits, n_qubits=None)

    Exact lookup-table decoder with UnionFind fallback.

    3 public methods
    • batch_decode(self, syndromes)
    • build_table(self, max_entries)
    • decode(self, syndrome)
  • constantMAX_WORKERS
  • classMatching(H: 'Any' = None, weights: 'Any' = None, faults_matrix: 'Any' = None)

    Minimum-weight perfect-matching decoder with a PyMatching-style API.

    10 public methods
    • add_boundary_edge(self, node: 'int', fault_ids: 'Any' = None, weight: 'float' = 1.0, **_: 'Any') -> 'None'
    • add_edge(self, node1: 'int', node2: 'int', fault_ids: 'Any' = None, weight: 'float' = 1.0, **_: 'Any') -> 'None'
    • check_matrix(self) -> 'np.ndarray'
    • decode(self, syndrome: 'Sequence[int]') -> 'np.ndarray'
    • decode_batch(self, shots: 'Any') -> 'np.ndarray'
    • decode_to_edges_array(self, syndrome: 'Sequence[int]') -> 'np.ndarray'
    • edges(self) -> 'list[tuple[int | None, int | None, dict]]'
    • from_check_matrix(H: 'Any', weights: 'Any' = None, faults_matrix: 'Any' = None, **_: 'Any') -> 'Matching'
    • from_detector_error_model(dem: 'Any') -> 'Matching'
    • from_stim_dem(dem: 'Any') -> 'Matching'
  • classNativeAutoDecoder(check_to_qubits, n_qubits=None, distance=5, noise_rate=0.01, batch_size=1, is_qldpc=False)
    3 public methods
    • batch_decode(self, /, syndromes)
    • batch_decode_strided(self, /, syndromes, stride=None, require_alignment=False)
    • decode(self, /, syndrome)
  • classNeuralPredecoder(n_input, n_output, n_hidden1=None, n_hidden2=None)

    Lightweight MLP pre-decoder with Xavier initialization and SGD training.

    5 public methods
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • predict(self, syndrome)
    • train(self, syndromes, corrections, n_epochs, learning_rate=0.01)
  • classOpenCLBatchDecoder(*a, **k)

    OpenCL batch decoder - requires source build with --features opencl.

    1 public methods
    • is_available()
  • classPredecodedDecoder(check_to_qubits, n_qubits=None, backend: 'str' = 'blossom')

    Local-matching predecoder + exact/fast residual decoder.

    2 public methods
    • batch_decode(self, syndromes) -> 'np.ndarray'
    • decode(self, syndrome) -> 'np.ndarray'
  • classRecommendation(decoder: 'str', reason: 'str', family: 'str', priority: 'str', batch_size: 'int', hardware: 'dict[str, bool]', gpu_batched_bp: 'bool' = False, forced: 'bool' = False, graphlike: 'bool | None' = None, distance: 'int | None' = None, n_qubits: 'int | None' = None) -> None

    A decoder choice plus the reasoning and inputs that produced it.

    1 public methods
    • as_dict(self) -> 'dict[str, Any]'
  • classSlidingWindowDecoder(check_to_qubits, n_qubits=None, window_size=10, decay_factor=0.8, check_types=None, p_data=None, p_meas=None)

    Sliding-window decoder with exponential decay weighting or fault-tolerant space-time decoding.

    6 public methods
    • decode(self, syndrome=None)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • detector_history(self)
    • flush(self)
    • update(self, round_syndrome)
  • classSpaceTimeDecoder(check_to_qubits, check_types, n_rounds, p_data, p_meas, n_qubits=None)

    PyO3 wrapper for [`SpaceTimeDecoder`]: fault-tolerant temporal decoding via XOR-of-consecutive-rounds detectors matched on a 3D (space x time) graph, as opposed to [`crate::sliding_window::PySlidingWindowDecoder`] /…

    3 public methods
    • decode_history(self, /)
    • reset(self, /)
    • update(self, /, round_syndrome)
  • classSparseBlossomDecoder(check_to_qubits, n_qubits=None, edge_weights=None)

    Region-growing Sparse Blossom decoder with RadixHeap.

    5 public methods
    • batch_decode(self, syndromes)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • decode_with_weights(self, syndrome, weights)
  • classStreamingDecoder(check_to_qubits, n_qubits=None, history_size=10, check_types=None, p_data=None, p_meas=None)

    Streaming decoder that accumulates syndromes over multiple rounds.

    7 public methods
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • decode_rounds(self, rounds)
    • detector_history(self)
    • flush(self)
    • update(self, round_syndrome)
  • classStreamingResult(corrections: 'np.ndarray', syndromes: 'np.ndarray', telemetry: 'StreamingTelemetry', logical_flips: 'np.ndarray | None' = None) -> None

    Outcome of a full streaming decode.

    1 public methods
    • is_valid(self, H: 'Any', *, prefer_gpu: 'bool' = True) -> 'bool'
  • classStreamingSession(code_or_checks: 'Any', n_qubits: 'int | None' = None, *, window_size: 'int' = 8, decoder: 'Any | None' = None, logicals: 'Any' = None, prefer_gpu: 'bool | None' = None) -> 'None'

    Incremental multi-round decode with a sliding commit buffer.

    6 public methods
    • committed_corrections(self) -> 'np.ndarray'
    • committed_syndromes(self) -> 'np.ndarray'
    • flush(self) -> 'list[np.ndarray]'
    • push_round(self, syndrome: 'Any') -> 'list[np.ndarray]'
    • reset(self) -> 'None'
    • run(self, syndrome_rounds: 'Any') -> 'StreamingResult'
  • classStreamingTelemetry(rounds: 'int' = 0, windows: 'int' = 0, committed: 'int' = 0, decode_seconds: 'float' = 0.0, per_window_seconds: 'list[float]' = <factory>, gpu: 'dict[str, int]' = <factory>, backend: 'dict[str, Any]' = <factory>, rounds_valid: 'int | None' = None) -> None

    Real, measured counters for a streaming decode run.

    2 public methods
    • as_dict(self) -> 'dict[str, Any]'
    • record_window(self, seconds: 'float', rounds: 'int' = 1) -> 'None'
  • classTwoStageDecoder(check_to_qubits, check_types, n_qubits=None, x_decoder='blossom', z_decoder='blossom')

    C1-03: Correlated two-stage matching for CSS codes.

    4 public methods
    • batch_decode(self, syndromes)
    • decode(self, syndrome)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
  • classUnionFindDecoder(check_to_qubits, n_qubits=None, edge_weights=None)

    Production-ready Union-Find quantum error correction decoder.

    7 public methods
    • batch_decode(self, syndromes)
    • decode(self, syndrome)
    • decode_batch_flat(self, flat_syndromes, num_shots, stride=None)
    • decode_batch_into_flat(self, flat_syndromes, num_shots, corrections, stride=None)
    • decode_correction(self, syndrome)
    • decode_observables(self, syndrome, observables_matrix=None)
    • set_edge_weights(self, edge_weights)
  • classWorkbench() -> 'None'

    Controller for the QECTOR Workbench (load → benchmark → export).

    17 public methods
    • cancel_job(self, job_id: 'str') -> 'str'
    • detect_backends(self) -> 'dict'
    • environment_snapshot(self) -> 'dict'
    • export_csv(self, artifact: 'dict', path: 'str') -> 'str'
    • export_json(self, artifact: 'dict', path: 'str') -> 'str'
    • export_pdf(self, artifact: 'dict', path: 'str') -> 'str'
    • get_job(self, job_id: 'str') -> 'dict'
    • get_license_info(self) -> 'dict'
    • job_artifact(self, job_id: 'str') -> 'dict | None'
    • list_jobs(self) -> 'list[dict]'
    • load_dem(self, source: 'Any') -> 'dict'
    • load_stim(self, source: 'Any') -> 'dict'
    • run_benchmark(self, spec: 'dict', job: 'Job | None' = None) -> 'dict'
    • set_license_key(self, key: 'str') -> 'None'
    • shutdown(self) -> 'None'
    • submit_job(self, spec: 'dict') -> 'str'
    • wait(self, job_id: 'str', timeout: 'float | None' = None) -> 'dict'
  • modulebackend

    qector_decoder_v3.backend - Workload-Aware AutoDecoder with Self-Auto-Debug & Multi-Tier Fallback.

  • functionbatched_bp_decode(H: 'Any', syndromes: 'Any', *, error_rate: 'float' = 0.05, priors: 'Any' = None, max_iter: 'int' = 30, alpha: 'float' = 1.0, bp_method: 'str' = 'min_sum', prefer_gpu: 'bool' = True, early_stop: 'bool' = True, return_llr: 'bool' = False) -> 'tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, np.ndarray]'

    Decode a stack of syndromes with batched belief propagation.

  • modulebelief_matching

    qector_decoder_v3.belief_matching - belief-propagation + MWPM (belief-matching).

  • modulebenchmarking

    qector_decoder_v3.benchmarking - reproducible, statistically-honest benchmarks.

  • modulebp_cupy

    qector_decoder_v3.bp_cupy - batched, GPU-resident belief propagation.

  • modulebposd

    qector_decoder_v3.bposd - belief propagation + ordered-statistics decoding.

  • functionchangelog() -> str

    Return a human-readable changelog string for the loaded package.

  • functioncheck_to_edges(check_to_qubits)

    Convert check_to_qubits to edge list.

  • functionclear_decoder_cache()

    Clear the in-memory decoder and decoder pool LRU caches.

  • modulecodes

    qector_decoder_v3.codes - Code-family helpers.

  • modulecolour_code

    C1-04: Colour-code decoder.

  • functioncompute_detector_differences(history)

    Computes XOR detector differences across consecutive syndrome rounds: detector_t = raw_t ^ raw_{t-1}.

  • functioncuda_is_available()
  • functiondecode_mmap(syndrome_path: 'str', output_path: 'str', check_to_qubits, n_qubits: 'int', decoder_type: 'str' = 'cpu_batch', batch_size: 'int' = 65536, n_shots: 'int | None' = None, dtype: '_np.dtype' = dtype('uint8'), verbose: 'bool' = False)

    Out-of-core batch decoding via memory-mapped arrays.

  • functiondecode_with_diagnostics(code: 'Any', syndrome: 'Sequence[int]', kind: 'str' = 'blossom', decoder: 'Any' = None, logicals: 'np.ndarray | None' = None) -> 'DecodeResult'

    Decode one syndrome and return a fully-populated :class:`DecodeResult`.

  • functiondecode_with_gnn(check_to_qubits, n_qubits, syndrome, **kwargs) -> 'np.ndarray'

    One-shot GNN-guided MWPM decode (see :class:`GNNBeliefMatcher`).

  • moduledecoder_cache

    qector_decoder_v3.decoder_cache - LRU-decoder cache and factory functions.

  • moduledecoder_pool

    qector_decoder_v3.decoder_pool - Multi-process decoder pool.

  • moduledem

    qector_decoder_v3.dem - Stim Detector Error Model (DEM) loader.

  • functiondetect_hardware() -> 'HardwareProfile'

    Return the live :class:`HardwareProfile` (alias for ``HardwareProfile.detect``).

  • functionenforce_distance_cap(distance) -> None

    Enforce that *distance* does not exceed the active tier's cap.

  • functionenforce_unlocked() -> None

    Hard-gate decode path when no valid license is active (QECTOR_ENFORCE=1).

  • functionestimate_distance(check_to_qubits, n_qubits=None)

    Python wrapper for estimate_distance.

  • functionflush_usage(customer_id: 'str | None' = None, api_key: 'str | None' = None) -> dict

    Flush accumulated decode shots to the Stripe Billing Meter Events API.

  • functionfrom_circuit(circuit, decoder_type='blossom', **kwargs)

    Build a decoder from a Stim circuit in one call.

  • functiongenerate_biconnected_qldpc_checks(n_qubits, degree)

    Generate a bipolar / biconnected qLDPC Tanner graph parity check matrix.

  • functiongenerate_parity_check_matrix(check_to_qubits, n_qubits=None)

    Return the binary parity-check matrix ``H`` for *check_to_qubits*.

  • functiongenerate_repetition_code_checks(distance)

    Generate a 1D repetition/chain code for testing.

  • functiongenerate_ring_code_checks(distance)

    Generate a simple 1D ring code for testing.

  • functiongenerate_space_time_surface_code_checks(distance, rounds)

    Generate 3D space-time surface code checks across multiple rounds.

  • functiongenerate_surface_code_checks(distance)

    Generate compact periodic (toric) surface-code checks.

  • functiongenerate_toy_code_checks(distance)

    Generate a toy code (not a proper quantum code) with d*d qubits for backward compatibility.

  • functiongenerate_triangular_color_code_4_8_8_checks(distance)

    Generate 4.8.8 triangular color code parity check matrix.

  • functionget_accumulated_shots() -> int

    Get total accumulated decode shots.

  • functionget_backend() -> 'GpuBackend'

    Return the cached :class:`GpuBackend` capability snapshot (built once).

  • functionget_decoder(checks_tuple: 'tuple[tuple[int, ...]]', n_qubits: 'int', decoder_type: 'str' = 'union_find')

    Get a decoder, constructing it once and caching for reuse.

  • functionget_decoder_pool(checks_tuple: 'tuple[tuple[int, ...]]', n_qubits: 'int', decoder_type: 'str' = 'union_find', n_workers: 'int | None' = None)

    Get a multi-process :class:`DecoderPool`, constructed once and cached.

  • functionget_latency_quantiles()

    `get_latency_quantiles() -> tuple[float, float, float] | None`

  • functionget_license_info() -> dict

    Get active license info dictionary.

  • functiongpu_available() -> 'bool'

    Return ``True`` iff CuPy is importable **and** a CUDA device is usable.

  • modulegpu_backend

    qector_decoder_v3.gpu_backend - the CuPy GPU backend abstraction.

  • functionhas_cuda_rust() -> 'bool'

    Return ``True`` iff the Rust ``CUDABatchDecoder`` reports a usable device.

  • functionhas_cupy() -> 'bool'

    Return ``True`` if the ``cupy`` module can be imported.

  • modulelicense
  • functionopencl_is_available()
  • modulepredecoder

    qector_decoder_v3.predecoder - a fast, faithful matching predecoder.

  • modulepymatching

    qector_decoder_v3.pymatching_compat - a PyMatching-compatible ``Matching`` API.

  • modulepymatching_compat

    qector_decoder_v3.pymatching_compat - a PyMatching-compatible ``Matching`` API.

  • moduleqiskit_plugin

    QECTOR Qiskit Plugin - optional integration with the Qiskit ecosystem.

  • functionrecommend(code_family: 'Any' = None, distance: 'int | None' = None, n_qubits: 'int | None' = None, batch_size: 'int' = 1, priority: 'str' = 'balanced', hardware: 'HardwareLike' = None, *, graphlike: 'bool | None' = None) -> 'Recommendation'

    Return a rich :class:`Recommendation` for a decoding problem.

  • functionrecommend_decoder(code_family: 'Any' = None, distance: 'int | None' = None, n_qubits: 'int | None' = None, batch_size: 'int' = 1, priority: 'str' = 'balanced', hardware: 'HardwareLike' = None) -> 'str'

    Return the *name* of the recommended decoder class (see :func:`recommend`).

  • functionrecord_shots(count: int) -> None

    Record decoding shots into telemetry buffer.

  • modulerest_api

    Minimal REST API for QECTOR.

  • moduleresult

    qector_decoder_v3.result - Rich decode results, diagnostics and debug output.

  • modulerouting

    qector_decoder_v3.routing - intelligent decoder router / auto-selection.

  • functionrun_mcp_server()

    Python signature: ```python run_mcp_server() ```

  • functionset_license_key(key: str) -> None

    Set the global QECTOR license key for tier enforcement.

  • functionset_license_key_file(path) -> None

    Load a license key from *path* and activate it.

  • modulesinter_compat

    qector_decoder_v3.sinter_compat - plug QECTOR into Sinter.

  • functionsliding_window_decode(syndrome_rounds: 'Any', code: 'Any' = None, *, check_to_qubits: 'Sequence[Sequence[int]] | None' = None, n_qubits: 'int | None' = None, window_size: 'int' = 8, decoder: 'Any | None' = None, logicals: 'Any' = None, prefer_gpu: 'bool | None' = None) -> 'StreamingResult'

    Decode a whole multi-round syndrome stream window-by-window.

  • functionsparse_blossom_radix_neighbors(decoder, defects, k=8)

    Return the k-nearest candidate edges (sorted by distance) for `defects`.

  • functionstart_metrics_server(addr='127.0.0.1:9090')

    Start the Prometheus metrics HTTP server.

  • modulestim_compat

    Stim compatibility layer - Conversion and wrappers for the Stim ecosystem.

  • modulestreaming

    qector_decoder_v3.streaming - a higher-level Python streaming / multi-round decode *orchestration* layer.

  • modulestripe_integration

    QECTOR Decoder v3 - Full Stripe API & Webhook License Fulfillment Integration

  • functionverify_license_token(token: 'str', customer_email: 'str' = '') -> 'bool'

    Verifies the license token signature completely offline using Ed25519.

  • moduleworkbench

    qector_decoder_v3.workbench - the QECTOR Workbench application controller.