-
Notifications
You must be signed in to change notification settings - Fork 1
squin to stim rewrite #148
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
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4e21ec1
initial steps for squin to stim rewrite
johnzl-777 89a17fd
Wrap rewrite pass
johnzl-777 f6105bb
confirm analysis wrapping works
johnzl-777 ad3a7dc
Merge branch 'main' into 19-rewrite-from-squin-to-stim
johnzl-777 7c70b5e
going to bed
johnzl-777 e55a8fb
preliminary handling of Apply
johnzl-777 e76b3f3
support for control gates confirmed
johnzl-777 7ba5670
finally put everything into a pass
johnzl-777 f3203da
partially working reset rewrite
johnzl-777 20d4214
account for MeasureAndReset
johnzl-777 300f9d7
account for MeasureAndReset, fix up address analysis
johnzl-777 c137221
Merge branch 'main' into 19-rewrite-from-squin-to-stim
johnzl-777 13ae8a5
more testing, verification implemented
johnzl-777 59f763d
remove test call
johnzl-777 9427571
simple site verification test
johnzl-777 e45c10c
saving remaining work before move to codegen
johnzl-777 1a67a03
Merge branch 'main' into 19-rewrite-from-squin-to-stim
johnzl-777 9b6562f
Merge branch 'main' into 19-rewrite-from-squin-to-stim
Roger-luo 30b8a97
account for MeasureQubit, MeasureQubitIlist as well as Broadcast func…
johnzl-777 615a30b
revise tests
johnzl-777 47691e2
remove unnecessary comment
johnzl-777 c8c38ae
Move wrap analysis rewrite into its own file
johnzl-777 72e5f3f
split out reusable utility functions into a seperate file
johnzl-777 4731fe0
fix export problem
johnzl-777 410bcbc
split out rewrite rules, factor in feedback on rewriting wrap/unwrap …
johnzl-777 cab4ab6
get control statement logic to work in wire dialect, simplify stateme…
johnzl-777 c810544
use dict instead of match, just care about type comparison
johnzl-777 fb9ff37
use replace_by, fix analysis impl
johnzl-777 e6c92b7
first round of meeting feedback implemented
johnzl-777 9316a0e
split out Measure rewrite into its own rule
johnzl-777 e3b478a
add tests but codegen is acting weird
johnzl-777 0f759b8
remove site-target dimension check
johnzl-777 877755e
Merge branch 'main' into 19-rewrite-from-squin-to-stim
johnzl-777 4faf282
Merge branch 'main' into 19-rewrite-from-squin-to-stim
johnzl-777 dbc105c
implement second round review feedback
johnzl-777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from typing import Dict | ||
| from dataclasses import dataclass | ||
|
|
||
| from bloqade.analysis.address import Address | ||
| from bloqade.squin.analysis.nsites import Sites | ||
|
|
||
| from kirin import ir | ||
| from kirin.rewrite.abc import RewriteResult, RewriteRule | ||
|
|
||
|
|
||
| @dataclass | ||
| class SquinToStim(RewriteRule): | ||
|
|
||
| # Somehow need to plug in Address and Sites | ||
| # into the SSAValue Hints field, which only accepts | ||
| # Attribute types | ||
|
|
||
| ## Could literally just plug in `ir.Attribute` into | ||
| ## the Address and Site lattices? | ||
| ## Couldn't I just create my own attributes instead? | ||
|
|
||
| address_analysis: Dict[ir.SSAValue, Address] | ||
| op_site_analysis: Dict[ir.SSAValue, Sites] | ||
|
|
||
| # need to plug in data into the SSAValue | ||
| # for the rewrite from these passes, | ||
| # then something should look at those hints | ||
| # and generate the corresponding stim statements | ||
|
|
||
| pass | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.