Skip to content

Place

ConvertToPhysicalMeasurements

Bases: Statement

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

Initialize logical qubits in the |0> state.

Parameters:

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

The logical qubit IDs to initialize.

required

NewLogicalQubit

Bases: Statement

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

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

QuantumStmt

QuantumStmt(
    state_before: SSAValue,
    *extra_result_types: TypeAttribute
)

Bases: Statement

This is a base class for all low level statements.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/dialects/place.py
61
62
63
64
65
66
67
68
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

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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
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,
    )