Skip to content

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 after out is created (dialect-extended copy of mt) but before SquinToNative. Default is a no-op. Logical subclass runs ValidationSuite on mt and applies callgraph rewrites to out.

  • _squin_clifford_rules() — squin→squin rules run over the call graph as the last step before SquinToNative. 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, after AggressiveUnroll and after every validator, in the only window where the program is a flat block of native.gate statements. Returned pre-wrapped in their traversal, as _squin_clifford_rules are. Default is no rules. Logical subclass runs EliminateRz, commuting Rz phase into later R gates instead of emitting it.

  • _post_unroll_validation(out) — called after AggressiveUnroll, before ScfToCfRule. Default is a no-op. Physical subclass runs PhysicalTerminalMeasurementValidation.

  • _lower_qubits(out) — called after the optional address/duplicate validation block. Must be overridden: raises NotImplementedError. Physical subclass runs RewriteQubitsToPinnedQubits + 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.