Noise Model and Noisy Simulations
What you will learn:
what types of noise may be involved in a neutral atom QPU;
how they are described in a
NoiseModel
;how to make noisy simulations of a
Sequence
on an emulatorBackend
.
Describing noise in neutral-atom QPUs with a NoiseModel
Section titled “Describing noise in neutral-atom QPUs with a NoiseModel”Neutral atom QPUs are subject to noise that is going to make the outcome of the execution of your pulser Sequence
on QPUs different from their theoretical result. The NoiseModel
class describes the different types of noise to take into account in a neutral-atom QPU. It takes as input parameters that characterize each of these noise types.
- class pulser.noise_model.NoiseModel(runs=None, samples_per_run=1, state_prep_error=0.0, p_false_pos=0.0, p_false_neg=0.0, temperature=0.0, laser_waist=None, amp_sigma=0.0, detuning_sigma=0.0, detuning_hf_psd=(), detuning_hf_omegas=(), relaxation_rate=0.0, dephasing_rate=0.0, trap_waist=0.0, trap_depth=None, hyperfine_dephasing_rate=0.0, depolarizing_rate=0.0, eff_noise_rates=(), eff_noise_opers=(), with_leakage=False, disable_doppler=False)
Specifies the noise model parameters for emulation.
Supported noise types:
leakage: Adds an error state ‘x’ to the computational basis, that can interact with the other states via an effective noise channel. Must be defined with an effective noise channel, but is incompatible with dephasing and depolarizing noise channels.
relaxation: Noise due to a decay from the Rydberg to the ground state (parametrized by
relaxation_rate
), commonly characterized experimentally by the T1 time.dephasing: Random phase (Z) flip (parametrized by
dephasing_rate
), commonly characterized experimentally by the T2* time.depolarizing: Quantum noise where the state is turned into the maximally mixed state with rate
depolarizing_rate
. While it does not describe a physical phenomenon, it is a commonly used tool to test the system under a uniform combination of phase flip (Z) and bit flip (X) errors.eff_noise: General effective noise channel defined by the set of collapse operators
eff_noise_opers
and their corresponding rateseff_noise_rates
.doppler: Local atom detuning due to termal motion of the atoms and Doppler effect with respect to laser frequency. Parametrized by the
temperature
field. Can be disabled with thedisable_doppler
field.register: Thermal fluctuations in the register positions, parametrized by
temperature
,trap_waist
and,trap_depth
, which must all be defined.(1) Plane standard deviation fluctuation given by: \(\sigma^{xy} = \sqrt{\frac{T w²}{4 U_{trap}}}\), where T is temperature, w is the trap waist and \(U_{trap}\) is the trap depth.
(2) Off plane standard deviation fluctuation given by: \(\sigma^z = \frac{\pi}{\lambda}\sqrt{2} w \sigma^{xy}\), where \(\lambda\) is the trap wavelength with a constant value of 0.85 µm.
amplitude: Gaussian damping due to finite laser waist and laser amplitude fluctuations. Parametrized by
laser_waist
andamp_sigma
.detuning: Detuning fluctuations consisting of two components:
(1) constant offset (zero-frequency), parameterized by
detuning_sigma
(2) time-dependent high-frequency fluctuations, defined by the power spectral density (PSD)
detuning_hf_psd
over the relevantdetuning_hf_omegas
angular frequency support. \(\delta_{hf}(t) = \sum_k \sqrt{2*\Delta \omega_k*\mathrm{PSD}_k} * \cos(\omega_k * t + \phi_k)\) where \(\phi_k \backsim U[0, 2\pi)\) (uniform random phase), and \(\Delta \omega_k = \omega_{k+1} - \omega_k\).SPAM: SPAM errors. Parametrized by
state_prep_error
,p_false_pos
andp_false_neg
.
- Parameters:
runs (
int
|None
, default:None
) – When reconstructing the Hamiltonian from random noise is necessary, this determines how many times that happens. Not to be confused with the number of times the resulting bitstring distribution is sampled when calculating bitstring counts.samples_per_run (
int
, default:1
) – Number of samples per noisy Hamiltonian. Useful for cutting down on computing time, but unrealistic. Deprecated since v1.6, use only `runs`.state_prep_error (
float
, default:0.0
) – The state preparation error probability. Defaults to 0.p_false_pos (
float
, default:0.0
) – Probability of measuring a false positive. Defaults to 0.p_false_neg (
float
, default:0.0
) – Probability of measuring a false negative. Defaults to 0.temperature (
float
, default:0.0
) – Temperature, set in µK, of the atoms in the array. Also sets the standard deviation of the speed of the atoms. Defaults to 0.laser_waist (
float
|None
, default:None
) – Waist of the gaussian lasers, set in µm, for global pulses. Assumed to be the same for all global channels.amp_sigma (
float
, default:0.0
) – Dictates the fluctuation in amplitude of a channel from run to run as a standard deviation of a normal distribution centered in 1. Assumed to be the same for all channels (though each channel has its own randomly sampled value in each run).detuning_sigma (
float
, default:0.0
) – Dictates the fluctuation in detuning (in rad/µs) of a channel from run to run as a standard deviation of a normal distribution centered in 0. Assumed to be the same for all channels (though each channel has its own randomly sampled value in each run). This noise is additive. Defaults to 0.trap_waist (
float
, default:0.0
) – The waist of each optical trap at the focal point (in µm). Defaults to 0.trap_depth (
float
|None
, default:None
) – The potential energy well depth that confines the atoms (in µK). Defaults to None.detuning_hf_psd (
tuple
[float
,...
], default:()
) – Power Spectral Density (PSD) is 1D tuple (in rad/µs) provided together with detuning_hf_omegas define high frequency noise contribution of time dependent detuning (in rad/µs). Must either be empty or a tuple with at least two values, matching the length of detuning_hf_omegas. Default is ().detuning_hf_omegas (
tuple
[float
,...
], default:()
) – 1D tuple (in rad/µs) of relevant angular frequency support for the PSD. Along with the PSD, it is required to define high frequency noise contribution of time dependent detuning (in rad/µs). Must either be empty or a tuple with at least two values, matching the length of detuning_hf_psd. Default is ().relaxation_rate (
float
, default:0.0
) – The rate of relaxation from the Rydberg to the ground state (in 1/µs). Corresponds to 1/T1. Defaults to 0.dephasing_rate (
float
, default:0.0
) – The rate of a dephasing occuring (in 1/µs) in a Rydberg state superpostion. Only used if a Rydberg state is involved. Corresponds to 1/T2*. Defaults to 0.hyperfine_dephasing_rate (
float
, default:0.0
) – The rate of dephasing occuring (in 1/µs) between hyperfine ground states. Only used if the hyperfine state is involved. Defaults to 0.depolarizing_rate (
float
, default:0.0
) – The rate (in 1/µs) at which a depolarizing error occurs. Defaults to 0.eff_noise_rates (
tuple
[float
,...
], default:()
) – The rate associated to each effective noise operator (in 1/µs). Defaults to 0.eff_noise_opers (
tuple
[ArrayLike,...
], default:()
) – The operators for the effective noise model. Defaults to 0.with_leakage (
bool
, default:False
) – Whether or not to include an error state in the computations (default to False).disable_doppler (
bool
, default:False
) – Whether or not to disable the doppler noise, even if the temperature is defined. In this way, ‘register’ noise (which requires ‘temperature’) can be activated on its own (i.e without doppler).
If you have a NoiseModel
, you can know the types of noise that it implements checking its property noise_types
.
How to include noise in your simulations
Section titled “How to include noise in your simulations”When designing your Pulser Sequence
, taking into account the effects of noise in your simulations is important so that the outcome of the experiment on the QPU is close to what you expect. Here is a step-by-step guide on how to run noisy simulations using Pulser. It extends the step-by-step guide on executing a Pulser Sequence
on Pulser Backends
.
1. Choosing the type of backend
Section titled “1. Choosing the type of backend”Simulations are performed with an Emulator Backend, which can be local or remote.
Preparation for noisy simulations:
Section titled “Preparation for noisy simulations:”Noise parameters are specific to each QPU. To access a particular QPU’s specs you’ll need a remote connection (like PasqalCloud). With it, you can obtain the list of available QPUs through connection.fetch_available_devices()
. Through this method, you can get the Device
associated with the QPU. The Device optionally stores a NoiseModel
in its noise_model
attribute. When
present, you can take into account the specified noise parameters during the design of your sequence.
2. Creating the pulse Sequence
Section titled “2. Creating the pulse Sequence”The next step is to create the sequence that we want to execute. If you want to take into account all the limitations of the QPU, it is best to use the Device
associated with the QPU when writing your Sequence
.
3. Starting the Backend
Section titled “3. Starting the Backend”An Emulator Backend takes as input:
the
Sequence
to simulate, as all the backends.a
RemoteConnection
if the emulation backend is a remote backend.an
EmulatorConfig
, that sets the parameters of the emulation. This field is optional, emulator backends have a default config.a boolean value for
mimic_qpu
, telling whether or not the same tests as when executing a Sequence on aQPUBackend
should be enforced.
The EmulatorConfig
contains two parameters that configure the noise in the simulation:
prefer_device_noise_model
: Whether or not to use the noise model of the device of the Sequence. By default, it is False. If you defined your Sequence using the Device of a QPU, set this parameter to True to automatically use the noise model of the chosen QPU.noise_model
: A specificNoiseModel
defining the noise to include in the simulation, in caseprefer_device_noise_model
is False or the sequence’s device does not define a noise model. By default, thisNoiseModel
does not include any noise. If you want to use a differentNoiseModel
for your simulation than theNoiseModel
of your Sequence’s Device, you can provide it here. Possible usecases:You have used a VirtualDevice for your Sequence, and now want to include noise.
You would like to see how the noise of another QPU would impact your Sequence.
You would like to see the influence of a certain noise on the execution of your Sequence. NoiseModels are python
dataclasses
, you can modify them withdataclasses.replace
. For instance, to delete a certain noise parameter “attr”, you can dodataclasses.replace(noise_model, attr=None)
.
4. Execution
Section titled “4. Execution”The execution is always done via the run
method. It returns a Results
object that stores the state of the system at each evaluation time. In classical simulation, and under certain kinds of noise, this state is a state-vector.
However, some noises are stochastic: states are stored as density matrices, computed by averaging over the outcomes of multiple simulations. The number of simulations is determined by NoiseModel.runs
.
5. Retrieving the Results
Section titled “5. Retrieving the Results”The returned results are Results
objects that you can use to get the evolution of some Observable
at each evaluation times (just like in noiseless simulation).