Skip to content

Lattice

ConcreteState dataclass

ConcreteState(
    occupied: frozenset[LocationAddress],
    layout: tuple[LocationAddress, ...],
    move_count: tuple[int, ...],
)

Bases: AtomState

layout instance-attribute

layout: tuple[LocationAddress, ...]

Stores the current location of the ith qubit argument in layout[i].

move_count instance-attribute

move_count: tuple[int, ...]

Stores the number of moves each atom has undergone.

occupied instance-attribute

occupied: frozenset[LocationAddress]

Stores the set of occupied locations with atoms not participating in this static circuit.

ExecuteCZ dataclass

ExecuteCZ(
    occupied: frozenset[LocationAddress],
    layout: tuple[LocationAddress, ...],
    move_count: tuple[int, ...],
    active_cz_zones: frozenset[ZoneAddress],
    move_layers: tuple[tuple[LaneAddress, ...], ...] = (),
)

Bases: ConcreteState

Defines the state representing the placement of atoms before/after executing CZ gate pulse.

NOTE: you can specify multiple entnangling zones to be active in a single ExecuteCZ state in cases where there are multiple entangling zones that can be used in parallel.

active_cz_zones instance-attribute

active_cz_zones: frozenset[ZoneAddress]

The set of CZ zones that need to execute for this round of CZ gates.

move_layers class-attribute instance-attribute

move_layers: tuple[tuple[LaneAddress, ...], ...] = ()

The layers of moves that need to be executed to reach this state.

verify

verify(
    arch_spec: ArchSpec,
    controls: tuple[int, ...],
    targets: tuple[int, ...],
)

Returns True if the current atom configuration will execute the provided entangled pairs.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/analysis/placement/lattice.py
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
def verify(
    self, arch_spec: ArchSpec, controls: tuple[int, ...], targets: tuple[int, ...]
):
    """Returns True if the current atom configuration will execute the provided entangled pairs."""
    if len(targets) != len(controls):
        return False

    for control, target in zip(controls, targets):
        if control < 0 or control >= len(self.layout):
            return False
        if target < 0 or target >= len(self.layout):
            return False

        c_addr = self.layout[control]
        t_addr = self.layout[target]

        if (arch_spec.get_blockaded_location(c_addr) != t_addr) and (
            arch_spec.get_blockaded_location(t_addr) != c_addr
        ):
            return False

    return True

ExecuteMeasure dataclass

ExecuteMeasure(
    occupied: frozenset[LocationAddress],
    layout: tuple[LocationAddress, ...],
    move_count: tuple[int, ...],
    zone_maps: tuple[ZoneAddress, ...],
    move_layers: tuple[tuple[LaneAddress, ...], ...] = (),
)

Bases: ConcreteState

A state representing measurement placements.

NOTE: Depending on the placement of the atoms you may need to specify which atoms are measured by which zone. This is done via the zone_maps field, such that zone_maps[i] gives the zone that measures the ith qubit.

move_layers class-attribute instance-attribute

move_layers: tuple[tuple[LaneAddress, ...], ...] = ()

The layers of moves that need to be executed to reach this state.

zone_maps instance-attribute

zone_maps: tuple[ZoneAddress, ...]

The mapping from qubit index to the zone that measures it.