Physical simulator
GeminiPhysicalSimulator
dataclass
GeminiPhysicalSimulator(
noise_model: NoiseModelABC = _default_noise_model(),
arch_spec: ArchSpec = _default_arch_spec(),
backend: AbstractSimulatorBackend = TsimSimulatorBackend(),
place_opt_type: type[Pass] | None = None,
placement_strategy: PlacementStrategyABC | None = None,
)
Simulator for physical-pipeline-compatible ir.Method kernels.
Callers supply terminal physical measurement and any desired annotations. The simulator performs no conversion or insertion.
arch_spec
class-attribute
instance-attribute
arch_spec: ArchSpec = field(
default_factory=_default_arch_spec
)
The physical architecture specification used for compilation.
backend
class-attribute
instance-attribute
backend: AbstractSimulatorBackend = field(
default_factory=TsimSimulatorBackend
)
Sampling and detector-model backend used by created tasks.
noise_model
class-attribute
instance-attribute
noise_model: NoiseModelABC = field(
default_factory=_default_noise_model
)
The physical noise model used for simulation.
place_opt_type
class-attribute
instance-attribute
place_opt_type: type[Pass] | None = None
Optional placement pass used for compilation.
placement_strategy
class-attribute
instance-attribute
placement_strategy: PlacementStrategyABC | None = None
Optional physical placement strategy.
task
task(
physical_kernel: Method[[], RetType],
) -> PhysicalSimulatorTask[RetType]
Compile a physical-pipeline-compatible ir.Method into a task.
The method must already contain terminal physical measurement and any desired annotations; no conversion or insertion is performed.
Source code in .venv/lib/python3.12/site-packages/bloqade/gemini/device/physical_simulator.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
PhysicalSimulatorTask
dataclass
PhysicalSimulatorTask(
source_squin_kernel: Method[[], RetType],
noise_model: NoiseModelABC,
physical_arch_spec: ArchSpec,
physical_move_kernel: Method[[], RetType],
_post_processing: PostProcessing[RetType],
_simulator_backend: AbstractSimulatorBackend = TsimSimulatorBackend(),
)
Bases: _SimulatorTaskBase[RetType], Generic[RetType]
flowchart TD
bloqade.gemini.device.physical_simulator.PhysicalSimulatorTask[PhysicalSimulatorTask]
bloqade.gemini.device._task_runtime._SimulatorTaskBase[_SimulatorTaskBase]
bloqade.gemini.device._task_runtime._SimulatorTaskBase --> bloqade.gemini.device.physical_simulator.PhysicalSimulatorTask
click bloqade.gemini.device.physical_simulator.PhysicalSimulatorTask href "" "bloqade.gemini.device.physical_simulator.PhysicalSimulatorTask"
click bloqade.gemini.device._task_runtime._SimulatorTaskBase href "" "bloqade.gemini.device._task_runtime._SimulatorTaskBase"
A compiled simulation task for physical SQuIn programs.
noise_model
instance-attribute
noise_model: NoiseModelABC
The physical noise model to insert into the SQuIn kernel.
noiseless_physical_squin_kernel
cached
property
noiseless_physical_squin_kernel: Method[[], RetType]
The physical SQuIn kernel without noise channels.
physical_arch_spec
class-attribute
instance-attribute
physical_arch_spec: ArchSpec = field(repr=False)
The physical architecture specification.
physical_move_kernel
class-attribute
instance-attribute
physical_move_kernel: Method[[], RetType] = field(
repr=False
)
The physical move kernel compiled from the source SQuIn kernel.
physical_squin_kernel
cached
property
physical_squin_kernel: Method[[], RetType]
The physical SQuIn kernel with noise channels.
source_squin_kernel
instance-attribute
source_squin_kernel: Method[[], RetType]
The input physical SQuIn kernel.
append_measurements_and_annotations_physical
append_measurements_and_annotations_physical(
mt: Method,
m2dets: list[list[int]] | None,
m2obs: list[list[int]] | None,
) -> None
Append physical detector/observable annotations from per-block matrices.
The method is mutated in-place. The supplied matrices are interpreted as measurement-to-detector/observable maps for one logical block laid out in a flat physical measurement list. If the kernel measures multiple such blocks, the matrices are repeated block-by-block. The original return value is preserved.
Source code in .venv/lib/python3.12/site-packages/bloqade/gemini/device/physical_simulator.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |