Skip to content

Conversation

@noajshu
Copy link
Contributor

@noajshu noajshu commented Aug 3, 2025

  • The flag --det-order-bfs significantly improves the performance of tesseract for decoding e.g. color code circuit-level noise
  • There is no way to use it from python currently because the logic is contained in tesseract_main.cc
  • Here, we move it into utils and expose it in the python module

Copy link
Collaborator

@LalehB LalehB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thank you Noah.
btw since the bfs ordering is by default on, is this mostly for the cases that we might want to turn it off?

def test_build_det_orders_no_bfs():
assert tesseract_decoder.utils.build_det_orders(
_DETECTOR_ERROR_MODEL, num_det_orders=1, det_order_bfs=False, seed=0
) == [[0, 1]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that for this DEM, with bfs and no bfs will have the same det_orders, right?

if (det_order_bfs) {
auto graph = build_detector_graph(dem);
std::uniform_int_distribution<size_t> dist_det(0, graph.size() - 1);
for (size_t det_order = 0; det_order < num_det_orders; ++det_order) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for moving the build_det_orders to the util folder! it makes more sense :-) maybe later we break this build_det_orders function into smaller helper functions such as generate_bfs_order and more.

@noajshu noajshu merged commit f78ce8a into quantumlib:main Aug 5, 2025
4 checks passed
@NoureldinYosri NoureldinYosri mentioned this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants