You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor det order creation, restore optional index-based det ordering (#112)
In the paper we used detector indices to sort them and make the det
orders. This was actually an accident where we were trying to use the 3d
coordinates (xyt) from Stim but used Stim incorrectly (my bad).
This got fixed in a77f5e7 where we
started using the actual xyt coordinates.
This seems to offer a better tradeoff between beam and error rate, but
also led to issue
#103 because at
the same large beam we get worse performance (likely because there are
more distinct orderings which means more ways to get stuck)
We also added BFS det ordering in
bf62f84
and then made it the default in
0471d4e
Unfortunately due to a bug in p-ranav's argparse:
p-ranav/argparse#413
flags with implicit_value(false) do not work with store_into, which
means the `--no-det-order-bfs` arg had no effect.
Here, we refactor the det order creation to have 3 arguments:
```
--det-order-bfs Use BFS-based detector ordering (default if no method specified)
--det-order-index Randomly choose increasing or decreasing detector index order
--det-order-coordinate Random geometric detector orientation ordering
```
We also eliminate `--no-det-order-bfs` which had no effect anyways.
This is an example where the `--det-order-index` is faster:
```
bazel build src:all
./bazel-bin/src/tesseract --sample-num-shots 100 --circuit testdata/colorcodes/r\=11\,d\=11\,p\=0.001\,noise\=si1000\,c\=superdense_color_code_X\,q\=181\,gates\=cz.stim --sample-seed 71734 --threads 64 --beam 20 --beam-climbing --num-det-orders 21 --pqlimit 1000000 --det-order-seed 2384257 --print-stats --no-revisit-dets --det-order-coordinate
num_shots = 100 num_low_confidence = 0 num_errors = 0 total_time_seconds = 340.9752209999999
./bazel-bin/src/tesseract --sample-num-shots 100 --circuit testdata/colorcodes/r\=11\,d\=11\,p\=0.001\,noise\=si1000\,c\=superdense_color_code_X\,q\=181\,gates\=cz.stim --sample-seed 71734 --threads 64 --beam 20 --beam-climbing --num-det-orders 21 --pqlimit 1000000 --det-order-seed 2384257 --print-stats --no-revisit-dets --det-order-index
num_shots = 100 num_low_confidence = 0 num_errors = 0 total_time_seconds = 142.994753
```
This is achieved via a new enum class `DetOrder` in utils. It is also
now exposed via python API:
```
tesseract_decoder.utils.build_det_orders(
_DETECTOR_ERROR_MODEL,
num_det_orders=1,
method=tesseract_decoder.utils.DetOrder.DetIndex,
seed=0,
```
Fixes#103
---------
Co-authored-by: Noureldin <noureldinyosri@gmail.com>
0 commit comments