Skip to content

Atom state data

AtomStateData dataclass

AtomStateData(_inner: AtomStateData = _RustAtomStateData())

collision cached property

collision: MappingProxyType[int, int]

Mapping from qubit id to another qubit id that it has collided with (read-only).

locations_to_qubit cached property

locations_to_qubit: MappingProxyType[LocationAddress, int]

Mapping from location to qubit id (read-only).

move_count cached property

move_count: MappingProxyType[int, int]

Mapping from qubit id to number of moves it has had (read-only).

prev_lanes cached property

prev_lanes: MappingProxyType[int, LaneAddress]

Mapping from qubit id to the lane it took to reach this state (read-only).

qubit_to_locations cached property

qubit_to_locations: MappingProxyType[int, LocationAddress]

Mapping from qubit id to its current location (read-only).

from_fields classmethod

from_fields(
    locations_to_qubit: (
        dict[LocationAddress, int] | None
    ) = None,
    qubit_to_locations: (
        dict[int, LocationAddress] | None
    ) = None,
    collision: dict[int, int] | None = None,
    prev_lanes: dict[int, LaneAddress] | None = None,
    move_count: dict[int, int] | None = None,
) -> AtomStateData

Construct from explicit field values.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/analysis/atom/atom_state_data.py
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@classmethod
def from_fields(
    cls,
    locations_to_qubit: dict[LocationAddress, int] | None = None,
    qubit_to_locations: dict[int, LocationAddress] | None = None,
    collision: dict[int, int] | None = None,
    prev_lanes: dict[int, LaneAddress] | None = None,
    move_count: dict[int, int] | None = None,
) -> AtomStateData:
    """Construct from explicit field values."""
    rust_state = _RustAtomStateData(
        locations_to_qubit=(
            {loc._inner: qid for loc, qid in locations_to_qubit.items()}
            if locations_to_qubit
            else None
        ),
        qubit_to_locations=(
            {qid: loc._inner for qid, loc in qubit_to_locations.items()}
            if qubit_to_locations
            else None
        ),
        collision=collision,
        prev_lanes=(
            {qid: lane._inner for qid, lane in prev_lanes.items()}
            if prev_lanes
            else None
        ),
        move_count=move_count,
    )
    return cls(_inner=rust_state)