diff --git a/README.md b/README.md index 0b5e6d0..4f9d77f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ We tested the Tesseract decoder for: * **Detailed Statistics:** provides comprehensive statistics output, including shot counts, error counts, and processing times. * **Heuristics**: includes flexible heuristic options: `--beam`, `--det-penalty`, - `--beam-climbing`, `--no-revisit-dets`, `--at-most-two-errors-per-detector`, `--det-order-bfs` and `--pqlimit` to + `--beam-climbing`, `--no-revisit-dets`, `--at-most-two-errors-per-detector`, and `--pqlimit` to improve performance while maintaining a low logical error rate. To learn more about these options, use `./bazel-bin/src/tesseract --help` * **Visualization tool:** open the [viz directory](viz/) in your browser to view decoding results. See [viz/README.md](viz/README.md) for instructions on generating the visualization JSON. diff --git a/src/tesseract_main.cc b/src/tesseract_main.cc index 08aa163..bd33a9a 100644 --- a/src/tesseract_main.cc +++ b/src/tesseract_main.cc @@ -33,7 +33,7 @@ struct Args { // Manifold orientation options uint64_t det_order_seed; size_t num_det_orders = 10; - bool det_order_bfs = false; + bool det_order_bfs = true; // Sampling options size_t sample_num_shots = 0; @@ -382,10 +382,21 @@ int main(int argc, char* argv[]) { .metavar("N") .default_value(size_t(1)) .store_into(args.num_det_orders); - program.add_argument("--det-order-bfs") - .help("Use BFS-based detector ordering instead of geometric orientation") - .flag() + program.add_argument("--no-det-order-bfs") + .help("Disable BFS-based detector ordering and use geometric orientation") + .default_value(true) + .implicit_value(false) .store_into(args.det_order_bfs); + program.add_argument("--det-order-bfs") + .action([&](auto const&) { + std::cout << "BFS-based detector ordering is the default now; " + "--det-order-bfs is ignored." + << std::endl; + }) + .default_value(true) + .implicit_value(true) + .store_into(args.det_order_bfs) + .hidden(); program.add_argument("--det-order-seed") .help( "Seed used when initializing the random detector traversal " diff --git a/viz/README.md b/viz/README.md index 9ab04d7..1e5a51f 100644 --- a/viz/README.md +++ b/viz/README.md @@ -1,4 +1,4 @@ -# Visualization +#Visualization This tool displays the detectors and errors from a Tesseract decoding run in 3D. @@ -10,7 +10,7 @@ include only the lines used by the converter script: ```bash bazel build src:all && \ ./bazel-bin/src/tesseract \ - --sample-num-shots 1 --det-order-seed 13267562 --pqlimit 10000 --beam 1 --num-det-orders 20 --det-order-bfs \ + --sample-num-shots 1 --det-order-seed 13267562 --pqlimit 10000 --beam 1 --num-det-orders 20 \ --circuit testdata/colorcodes/r\=9\,d\=9\,p\=0.002\,noise\=si1000\,c\=superdense_color_code_X\,q\=121\,gates\=cz.stim \ --sample-seed 717347 --threads 1 --verbose | \ grep -E 'Error|Detector|activated_errors|activated_dets' > logfile.txt @@ -19,9 +19,10 @@ python viz/to_json.py logfile.txt -o logfile.json ``` -The `--det-order-bfs` flag is compatible with visualization logs. Just make -sure `--verbose` is enabled so the detector coordinates are printed for -`to_json.py` to parse. +The `--no-det-order-bfs` flag is compatible with visualization logs. BFS-based +detector ordering is now enabled by default, so include this flag only if you +want to disable it. Make sure `--verbose` is enabled so the detector +coordinates are printed for `to_json.py` to parse. The `to_json.py` script produces `logfile.json`, which contains the detector coordinates and animation frames for the viewer. @@ -31,4 +32,3 @@ coordinates and animation frames for the viewer. Open `viz/index.html` in a modern browser. It will automatically try to load `logfile.json` from the same directory. If the file picker is used, any JSON produced by `to_json.py` can be visualized. -