-
Notifications
You must be signed in to change notification settings - Fork 27
Tensor Network Decoder #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
libs/qec/python/cudaq_qec/plugins/decoders/tensor_network_decoder.py
Outdated
Show resolved
Hide resolved
Surprising thing I noticed on the way: the order I import stim and cudaq_qec matters.
|
Hmm, we will need to fix this. CUDA-Q includes a Stim-backed simulator. Perhaps it is re-exporting some Stim symbols that are conflicting with the true Python stim. Can you reproduce this a standalone CUDA-Q Python file? If so, I think it would be helpful to post a CUDA-Q issue here: https://github.com/NVIDIA/cuda-quantum/issues |
/ok to test adfd366 |
I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: e2658f8 I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 7ebf0bd I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 5efa209 I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 9f38207 I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: adfd366 Signed-off-by: Nicola Pancotti <[email protected]>
I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: b908a3f Signed-off-by: Nicola Pancotti <[email protected]>
/ok to test 4ea411f |
I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 5a9f4ac I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: c41eec4 I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 0521cd2 I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 413f737 Signed-off-by: Nicola Pancotti <[email protected]>
/ok to test 922156b |
1 similar comment
/ok to test 922156b |
I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 56621e0 Signed-off-by: Nicola Pancotti <[email protected]>
/ok to test f411628 |
I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: 2f86aa4 Signed-off-by: Nicola Pancotti <[email protected]>
/ok to test 8a90b6d |
I, Nicola Pancotti <[email protected]>, hereby add my Signed-off-by to this commit: a9fabd5 Signed-off-by: Nicola Pancotti <[email protected]>
/ok to test 0367c4c |
Signed-off-by: Nicola Pancotti <[email protected]>
Signed-off-by: Nicola Pancotti <[email protected]>
/ok to test 28616c6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great ... thanks, Nico!
This pull request adds a tensor network decoder to the python code base at
libs/qec/python/cudaq_qec/plugins/decoders/
The main entry point is the
TensorNetworkDecoder
class defined intensor_network_decoder.py
. The file contains the basic functionality to manipulate tensor networks and to dispatch to different backends.Other files in
decoders/tensor_network_utils/
noise_model.py
: helper functions to create tensor network representation of noise modelscontractors.py
: the tensor network contractors backends and path finderstensor_network_factory.py
: helper functions to build tensor networksFeatures
Initialization
Decoding
Single syndrome
a batch of syndromes
Circuit level noise
For circuit level noise, you can extract
H
,logicals
andnoise_model
from a Stim detector error model as follows.To run this example you need to install Beliefmatching and Stim in your enviroment
New dependencies
Testing
Pick the
<image-name>
for your platformghcr.io/nvidia/cudaqx-dev:latest-amd64
for AMD64 platformsghcr.io/nvidia/cudaqx-dev:latest-arm64
for ARM64 platformsThen
Inside the container
Set up the virtual environment & dependencies
If you modify anything in the python code, don't forget to run
ninja -C build
to propagate the modification.You can test the environment by running the example above. Copy the whole block below an paste it to the container bash shell. This creates a
tn_decoder.py
file with the example aboveAnd then
To run the actual tests, you can