Skip to content

Commit 4e21ec1

Browse files
committed
initial steps for squin to stim rewrite
1 parent a76d54d commit 4e21ec1

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

src/bloqade/main.py

Whitespace-only changes.

src/bloqade/squin/analysis/nsites/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Need this for impl registration to work properly!
22
from . import impls as impls
33
from .lattice import (
4+
Sites as Sites,
45
NoSites as NoSites,
56
AnySites as AnySites,
67
NumberSites as NumberSites,

src/bloqade/squin/analysis/rewrite/__init__.py

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from typing import Dict
2+
from dataclasses import dataclass
3+
4+
from bloqade.analysis.address import Address
5+
from bloqade.squin.analysis.nsites import Sites
6+
7+
from kirin import ir
8+
from kirin.rewrite.abc import RewriteResult, RewriteRule
9+
10+
11+
@dataclass
12+
class SquinToStim(RewriteRule):
13+
14+
# Somehow need to plug in Address and Sites
15+
# into the SSAValue Hints field, which only accepts
16+
# Attribute types
17+
18+
## Could literally just plug in `ir.Attribute` into
19+
## the Address and Site lattices?
20+
## Couldn't I just create my own attributes instead?
21+
22+
address_analysis: Dict[ir.SSAValue, Address]
23+
op_site_analysis: Dict[ir.SSAValue, Sites]
24+
25+
# need to plug in data into the SSAValue
26+
# for the rewrite from these passes,
27+
# then something should look at those hints
28+
# and generate the corresponding stim statements
29+
30+
pass

0 commit comments

Comments
 (0)