File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 77
88from bloqade import qubit
99
10- from .dialects import gates
10+ from .dialects import gate
1111
1212
13- @ir .dialect_group (structural_no_opt .union ([gates , qubit ]))
13+ @ir .dialect_group (structural_no_opt .union ([gate , qubit ]))
1414def kernel (self ):
1515 """Compile a function to a native kernel."""
1616
Original file line number Diff line number Diff line change 55from bloqade import squin
66from bloqade .squin import gate
77from bloqade .pyqrack import StackMemorySimulator
8- from bloqade .native .dialects import gates
8+ from bloqade .native .dialects import gate as native_gate
99from bloqade .native .upstream import GateRule , SquinToNative
1010
1111
@@ -33,14 +33,14 @@ def main():
3333 new_main = SquinToNative ().emit (main , no_raise = True )
3434
3535 new_callgraph = callgraph .CallGraph (new_main )
36- # make sure all kernels have been converted to native gates
36+ # make sure all kernels have been converted to native gate
3737 all_kernels = (ker for kers in new_callgraph .defs .values () for ker in kers )
3838 for ker in all_kernels :
3939 assert gate .dialect not in ker .dialects
40- assert gates .dialect in ker .dialects
40+ assert native_gate .dialect in ker .dialects
4141
4242 # test to make sure the statevectors are the same
43- # before and after conversion to native gates
43+ # before and after conversion to native gate
4444 old_sv = np .asarray (StackMemorySimulator (min_qubits = n ).state_vector (main ))
4545 old_sv /= old_sv [imax := np .abs (old_sv ).argmax ()] / np .abs (old_sv [imax ])
4646
You can’t perform that action at this time.
0 commit comments