-
Notifications
You must be signed in to change notification settings - Fork 18
Allow TesseractSinterDecoder to be compiled with different DEMs #130
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
Changes from 2 commits
2168aa5
a1a42f3
18ab131
9bd1108
a479f0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -212,6 +212,81 @@ print(f"Predicted errors indices: {predicted_errors}") | |||||
| for i in predicted_errors: | ||||||
| print(f" {i}: {decoder.errors[i]}") | ||||||
| ``` | ||||||
| ## Using Tesseract with Sinter | ||||||
|
|
||||||
| Tesseract can be easily integrated into [Sinter](https://github.com/quantumlib/Stim/tree/main/glue/sample) workflows. Sinter is a tool for running and organizing quantum error correction simulations. | ||||||
|
|
||||||
| Here's an example of how to use Tesseract as a decoder for multiple Sinter tasks: | ||||||
|
|
||||||
| ```python | ||||||
| import stim | ||||||
| import sinter | ||||||
| from tesseract_decoder import make_tesseract_sinter_decoders_dict | ||||||
|
|
||||||
| # Define a list of Sinter task(s) with different circuits/decoders. | ||||||
| tasks = [] | ||||||
| # These are the sensible defaults given by make_tesseract_sinter_decoders_dict(). | ||||||
| decoders = ['tesseract', 'tesseract-long-beam', 'tesseract-short-beam'] | ||||||
| for i, distance in enumerate([3, 5, 7]): | ||||||
| circuit = stim.Circuit.generated( | ||||||
| "repetition_code:memory", | ||||||
dandragona-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| distance=distance, | ||||||
| rounds=3, | ||||||
| after_clifford_depolarization=0.1 | ||||||
| ) | ||||||
| tasks.append(sinter.Task( | ||||||
| circuit=circuit, | ||||||
| decoder=decoders[i], | ||||||
| json_metadata={"d": distance, "decoder": decoders[i]}, | ||||||
| )) | ||||||
|
|
||||||
|
||||||
| # Collect decoding outcomes per task from Sinter. | ||||||
| results = sinter.collect( | ||||||
| num_workers=2, | ||||||
| tasks=tasks, | ||||||
| max_shots=10000, | ||||||
| decoders=decoders, | ||||||
| custom_decoders=tesseract_module.make_tesseract_sinter_decoders_dict(), | ||||||
|
||||||
| custom_decoders=tesseract_module.make_tesseract_sinter_decoders_dict(), | |
| custom_decoders=make_tesseract_sinter_decoders_dict(), |
Outdated
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.
I think it might be good to include one example of using the tesseract_decoder.TesseractSinterDecoder constructor with a full set of custom arguments. E.g. here's a full example (though maybe could be made more concise if combined with the example above):
import stim
import sinter
from tesseract_decoder import TesseractSinterDecoder
import tesseract_decoder
if __name__ == "__main__":
custom_sinter_decoder = TesseractSinterDecoder(
det_beam=10,
beam_climbing=True,
no_revisit_dets=True,
merge_errors=True,
pqlimit=1_000,
num_det_orders=5,
det_order_method=tesseract_decoder.utils.DetOrder.DetIndex,
seed=2384753,
)
p = 0.005
tasks = [
sinter.Task(
circuit=stim.Circuit.generated(
"surface_code:rotated_memory_x",
distance=d,
rounds=d,
after_clifford_depolarization=p,
),
json_metadata={"d": d, "r": d, "p": p},
)
for d in (3, 5)
]
results = sinter.collect(
num_workers=2,
tasks=tasks,
max_shots=10_000,
decoders=["custom-tesseract-decoder"],
custom_decoders={"custom-tesseract-decoder": custom_sinter_decoder},
print_progress=True,
)
Uh oh!
There was an error while loading. Please reload this page.