bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask
classGeminiLogicalSimulatorTask¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask
Bases: Generic[RetType]
A compiled simulation task for the Gemini logical simulator.
Signature
class GeminiLogicalSimulatorTask(logical_squin_kernel: ir.Method[[], RetType], noise_model: LogicalNoiseModelABC, physical_arch_spec: ArchSpec, physical_move_kernel: ir.Method[[], RetType], _post_processing: atom.PostProcessing[RetType])Created by GeminiLogicalSimulator.task. The squin-to-move compilation and post-processing extraction are performed eagerly at construction time. Simulation artifacts (physical squin kernel, stim circuits, samplers, detector error model) are computed lazily on first access since they depend on the noise model.
Parameters
| Name | Type | Description |
|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | |
noise_model | LogicalNoiseModelABC | |
physical_arch_spec | ArchSpec | |
physical_move_kernel | ir.Method[[], RetType] | |
_post_processing | atom.PostProcessing[RetType] |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | required | The input logical squin kernel to be executed on the Gemini architecture. |
noise_model | LogicalNoiseModelABC | required | The noise model to be inserted into the physical squin kernel. |
physical_arch_spec | ArchSpec | field(repr=False) | The physical architecture specification. |
physical_move_kernel | ir.Method[[], RetType] | field(repr=False) | The physical move kernel that executes the logical squin kernel on the physical architecture. |
propertyphysical_squin_kernel¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.physical_squin_kernel
propertynoiseless_physical_squin_kernel¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_physical_squin_kernel
noiseless_physical_squin_kernel: ir.Method[[], RetType]The physical squin kernel without noise channels.
sourcepropertytsim_circuit¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.tsim_circuit
tsim_circuit: tsim_backend.CircuitThe tsim circuit corresponding to the physical squin kernel.
sourcepropertynoiseless_tsim_circuit¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_tsim_circuit
noiseless_tsim_circuit: tsim_backend.CircuitThe noiseless tsim circuit compiled without noise channels.
sourcepropertymeasurement_sampler¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.measurement_sampler
propertynoiseless_measurement_sampler¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_measurement_sampler
propertydetector_sampler¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.detector_sampler
propertynoiseless_detector_sampler¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_detector_sampler
propertydetector_error_model¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.detector_error_model
methodvisualize¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.visualize
def visualize(animated: bool = False, interactive: bool = True)Visualize the physical move kernel using the built-in debugger.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
animated | bool | False | Whether to use the animated debugger. Defaults to False. |
interactive | bool | True | Whether to enable interactive mode. Defaults to True. |
methodfidelity_bounds¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.fidelity_bounds
def fidelity_bounds() -> tuple[float, float]Compute the fidelity bounds for the physical squin kernel.
Returns
tuple[float, float]The (min, max) fidelity bounds.
methodrun¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.run
Signature
def run(shots: int = 1, with_noise: bool = True, *, run_detectors: bool = False) -> Result[RetType] | DetectorResultRun the kernel and get simulation results.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
shots | int | 1 | Number of shots to run. Defaults to 1. |
with_noise | bool | True | Whether to include noise in the simulation. Defaults to True. |
run_detectors | bool | False | When ``True``, use the detector sampler instead of the measurement sampler for faster detector/observable sampling. Defaults to False. |
Returns
(Result[RetType] | DetectorResult, Result[RetType] | DetectorResult)Result[RetType]: When ``run_detectors=False``, the full simulation result including measurement outcomes, return values, detectors, and observables. DetectorResult: When ``run_detectors=True``, the result containing only detector and observable outcomes.
methodrun_async¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.run_async
Signature
def run_async(shots: int = 1, with_noise: bool = True, *, run_detectors: bool = False) -> Future[Result[RetType]] | Future[DetectorResult]Run the kernel asynchronously and get simulation results.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
shots | int | 1 | Number of shots to run. Defaults to 1. |
with_noise | bool | True | Whether to include noise in the simulation. Defaults to True. |
run_detectors | bool | False | When ``True``, use the detector sampler instead of the measurement sampler. Defaults to False. |
Returns
(Future[Result[RetType]] | Future[DetectorResult], Future[Result[RetType]] | Future[DetectorResult])Future[Result[RetType]]: When ``run_detectors=False``, a future resolving to the full simulation result. Future[DetectorResult]: When ``run_detectors=True``, a future resolving to the detector result.