Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 15 additions & 4 deletions src/tesseract_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 "
Expand Down
12 changes: 6 additions & 6 deletions viz/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Visualization
#Visualization

This tool displays the detectors and errors from a Tesseract decoding run in 3D.

Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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.