Skip to content

Add magic state distillation tutorial#311

Merged
david-pl merged 12 commits intomainfrom
rafaelha/magic_state_distillation_tutorial
Jan 29, 2026
Merged

Add magic state distillation tutorial#311
david-pl merged 12 commits intomainfrom
rafaelha/magic_state_distillation_tutorial

Conversation

@rafaelha
Copy link
Contributor

This is a tutorial showing how to use TSIM with bloqade-circuit

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-01-29 16:23 UTC

@rafaelha rafaelha requested a review from david-pl January 27, 2026 22:38
@rafaelha
Copy link
Contributor Author

Otherwise, pages will not be rendered but just downloaded
mkdocs.yml Outdated
execute: true
allow_errors: false
ignore: ["scripts/*", "digital/examples/qasm2/*"]
execute_ignore: ["scripts/*", "digital/examples/qasm2/*", "digital/examples/tsim/magic_state_distillation.ipynb"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When ignore is used, pages are actually not rendered, but downloaded.

I assume what was meant is execute_ignore

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, that's the appropriate fix for #310. Anyway, that's good, thanks!

Why aren't we executing the new notebook though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two reasons: It would only run once the new version of bloqade-circuit is released (with the tsim integration). The other reason is it takes about 10 mins to run on CI (2 mins locally). If we really wanted it to run, I might have to do some optimizing (or remove some slow parts)

@rafaelha rafaelha requested a review from plquera January 27, 2026 22:54
Copy link
Contributor

@david-pl david-pl left a comment

Choose a reason for hiding this comment

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

Can you convert the notebook to juptext? Otherwise it's not very nice to review here.
I suppose it also has something to do with not executing the notebook on build though, right?

Copy link
Contributor

@david-pl david-pl left a comment

Choose a reason for hiding this comment

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

Looks good, just one very minor nit! Feel free to merge when it's ready from your side.

)

# %% [markdown]
# After distillation, the fidelity has increased to 99.7%. This is much better than the original 97% of the individual input magic states. A downside is that the distillation process is only successful 13.7% of the time. This means, we have to repeat the distillation process multiple times until we get a good output state.
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we actually execute the notebook, it won't always be exactly 13.7%

@david-pl david-pl merged commit dca42b3 into main Jan 29, 2026
9 of 10 checks passed
@david-pl david-pl deleted the rafaelha/magic_state_distillation_tutorial branch January 29, 2026 16:15
@rafaelha rafaelha self-assigned this Jan 29, 2026
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