Skip to content

Transform

MoveToSquinBase dataclass

MoveToSquinBase(
    arch_spec: ArchSpec, *, aggressive_unroll: bool = False
)

Bases: ABC

Base class for all MoveToSquin variants.

Subclasses must implement _get_initialize_kernel, _get_noise_model, and _get_initialize_noise_kernel to control which kernels are passed to the rewrite rules.

MoveToSquinLogical dataclass

MoveToSquinLogical(
    arch_spec: ArchSpec,
    noise_model: LogicalNoiseModelABC,
    add_noise: bool = False,
    *,
    aggressive_unroll: bool = False
)

Bases: MoveToSquinBase

Rewrite pass for logical compilation.

When add_noise is False, uses the clean initialization kernel from the noise model for InsertGates to rewrite PhysicalInitialize nodes. No noise is inserted.

When add_noise is True, the clean initialization kernel is not passed to InsertGates. Instead, only InsertNoise handles initialization using the noisy kernel, and gate/move noise is inserted as well. This ensures initialization is applied exactly once — either clean or noisy, never both.

MoveToSquinPhysical dataclass

MoveToSquinPhysical(
    arch_spec: ArchSpec,
    noise_model: NoiseModelABC = None,
    *,
    aggressive_unroll: bool = False
)

Bases: MoveToSquinBase

Rewrite pass for physical compilation.

No initialization kernel handling. Noise is inserted only when a noise model is provided.