Noise
LogicalNoiseModelABC
Bases: NoiseModelABC
Noise model for logical compilation.
Extends :class:NoiseModelABC with an abstract
:meth:get_logical_initialize that returns the clean initialization
kernel used to rewrite PhysicalInitialize nodes and the noisy
initialization kernel that is applied after initialization (for example,
via a noise-insertion pass).
get_logical_initialize
abstractmethod
get_logical_initialize() -> tuple[
ir.Method[
[
float,
float,
float,
ilist.IList[qubit.Qubit, Any],
],
None,
],
ir.Method[
[
float,
float,
float,
ilist.IList[qubit.Qubit, Any],
],
None,
],
]
Return (clean_kernel, noisy_kernel) for logical initialization.
Both kernels must be provided. The clean kernel is used by InsertGates.
The noisy kernel is used by InsertNoise when add_noise=True.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
169 170 171 172 173 174 175 176 177 178 179 180 181 | |
NoiseModelABC
Bases: ABC
Abstract base class for noise models used during move-to-squin compilation.
This is the physical noise model interface. It defines noise kernels for
physical operations (lane moves, CZ gates, idle periods, local/global
rotations). Methods that return None indicate no noise is inserted for
that operation.
For logical compilation that also needs initialization kernels, see
:class:LogicalNoiseModelABC.
get_bus_idle_noise
abstractmethod
get_bus_idle_noise(
move_type: MoveType, bus_id: int
) -> ir.Method[[ilist.IList[qubit.Qubit, Any]], None]
Return the noise kernel applied to stationary qubits during a move.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
90 91 92 93 94 95 | |
get_cz_paired_noise
get_cz_paired_noise(
zone_address: ZoneAddress,
) -> (
ir.Method[
[
ilist.IList[qubit.Qubit, Len],
ilist.IList[qubit.Qubit, Len],
],
None,
]
| None
)
Return the noise kernel for paired qubits during a CZ gate, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
35 36 37 38 39 40 41 42 | |
get_cz_unpaired_noise
abstractmethod
get_cz_unpaired_noise(
zone_address: ZoneAddress,
) -> ir.Method[[ilist.IList[qubit.Qubit, Any]], None]
Return the noise kernel for unpaired qubits during a CZ gate.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
97 98 99 100 101 102 | |
get_global_r_noise
get_global_r_noise() -> (
ir.Method[
[ilist.IList[qubit.Qubit, Any], float, float], None
]
| None
)
Return the noise kernel for global R rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
56 57 58 59 60 | |
get_global_rz_noise
get_global_rz_noise() -> (
ir.Method[[ilist.IList[qubit.Qubit, Any], float], None]
| None
)
Return the noise kernel for global Rz rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
44 45 46 47 48 | |
get_lane_noise
abstractmethod
get_lane_noise(
lane: LaneAddress,
) -> ir.Method[[qubit.Qubit], None]
Return the noise kernel applied to a qubit after a lane move.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
85 86 87 88 | |
get_local_r_noise
get_local_r_noise(
locations: Sequence[LocationAddress],
) -> (
ir.Method[
[ilist.IList[qubit.Qubit, Any], float, float], None
]
| None
)
Return the noise kernel for local R rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
62 63 64 65 66 | |
get_local_rz_noise
get_local_rz_noise(
locations: Sequence[LocationAddress],
) -> (
ir.Method[[ilist.IList[qubit.Qubit, Any], float], None]
| None
)
Return the noise kernel for local Rz rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
50 51 52 53 54 | |
get_logical_initialize
get_logical_initialize() -> tuple[
ir.Method[
[
float,
float,
float,
ilist.IList[qubit.Qubit, Any],
],
None,
]
| None,
ir.Method[
[
float,
float,
float,
ilist.IList[qubit.Qubit, Any],
],
None,
]
| None,
]
Return (clean_kernel, noisy_kernel) for logical initialization.
The clean kernel is used by InsertGates for the noiseless initialization. The noisy kernel, if not None, is invoked by InsertNoise after initialization to apply initialization noise.
Returns (None, None) by default, meaning no initialization is provided
by the noise model.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
SimpleLogicalNoiseModel
dataclass
SimpleLogicalNoiseModel(
lane_noise: Method[[Qubit], None],
idle_noise: Method[[IList[Qubit, Any]], None],
cz_unpaired_noise: Method[[IList[Qubit, Any]], None],
cz_paired_noise: Method[
[IList[Qubit, Any], IList[Qubit, Any]], None
],
global_rz_noise: Method[
[IList[Qubit, Any], float], None
],
local_rz_noise: Method[
[IList[Qubit, Any], float], None
],
global_r_noise: Method[
[IList[Qubit, Any], float, float], None
],
local_r_noise: Method[
[IList[Qubit, Any], float, float], None
],
logical_initialize_clean: (
Method[
[float, float, float, IList[Qubit, Any]], None
]
| None
) = None,
logical_initialize_noisy: (
Method[
[float, float, float, IList[Qubit, Any]], None
]
| None
) = None,
)
Bases: LogicalNoiseModelABC, SimpleNoiseModel
Logical noise model based on :class:SimpleNoiseModel.
This class does not add new fields beyond :class:SimpleNoiseModel;
it serves as a marker subclass that also satisfies
:class:LogicalNoiseModelABC for logical compilation passes.
The logical_initialize_clean and logical_initialize_noisy fields
are inherited from :class:SimpleNoiseModel and must both be set.
from_simple
classmethod
from_simple(
noise_model: SimpleNoiseModel,
logical_initialize_clean: Method[
[float, float, float, IList[Qubit, Any]], None
],
logical_initialize_noisy: Method[
[float, float, float, IList[Qubit, Any]], None
],
) -> SimpleLogicalNoiseModel
Create from an existing :class:SimpleNoiseModel plus init kernels.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
get_logical_initialize
get_logical_initialize() -> tuple[
ir.Method[
[
float,
float,
float,
ilist.IList[qubit.Qubit, Any],
],
None,
],
ir.Method[
[
float,
float,
float,
ilist.IList[qubit.Qubit, Any],
],
None,
],
]
Return (clean_kernel, noisy_kernel) for logical initialization.
Both kernels must be provided. The clean kernel is used by InsertGates.
The noisy kernel is used by InsertNoise when add_noise=True.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
196 197 198 199 200 201 202 203 204 205 206 207 208 | |
SimpleNoiseModel
dataclass
SimpleNoiseModel(
lane_noise: Method[[Qubit], None],
idle_noise: Method[[IList[Qubit, Any]], None],
cz_unpaired_noise: Method[[IList[Qubit, Any]], None],
cz_paired_noise: Method[
[IList[Qubit, Any], IList[Qubit, Any]], None
],
global_rz_noise: Method[
[IList[Qubit, Any], float], None
],
local_rz_noise: Method[
[IList[Qubit, Any], float], None
],
global_r_noise: Method[
[IList[Qubit, Any], float, float], None
],
local_r_noise: Method[
[IList[Qubit, Any], float, float], None
],
logical_initialize_clean: (
Method[
[float, float, float, IList[Qubit, Any]], None
]
| None
) = None,
logical_initialize_noisy: (
Method[
[float, float, float, IList[Qubit, Any]], None
]
| None
) = None,
)
Bases: NoiseModelABC
A concrete noise model that applies the same noise kernel for each operation type.
Unlike :class:NoiseModelABC, which allows different noise per zone or location,
this model uses a single kernel per operation category (e.g. one kernel for all
lane moves, one for all CZ gates). Created by :func:~bloqade.lanes.noise_model.generate_simple_noise_model.
get_bus_idle_noise
get_bus_idle_noise(move_type: MoveType, bus_id: int)
Return the noise kernel applied to stationary qubits during a move.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
137 138 | |
get_cz_paired_noise
get_cz_paired_noise(zone_address: ZoneAddress)
Return the noise kernel for paired qubits during a CZ gate, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
143 144 | |
get_cz_unpaired_noise
get_cz_unpaired_noise(zone_address: ZoneAddress)
Return the noise kernel for unpaired qubits during a CZ gate.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
140 141 | |
get_global_r_noise
get_global_r_noise()
Return the noise kernel for global R rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
146 147 | |
get_global_rz_noise
get_global_rz_noise()
Return the noise kernel for global Rz rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
152 153 | |
get_lane_noise
get_lane_noise(lane: LaneAddress)
Return the noise kernel applied to a qubit after a lane move.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
134 135 | |
get_local_r_noise
get_local_r_noise(locations: Sequence[LocationAddress])
Return the noise kernel for local R rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
149 150 | |
get_local_rz_noise
get_local_rz_noise(locations: Sequence[LocationAddress])
Return the noise kernel for local Rz rotations, or None.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
155 156 | |
get_logical_initialize
get_logical_initialize()
Return (clean_kernel, noisy_kernel) for logical initialization.
The clean kernel is used by InsertGates for the noiseless initialization. The noisy kernel, if not None, is invoked by InsertNoise after initialization to apply initialization noise.
Returns (None, None) by default, meaning no initialization is provided
by the noise model.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/move2squin/noise.py
131 132 | |