Skip to content

bloqade.gemini.device.simulator.GeminiLogicalSimulator

← Module overview

classGeminiLogicalSimulatorsource

bloqade.gemini.device.simulator.GeminiLogicalSimulator

Logical simulator targeting the Gemini neutral-atom architecture.

Signature
class GeminiLogicalSimulator(noise_model: LogicalNoiseModelABC = _default_noise_model())

This is the primary entry point for compiling and simulating logical quantum circuits on the Gemini architecture. Use task to compile a kernel into a reusable GeminiLogicalSimulatorTask, or run for one-shot compile-and-execute convenience.

Parameters

NameTypeDefaultDescription
noise_modelLogicalNoiseModelABC_default_noise_model()

Attributes

NameTypeDefaultDescription
noise_modelLogicalNoiseModelABCfield(default_factory=_default_noise_model)The noise model used for simulation. Defaults to :func:`generate_logical_noise_model`.

methodtasksource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.task

Signature
def task(logical_kernel: Union[ir.Method[[], RetType], Callable[..., Any]], m2dets: list[list[int]] | None = None, m2obs: list[list[int]] | None = None) -> GeminiLogicalSimulatorTask[RetType]

Create a simulation task for the given kernel.

Eagerly compiles the kernel through squin-to-move and extracts post-processing. For CUDA-Q kernels, detector and observable annotation matrices default to Steane [[7,1,3]] parity checks when not provided.

Parameters

NameTypeDefaultDescription
logical_kernelUnion[ir.Method[[], RetType], Callable[..., Any]]requiredThe logical squin or CUDA-Q kernel to compile and run.
m2detslist[list[int]] | NoneNoneBinary measurement-to-detector matrix. For CUDA-Q kernels, defaults to Steane [[7,1,3]] detectors if ``None``.
m2obslist[list[int]] | NoneNoneBinary measurement-to-observable matrix. For CUDA-Q kernels, defaults to Steane [[7,1,3]] observables if ``None``.

Returns

GeminiLogicalSimulatorTask[RetType]The compiled simulation task.

source

methodrunsource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.run

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

Run the kernel and get simulation results.

Parameters

NameTypeDefaultDescription
logical_squin_kernelir.Method[[], RetType]requiredThe logical squin kernel to run.
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. DetectorResult: When ``run_detectors=True``, the result containing only detector and observable outcomes.

source

methodrun_asyncsource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.run_async

Signature
def run_async(logical_squin_kernel: ir.Method[[], RetType], 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
logical_squin_kernelir.Method[[], RetType]requiredThe logical squin kernel to run.
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

methodvisualizesource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.visualize

Signature
def visualize(logical_squin_kernel: ir.Method[[], RetType], animated: bool = False, interactive: bool = True)

Visualize the physical move kernel using the built-in debugger.

Parameters

NameTypeDefaultDescription
logical_squin_kernelir.Method[[], RetType]requiredThe logical squin kernel to visualize.
animatedboolFalseWhether to use the animated debugger. Defaults to False.
interactiveboolTrueWhether to enable interactive mode. Defaults to True.
source

methodphysical_squin_kernelsource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.physical_squin_kernel

Signature
def physical_squin_kernel(logical_squin_kernel: ir.Method[[], RetType]) -> ir.Method[[], RetType]

Compile the logical squin kernel to the physical squin kernel.

Parameters

NameTypeDescription
logical_squin_kernelir.Method[[], RetType]The logical squin kernel to compile.

Returns

ir.Method[[], RetType]The physical squin kernel.

source

methodphysical_move_kernelsource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.physical_move_kernel

Signature
def physical_move_kernel(logical_squin_kernel: ir.Method[[], RetType]) -> ir.Method[[], RetType]

Compile the logical squin kernel to the physical move kernel.

Parameters

NameTypeDescription
logical_squin_kernelir.Method[[], RetType]The logical squin kernel to compile.

Returns

ir.Method[[], RetType]The physical move kernel.

source

methodtsim_circuitsource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.tsim_circuit

Signature
def tsim_circuit(logical_squin_kernel: ir.Method[[], RetType], with_noise: bool = True) -> tsim_backend.Circuit

Compile the logical squin kernel to the tsim circuit.

Parameters

NameTypeDefaultDescription
logical_squin_kernelir.Method[[], RetType]requiredThe logical squin kernel to compile.
with_noiseboolTrueWhether to include noise in the tsim circuit. Defaults to True.

Returns

tsim_backend.Circuittsim.Circuit: The compiled tsim circuit.

source

methodfidelity_boundssource

bloqade.gemini.device.simulator.GeminiLogicalSimulator.fidelity_bounds

Signature
def fidelity_bounds(logical_squin_kernel: ir.Method[[], RetType]) -> tuple[float, float]

Get the fidelity bounds for the logical squin kernel.

Parameters

NameTypeDescription
logical_squin_kernelir.Method[[], RetType]The logical squin kernel to analyze.

Returns

tuple[float, float]The (min, max) fidelity bounds.

source