BaseDecoder
Bases: ABC
Simple base interface for quantum error correction decoders.
This is a pragmatic base class that provides a common interface for different decoding strategies without being overly abstract. Each decoder implementation handles its specific requirements while maintaining a consistent API.
Source code in src/color_code_stim/decoders/base.py
decode(detector_outcomes, **kwargs)
abstractmethod
Decode detector outcomes to predict observables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
detector_outcomes
|
ndarray
|
1D or 2D array of detector measurement outcomes. If 1D, interpreted as a single sample. If 2D, each row is a sample, each column a detector. |
required |
**kwargs
|
Additional decoder-specific parameters. |
{}
|
Returns:
Type | Description |
---|---|
ndarray
|
Predicted observable outcomes. Shape depends on the decoder implementation and input dimensions. |
Source code in src/color_code_stim/decoders/base.py
supports_comparative_decoding()
Check if this decoder supports comparative decoding.
Returns:
Type | Description |
---|---|
bool
|
True if the decoder can test multiple logical classes and return logical gaps for magic state distillation. |
Source code in src/color_code_stim/decoders/base.py
supports_predecoding()
Check if this decoder supports pre-decoding strategies.
Returns:
Type | Description |
---|---|
bool
|
True if the decoder supports erasure matching or belief propagation pre-decoding. |