simulation Package

Simulation utilities for the Q# ecosystem.

This module exposes the core building blocks for noise-aware quantum simulation:

  • NeutralAtomDevice — models a neutral atom quantum device with configurable zone layouts, qubit registers, and movement constraints. Used to compile and simulate circuits on a realistic hardware topology.

  • NoiseConfig — configures per-gate Pauli noise (including qubit loss) for use with the Q# simulator. Assign noise tables to individual gate intrinsics to model depolarizing, bit-flip, phase-flip, or correlated noise channels.

  • run_qir — simulates QIR as given in one of three backend simulators: clifford, gpu or cpu.

  • DensityMatrixSimulator — an experimental simulator that uses a density-matrix to track its state.

  • StateVectorSimulator — an experimental simulator that uses a state-vector to track its state.

Classes

DensityMatrix
DensityMatrixSimulator
Instrument
NeutralAtomDevice

Representation of a neutral atom device quantum computer.

NoiseConfig
NoisySimulatorError
Operation
StateVector
StateVectorSimulator

Functions

run_qir

Simulate the given QIR source.

run_qir(input: QirInputData | str | bytes, shots: int | None = 1, noise: NoiseConfig | None = None, seed: int | None = None, type: Literal['clifford', 'cpu', 'gpu'] | None = None) -> List

Parameters

Name Description
input
Required

The QIR source to simulate.

type

The type of simulator to use. Use "clifford" if your QIR only contains Clifford gates and measurements. Use "gpu" if you have a GPU available in your system. Use "cpu" as a fallback option if you don't have a GPU in your system. If None (default), the GPU simulator will be tried first, falling back to CPU if a suitable GPU device could not be located.

Default value: None
shots

The number of shots to run.

Default value: 1
noise

A noise model to use in the simulation.

Default value: None
seed

A seed for reproducibility.

Default value: None

Returns

Type Description

A list of measurement results, in the order they happened during the simulation.