bloqade.gemini.device.simulator.GeminiLogicalSimulator
classGeminiLogicalSimulator¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
noise_model | LogicalNoiseModelABC | _default_noise_model() |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
noise_model | LogicalNoiseModelABC | field(default_factory=_default_noise_model) | The noise model used for simulation. Defaults to :func:`generate_logical_noise_model`. |
methodtask¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
logical_kernel | Union[ir.Method[[], RetType], Callable[..., Any]] | required | The logical squin or CUDA-Q kernel to compile and run. |
m2dets | list[list[int]] | None | None | Binary measurement-to-detector matrix. For CUDA-Q kernels, defaults to Steane [[7,1,3]] detectors if ``None``. |
m2obs | list[list[int]] | None | None | Binary measurement-to-observable matrix. For CUDA-Q kernels, defaults to Steane [[7,1,3]] observables if ``None``. |
Returns
GeminiLogicalSimulatorTask[RetType]The compiled simulation task.
methodrun¶source
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] | DetectorResultRun the kernel and get simulation results.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | required | The logical squin kernel to run. |
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. DetectorResult: When ``run_detectors=True``, the result containing only detector and observable outcomes.
methodrun_async¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | required | The logical squin kernel to run. |
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.
methodvisualize¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | required | The logical squin kernel to visualize. |
animated | bool | False | Whether to use the animated debugger. Defaults to False. |
interactive | bool | True | Whether to enable interactive mode. Defaults to True. |
methodphysical_squin_kernel¶source
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
| Name | Type | Description |
|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | The logical squin kernel to compile. |
Returns
ir.Method[[], RetType]The physical squin kernel.
methodphysical_move_kernel¶source
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
| Name | Type | Description |
|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | The logical squin kernel to compile. |
Returns
ir.Method[[], RetType]The physical move kernel.
methodtsim_circuit¶source
bloqade.gemini.device.simulator.GeminiLogicalSimulator.tsim_circuit
Signature
def tsim_circuit(logical_squin_kernel: ir.Method[[], RetType], with_noise: bool = True) -> tsim_backend.CircuitCompile the logical squin kernel to the tsim circuit.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | required | The logical squin kernel to compile. |
with_noise | bool | True | Whether to include noise in the tsim circuit. Defaults to True. |
Returns
tsim_backend.Circuittsim.Circuit: The compiled tsim circuit.
methodfidelity_bounds¶source
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
| Name | Type | Description |
|---|---|---|
logical_squin_kernel | ir.Method[[], RetType] | The logical squin kernel to analyze. |
Returns
tuple[float, float]The (min, max) fidelity bounds.