Skip to content

implement translation of squin qubit loss to stim dialect #322

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

Merged
merged 7 commits into from
Jun 24, 2025

Conversation

johnzl-777
Copy link
Contributor

Translate the squin qubit loss statement into special stim form.

The necessity of this was brought to my attention by @ChenZhao44

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bloqade/stim/rewrite/util.py 94.73% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Jun 17, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8884 7841 88% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/bloqade/stim/_init_.py 100% 🟢
src/bloqade/stim/_wrappers.py 100% 🟢
src/bloqade/stim/dialects/noise/emit.py 100% 🟢
src/bloqade/stim/dialects/noise/stmts.py 100% 🟢
src/bloqade/stim/rewrite/qubit_to_stim.py 91% 🟢
src/bloqade/stim/rewrite/util.py 93% 🟢
src/bloqade/stim/rewrite/wire_to_stim.py 93% 🟢
TOTAL 97% 🟢

updated for commit: 61cb393 by action🐍

@kaihsin
Copy link
Contributor

kaihsin commented Jun 17, 2025

should implement a specialized stmt, not rewrite to TrivialError. The TrivialError is just a placeholder

Copy link
Contributor

@cduck cduck left a comment

Choose a reason for hiding this comment

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

I'm not familiar enough with the code to confidently approve but the loss definitions look good.

op.stmts.X: gate.X,
op.stmts.Y: gate.Y,
op.stmts.Z: gate.Z,
op.stmts.H: gate.H,
op.stmts.S: gate.S,
op.stmts.Identity: gate.Identity,
op.stmts.Reset: collapse.RZ,
squin_noise.stmts.QubitLoss: stim_noise.QubitLoss,
Copy link
Contributor

@cduck cduck Jun 17, 2025

Choose a reason for hiding this comment

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

Is the plan to list all of the squin noise ops here as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

no, the plan is to rewrite all squin gates and noise channels to cliffords (if not possible error.), and then we will have a program that contain only subset of squin stmts. We then run this rewrite

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright. To be precise, noise and loss are not Clifford. Do you mean include DEPOLARIZING_CHANNEL1 and DEPOLARIZING_CHANNEL2 (randomly selected Pauli errors) as well as LOSS in this list?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that's what I was thinking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just talked with @kaihsin on this today, I'm going to spin off the requirements here into a separate issue so that this PR can be merged so the qubit loss statement generating functionality can be immediately available.

@johnzl-777 johnzl-777 merged commit 10dff20 into main Jun 24, 2025
11 checks passed
@johnzl-777 johnzl-777 deleted the john/squin-to-stim-noise branch June 24, 2025 13:05
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.

3 participants