bloqade.lanes.transform.native_to_place.NativeToPlaceBase
classNativeToPlaceBase¶source
bloqade.lanes.transform.native_to_place.NativeToPlaceBase
Template-method base for the squin-native → place compilation stage.
class NativeToPlaceBase(arch_spec: ArchSpec | None = None)Subclasses override up to four hooks; all other steps are shared:
-
_pre_native_rewrites(mt, out, no_raise)— called afteroutis created (dialect-extended copy ofmt) but beforeSquinToNative. Default is a no-op. Logical subclass runsValidationSuiteonmtand applies callgraph rewrites toout. -
_squin_clifford_rules()— squin→squin rules run over the call graph as the last step beforeSquinToNative. The base implementation decomposes composite Cliffords into the neutral-atom gate set; the logical subclass appends the Steane transversal adjoint swap. -
_post_unroll_validation(out)— called afterAggressiveUnroll, beforeScfToCfRule. Default is a no-op. Physical subclass runsPhysicalTerminalMeasurementValidation. -
_lower_qubits(out)— called after the optional address/duplicate validation block. Must be overridden: raisesNotImplementedError. Physical subclass runsRewriteQubitsToPinnedQubits+RewritePhysicalMeasure; logical subclass runs the four initialize rewrites.
The arch_spec field controls whether post-unroll address and duplicate
validation runs (the if self.arch_spec is not None block). Both
PhysicalPipeline and LogicalPipeline always supply an
arch_spec (defaulting to their respective Gemini arch specs), so this
validation is unconditional for both pipelines. Set arch_spec=None
only when constructing a NativeToPlaceBase subclass directly and
you explicitly want to skip address validation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
arch_spec | ArchSpec | None | None |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
arch_spec | ArchSpec | None | field(default=None) |
methodemit¶source
bloqade.lanes.transform.native_to_place.NativeToPlaceBase.emit
def emit(mt: Method, no_raise: bool = True) -> MethodParameters
| Name | Type | Default | Description |
|---|---|---|---|
mt | Method | required | |
no_raise | bool | True |
Returns
Method