flamingpy.noise.IidNoise¶
- class flamingpy.noise.IidNoise(code, error_probability)[source]¶
Bases:
object
Noise sampler for independent and identically distributed Z errors on the qubits of a cluster state.
- Parameters
code (SurfaceCode) – the code on which to apply the noise.
error_probability (float) – the probability of a Z error.
Methods
apply_noise
([rng])Apply the noise to the code.
- apply_noise(rng=Generator(PCG64) at 0x7F02CFAFD9E0)[source]¶
Apply the noise to the code.
This fixes the “bit_val” attribute of each node in the code egraph.
- Parameters
rng (numpy.random.Generator, optional) – a random number generator following the NumPy API. It can be seeded for reproducibility. By default, numpy.random.default_rng is used without a fixed seed.
source/api/flamingpy.noise.IidNoise
Download Python script
Download Notebook
View on GitHub