Skip to content

Commit 6b70f32

Browse files
authored
Use 'tensor-network-decoder' in pip install instructions (#263)
The name`tensor_network_decoder` from the `.toml` file is normalized to be `tensor-network-decoder` in the wheel's METADATA. Newer version of `pip` is able to resolve this difference and `pip install cudaq-qec[tensor_network_decoder]` will work correctly. However, if you use an older version of `pip/setuptools`, you'll see an error such as "cudaq-qec 0.4.0 does not provide the extra 'tensor_network_decoder'". A safer alternative is to use the exact name as appeared in the METADATA (the normalized name with dash instead of underscore) such that even earlier versions of `pip` will find the package and install the dependencies as needed. --------- Signed-off-by: Melody Ren <[email protected]>
1 parent bfa374e commit 6b70f32

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
# [Begin Documentation]
1818
"""
19-
Example usage of tensor_network_decoder from cudaq_qec.
19+
Example usage of tensor_network_decoder from cudaq-qec.
2020
2121
This script demonstrates how to instantiate and use the tensor network decoder
2222
to decode a circuit level noise problem derived from a Stim surface code experiment.
2323
24-
This example requires the `cudaq-qec` package and the optional tensor-network dependencies.
24+
This example requires the `cudaq-qec` package and the optional tensor-network-decoder dependencies.
2525
To install the required dependencies, run:
2626
27-
pip install cudaq-qec[tensor_network_decoder]
27+
pip install cudaq-qec[tensor-network-decoder]
2828
29-
Additionaly, you will need `stim` and `beliefmatching` packages:
29+
Additionaly, in this example, you will need `stim` and `beliefmatching` packages:
3030
pip install stim beliefmatching
3131
3232
"""

libs/qec/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ not require a GPU to use, but some components are GPU-accelerated.
1919

2020
Note: if you would like to use our Tensor Network Decoder, you will need
2121
additional dependencies installed. You can install them with
22-
`pip install cudaq-qec[tensor_network_decoder]`.
22+
`pip install cudaq-qec[tensor-network-decoder]`.
2323

2424
## Getting Started
2525

libs/qec/python/bindings/py_decoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void bindDecoder(py::module &mod) {
284284
throw std::runtime_error(
285285
"Decoder 'tensor_network_decoder' is not available. "
286286
"To enable it, install the python module's dependencies via:\n\n"
287-
" pip install cudaq_qec[tensor_network_decoder]\n");
287+
" pip install cudaq-qec[tensor-network-decoder]\n");
288288
}
289289

290290
py::buffer_info buf = H.request();

libs/qec/python/tests/test_tensor_network_decoder_negative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_tensor_network_decoder_missing_dependencies():
3535

3636
# Verify the error message contains the expected C++ message and installation instructions
3737
error_msg = str(excinfo.value)
38-
assert "Decoder 'tensor_network_decoder' is not available" in error_msg and "pip install cudaq_qec[tensor_network_decoder]" in error_msg, f"Unexpected error message: {error_msg}"
38+
assert "Decoder 'tensor_network_decoder' is not available" in error_msg and "pip install cudaq-qec[tensor-network-decoder]" in error_msg, f"Unexpected error message: {error_msg}"
3939

4040
# Verify this is NOT a Python ImportError (which would indicate the graceful failure didn't work)
4141
assert not isinstance(

0 commit comments

Comments
 (0)