noise: A noise gate

noiseR Documentation

A noise gate

Description

A noise gate

Usage

noise(bit, p = 1, error = "any", type = "ERR", args = list())

Arguments

bit

integer or integer array. The bit to which to apply the gate. If an array is provided, the gate will be applied randomly to one of the bits only.

p

probability with which noise is applied

error

one of "X", "Y", "Z", "small" or "any". The model which the noise follows. Can be one of the Pauli matrices (X,Y,Z), a random SU(2)-matrix with a small deviation sigma from the identity ("small") or an arbitrary, uniformly sampled, SU(2)-matrix ("any").

type

a character vector representing the type of gate

args

a list of further arguments passed to specific error models. For error="small" the standard deviation sigma has to be provided here (default=1).

Value

An S4 class 'sqgate' object is returned

Examples

x <- noise(1, error="X") * qstate(nbits=2)
x
y <- noise(2, p=0.5) * x
y
z <- noise(2, error="small", args=list(sigma=0.1)) * x
z


qsimulatR documentation built on Oct. 16, 2023, 5:06 p.m.