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.

apply_noise([rng])

Apply the noise to the code.

apply_noise(rng=Generator(PCG64) at 0x7FE99AAC2740)[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.

Contents

Home

Background

Using FlamingPy

Development

Getting Help

Python API