Skip to content

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask

← Module overview

classGeminiLogicalSimulatorTasksource

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

NameTypeDescription
logical_squin_kernelir.Method[[], RetType]
noise_modelLogicalNoiseModelABC
physical_arch_specArchSpec
physical_move_kernelir.Method[[], RetType]
_post_processingatom.PostProcessing[RetType]

Attributes

NameTypeDefaultDescription
logical_squin_kernelir.Method[[], RetType]requiredThe input logical squin kernel to be executed on the Gemini architecture.
noise_modelLogicalNoiseModelABCrequiredThe noise model to be inserted into the physical squin kernel.
physical_arch_specArchSpecfield(repr=False)The physical architecture specification.
physical_move_kernelir.Method[[], RetType]field(repr=False)The physical move kernel that executes the logical squin kernel on the physical architecture.

propertyphysical_squin_kernelsource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.physical_squin_kernel

physical_squin_kernel: ir.Method[[], RetType]

The physical squin kernel with noise channels.

source

propertynoiseless_physical_squin_kernelsource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_physical_squin_kernel

noiseless_physical_squin_kernel: ir.Method[[], RetType]

The physical squin kernel without noise channels.

source

propertytsim_circuitsource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.tsim_circuit

tsim_circuit: tsim_backend.Circuit

The tsim circuit corresponding to the physical squin kernel.

source

propertynoiseless_tsim_circuitsource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_tsim_circuit

noiseless_tsim_circuit: tsim_backend.Circuit

The noiseless tsim circuit compiled without noise channels.

source

propertymeasurement_samplersource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.measurement_sampler

measurement_sampler

The tsim measurement sampler.

source

propertynoiseless_measurement_samplersource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_measurement_sampler

noiseless_measurement_sampler

The noiseless tsim measurement sampler.

source

propertydetector_samplersource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.detector_sampler

detector_sampler

The tsim detector sampler.

source

propertynoiseless_detector_samplersource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.noiseless_detector_sampler

noiseless_detector_sampler

The noiseless tsim detector sampler.

source

propertydetector_error_modelsource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.detector_error_model

detector_error_model

The STIM detector error model corresponding to the tsim circuit.

source

methodvisualizesource

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

NameTypeDefaultDescription
animatedboolFalseWhether to use the animated debugger. Defaults to False.
interactiveboolTrueWhether to enable interactive mode. Defaults to True.
source

methodfidelity_boundssource

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.

source

methodrunsource

bloqade.gemini.device.simulator.GeminiLogicalSimulatorTask.run

Signature
def run(shots: int = 1, with_noise: bool = True, *, run_detectors: bool = False) -> Result[RetType] | DetectorResult

Run the kernel and get simulation results.

Parameters

NameTypeDefaultDescription
shotsint1Number of shots to run. Defaults to 1.
with_noiseboolTrueWhether to include noise in the simulation. Defaults to True.
run_detectorsboolFalseWhen ``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.

source

methodrun_asyncsource

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

NameTypeDefaultDescription
shotsint1Number of shots to run. Defaults to 1.
with_noiseboolTrueWhether to include noise in the simulation. Defaults to True.
run_detectorsboolFalseWhen ``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.

source