Skip to content

Commit 6864535

Browse files
melody-renbmhowe23
andauthored
Update docs and guard for tensor network decoder (#241)
Signed-off-by: Melody Ren <[email protected]> Signed-off-by: melody-ren <[email protected]> Co-authored-by: Ben Howe <[email protected]>
1 parent 7c60a75 commit 6864535

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

docs/sphinx/api/qec/tensor_network_decoder_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
The decoder supports both single-syndrome and batch decoding, and can run on CPU or GPU (using cuTensorNet if available).
88

9-
The Tensor Network Decoder is a Python-only implementation. C++ APIs are not available for this decoder.
9+
The Tensor Network Decoder is a Python-only implementation and it requires Python 3.11 or higher. C++ APIs are not available for this decoder.
1010

1111

1212
.. note::

docs/sphinx/components/qec/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ Usage:
807807
808808
.. tab:: C++
809809

810-
The ``tensor_network_decoder`` is a Python-only implementation. C++ APIs are not available for this decoder.
810+
The ``tensor_network_decoder`` is a Python-only implementation and it requires Python 3.11 or higher. C++ APIs are not available for this decoder.
811811

812812
Output:
813813

docs/sphinx/examples/qec/python/tensor_network_decoder.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
# Check Python version
1010
# Remove this check once the pipeline advances to Python 3.11
1111
if sys.version_info < (3, 11):
12-
print("Skipping tensor network decoder example")
12+
print(
13+
"Warning: The tensor network decoder requires Python 3.11 or higher. Exiting..."
14+
)
1315
sys.exit(0)
1416

1517
# [Begin Documentation]
@@ -31,6 +33,13 @@
3133
import cudaq_qec as qec
3234
import numpy as np
3335

36+
import platform
37+
if platform.machine().lower() in ("arm64", "aarch64"):
38+
print(
39+
"Warning: stim is not supported on manylinux ARM64/aarch64. Skipping this example..."
40+
)
41+
sys.exit(0)
42+
3443
import stim
3544

3645
from beliefmatching.belief_matching import detector_error_model_to_check_matrices

docs/sphinx/examples_rst/qec/decoders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ check matrices (PCMs) and test syndromes to exercise a decoder.
9090

9191
.. [#f1] [BCGMRY] Sergey Bravyi, Andrew Cross, Jay Gambetta, Dmitri Maslov, Patrick Rall, Theodore Yoder, High-threshold and low-overhead fault-tolerant quantum memory https://arxiv.org/abs/2308.07915
9292
93-
Exact Maximum Likelihood Decoding with NVIDIA Tensor Networks Decoder
93+
Exact Maximum Likelihood Decoding with NVIDIA Tensor Network Decoder
9494
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9595

9696

@@ -99,7 +99,7 @@ CUDA-Q QEC library. The library follows the CUDA-Q decoder Python interface, nam
9999
At this time, we only support the Python interface for the decoder, which is
100100
available at :class:`cudaq_qec.plugins.decoders.tensor_network_decoder.TensorNetworkDecoder`.
101101
As documented in the API sections :ref:`tensor_network_decoder_api_python`, there are many configuration options
102-
that can be passed to the constructor.
102+
that can be passed to the constructor. The decoder requires Python 3.11 or higher.
103103

104104
In the following example, we show how to use the `TensorNetworkDecoder` class from the `cudaq_qec` library to decode a circuit-level noise problem derived from a Stim surface code circuit.
105105

0 commit comments

Comments
 (0)