Native to place
LogicalNativeToPlace
dataclass
LogicalNativeToPlace(
arch_spec: ArchSpec | None = None,
transversal_rewrite: bool = False,
)
Bases: NativeToPlaceBase
flowchart TD
bloqade.lanes.transform.native_to_place.LogicalNativeToPlace[LogicalNativeToPlace]
bloqade.lanes.transform.native_to_place.NativeToPlaceBase[NativeToPlaceBase]
bloqade.lanes.transform.native_to_place.NativeToPlaceBase --> bloqade.lanes.transform.native_to_place.LogicalNativeToPlace
click bloqade.lanes.transform.native_to_place.LogicalNativeToPlace href "" "bloqade.lanes.transform.native_to_place.LogicalNativeToPlace"
click bloqade.lanes.transform.native_to_place.NativeToPlaceBase href "" "bloqade.lanes.transform.native_to_place.NativeToPlaceBase"
NativeToPlace
dataclass
NativeToPlace(arch_spec: ArchSpec | None = None)
Bases: NativeToPlaceBase
flowchart TD
bloqade.lanes.transform.native_to_place.NativeToPlace[NativeToPlace]
bloqade.lanes.transform.native_to_place.NativeToPlaceBase[NativeToPlaceBase]
bloqade.lanes.transform.native_to_place.NativeToPlaceBase --> bloqade.lanes.transform.native_to_place.NativeToPlace
click bloqade.lanes.transform.native_to_place.NativeToPlace href "" "bloqade.lanes.transform.native_to_place.NativeToPlace"
click bloqade.lanes.transform.native_to_place.NativeToPlaceBase href "" "bloqade.lanes.transform.native_to_place.NativeToPlaceBase"
Neutral squin -> place lowering.
No logical-initialize rewrites and no physical pinned-qubit lowering — the
"generic" path that reproduces the legacy upstream.NativeToPlace(
logical_initialize=False) behavior. arch_spec defaults to None so
the post-unroll address/duplicate validation block is skipped (as the legacy
generic path did). Used by the entropy-trace visualizer and by callers that
want a plain squin->place lowering.
NativeToPlaceBase
dataclass
NativeToPlaceBase(arch_spec: ArchSpec | None = None)
Template-method base for the squin-native → place compilation stage.
Subclasses override up to five 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_rules(no_raise)— rules applied to the flat native IR, afterAggressiveUnrolland after every validator, in the only window where the program is a flat block ofnative.gatestatements. Returned pre-wrapped in their traversal, as_squin_clifford_rulesare. Default is no rules. Logical subclass runsEliminateRz, commutingRzphase into laterRgates instead of emitting it. -
_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.