Skip to content

Place

ConvertToPhysicalMeasurements

Bases: Statement


              flowchart TD
              bloqade.lanes.dialects.place.ConvertToPhysicalMeasurements[ConvertToPhysicalMeasurements]

              

              click bloqade.lanes.dialects.place.ConvertToPhysicalMeasurements href "" "bloqade.lanes.dialects.place.ConvertToPhysicalMeasurements"
            

Convert logical measurement results to physical measurement results.

This is a placeholder for a rewrite pass that will explicitly extract physical measurement results from the future returned, in the move dialect.

LogicalInitialize

Bases: Statement


              flowchart TD
              bloqade.lanes.dialects.place.LogicalInitialize[LogicalInitialize]

              

              click bloqade.lanes.dialects.place.LogicalInitialize href "" "bloqade.lanes.dialects.place.LogicalInitialize"
            

Initialize logical qubits in the |0> state.

Parameters:

Name Type Description Default
qubits tuple[int, ...]

The logical qubit IDs to initialize.

required

NewLogicalQubit

Bases: _NewQubitBase


              flowchart TD
              bloqade.lanes.dialects.place.NewLogicalQubit[NewLogicalQubit]
              bloqade.lanes.dialects.place._NewQubitBase[_NewQubitBase]

                              bloqade.lanes.dialects.place._NewQubitBase --> bloqade.lanes.dialects.place.NewLogicalQubit
                


              click bloqade.lanes.dialects.place.NewLogicalQubit href "" "bloqade.lanes.dialects.place.NewLogicalQubit"
              click bloqade.lanes.dialects.place._NewQubitBase href "" "bloqade.lanes.dialects.place._NewQubitBase"
            

Allocate a logical qubit with initial state u3(theta, phi, lam)|0>.

location_address and result are inherited from _NewQubitBase.

Parameters:

Name Type Description Default
theta float

Angle for rotation around the Y axis

required
phi float

angle for rotation around the Z axis

required
lam float

angle for rotation around the Z axis

required
location_address LocationAddress | None

Pinned physical address; None means the layout heuristic chooses. After ResolvePinnedAddresses runs, this is never None in well-formed IR.

required

NewPinnedQubit

Bases: _NewQubitBase


              flowchart TD
              bloqade.lanes.dialects.place.NewPinnedQubit[NewPinnedQubit]
              bloqade.lanes.dialects.place._NewQubitBase[_NewQubitBase]

                              bloqade.lanes.dialects.place._NewQubitBase --> bloqade.lanes.dialects.place.NewPinnedQubit
                


              click bloqade.lanes.dialects.place.NewPinnedQubit href "" "bloqade.lanes.dialects.place.NewPinnedQubit"
              click bloqade.lanes.dialects.place._NewQubitBase href "" "bloqade.lanes.dialects.place._NewQubitBase"
            

Allocate a physical qubit at an optional pinned location.

No initialization angles — physical qubits have a location but no associated initialization sequence. location_address=None means the layout heuristic will assign a site; after ResolvePinnedAddresses runs this is never None in well-formed IR.

QuantumStmt

QuantumStmt(
    state_before: SSAValue,
    *extra_result_types: TypeAttribute
)

Bases: Statement


              flowchart TD
              bloqade.lanes.dialects.place.QuantumStmt[QuantumStmt]

              

              click bloqade.lanes.dialects.place.QuantumStmt href "" "bloqade.lanes.dialects.place.QuantumStmt"
            

This is a base class for all low level statements.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/dialects/place.py
92
93
94
95
96
97
98
99
def __init__(
    self, state_before: ir.SSAValue, *extra_result_types: types.TypeAttribute
):
    super().__init__(
        args=(state_before,),
        args_slice={"state_before": 0},
        result_types=(StateType,) + extra_result_types,
    )

StaticPlacement

StaticPlacement(qubits: tuple[SSAValue, ...], body: Region)

Bases: Statement


              flowchart TD
              bloqade.lanes.dialects.place.StaticPlacement[StaticPlacement]

              

              click bloqade.lanes.dialects.place.StaticPlacement href "" "bloqade.lanes.dialects.place.StaticPlacement"
            

This statement represents A static circuit to be executed on the hardware.

The body region contains the low-level instructions to be executed. The inputs are the squin qubits to be used in the execution.

The region always terminates with an Yield statement, which provides the the measurement results for the qubits depending on which low-level code was executed.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/dialects/place.py
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
def __init__(
    self,
    qubits: tuple[ir.SSAValue, ...],
    body: ir.Region,
):
    if isinstance(last_stmt := body.blocks[0].last_stmt, Yield):
        result_types = tuple(value.type for value in last_stmt.classical_results)
    else:
        result_types = ()

    super().__init__(
        args=qubits,
        args_slice={"qubits": slice(0, None)},
        regions=(body,),
        result_types=result_types,
    )