graphix.noise_models package¶
Submodules¶
- graphix.noise_models.amplitude_damping module
- graphix.noise_models.depolarising module
- graphix.noise_models.noise_model module
Module contents¶
Noise models.
- class AmplitudeDampingNoise(prob: float)[source]¶
Bases:
NoiseOne-qubit amplitude damping noise with damping parameter
prob.- __init__(prob: float) None[source]¶
Initialize one-qubit amplitude damping noise.
- Parameters:
prob (float) – Damping parameter \(\\gamma\) of the noise, between 0 and 1.
- prob¶
Descriptor for probability (between 0 and 1).
- to_krauschannel() KrausChannel[source]¶
Return the Kraus channel describing the noise element.
- class AmplitudeDampingNoiseModel(prepare_error_prob: float = 0.0, x_error_prob: float = 0.0, z_error_prob: float = 0.0, entanglement_error_prob: float = 0.0, measure_channel_prob: float = 0.0, measure_error_prob: float = 0.0)[source]¶
Bases:
NoiseModelAmplitude damping noise model.
- Parameters:
NoiseModel (class) – Parent abstract class class:
NoiseModel
- __init__(prepare_error_prob: float = 0.0, x_error_prob: float = 0.0, z_error_prob: float = 0.0, entanglement_error_prob: float = 0.0, measure_channel_prob: float = 0.0, measure_error_prob: float = 0.0) None[source]¶
- input_nodes(nodes: Iterable[int], rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to input nodes.
- command(cmd: CommandOrNoise, rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to the command
cmd.
- class ApplyNoise(noise: Noise, nodes: list[int], domain: set[int] | None = None)[source]¶
Bases:
_KindCheckerApply noise command.
- Parameters:
noise (Noise) – noise to be applied
nodes (list[Node]) – list of node indices on which to apply noise
domain (set[Node] | None = None) – Optional domain for conditional noise. If
None, the noise is applied unconditionally. Otherwise, the noise is applied if there is an odd number of nodes amongdomainthat have been measured with outcome 1 (as forXandZcommands). Note that the noise is never applied ifdomainis the empty set.
- class ComposeNoiseModel(models: list[NoiseModel])[source]¶
Bases:
NoiseModelCompose noise models.
- models: list[NoiseModel]¶
- input_nodes(nodes: Iterable[int], rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to input nodes.
- command(cmd: CommandOrNoise, rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to the command
cmd.
- confuse_result(cmd: BaseM, result: Outcome, rng: Generator | None = None, *, stacklevel: int = 1) Outcome[source]¶
Assign wrong measurement result.
- __init__(models: list[NoiseModel]) None¶
- class DepolarisingNoise(prob: float)[source]¶
Bases:
NoiseOne-qubit depolarising noise with probabibity
prob.- __init__(prob: float) None[source]¶
Initialize one-qubit depolarizing noise.
- Parameters:
prob (float) – Probability parameter of the noise, between 0 and 1.
- prob¶
Descriptor for probability (between 0 and 1).
- to_krauschannel() KrausChannel[source]¶
Return the Kraus channel describing the noise element.
- class DepolarisingNoiseModel(prepare_error_prob: float = 0.0, x_error_prob: float = 0.0, z_error_prob: float = 0.0, entanglement_error_prob: float = 0.0, measure_channel_prob: float = 0.0, measure_error_prob: float = 0.0)[source]¶
Bases:
NoiseModelDepolarising noise model.
- Parameters:
NoiseModel (class) – Parent abstract class class:
NoiseModel
- __init__(prepare_error_prob: float = 0.0, x_error_prob: float = 0.0, z_error_prob: float = 0.0, entanglement_error_prob: float = 0.0, measure_channel_prob: float = 0.0, measure_error_prob: float = 0.0) None[source]¶
- input_nodes(nodes: Iterable[int], rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to input nodes.
- command(cmd: CommandOrNoise, rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to the command
cmd.
- class Noise[source]¶
Bases:
ABCAbstract base class for noise.
- abstractmethod to_krauschannel() KrausChannel[source]¶
Return the Kraus channel describing the noise.
- class NoiseModel[source]¶
Bases:
ABCAbstract base class for all noise models.
- abstractmethod input_nodes(nodes: Iterable[int], rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to input nodes.
- abstractmethod command(cmd: CommandOrNoise, rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Return the noise to apply to the command
cmd.
- abstractmethod confuse_result(cmd: BaseM, result: Outcome, rng: Generator | None = None, *, stacklevel: int = 1) Outcome[source]¶
Return a possibly flipped measurement outcome.
- Parameters:
result (Outcome) – Ideal measurement result.
cmd (BaseM) – The measurement command that produced the given outcome.
- Returns:
Possibly corrupted result.
- Return type:
Outcome
- transpile(sequence: Iterable[CommandOrNoise], rng: Generator | None = None, *, stacklevel: int = 1) list[CommandOrNoise][source]¶
Apply the noise to a sequence of commands and return the resulting sequence.
- class TwoQubitAmplitudeDampingNoise(prob: float)[source]¶
Bases:
NoiseTwo-qubit amplitude damping noise with damping parameter
prob.- __init__(prob: float) None[source]¶
Initialize two-qubit amplitude damping noise.
- Parameters:
prob (float) – Damping parameter \(\\gamma\) of the noise, between 0 and 1.
- prob¶
Descriptor for probability (between 0 and 1).
- to_krauschannel() KrausChannel[source]¶
Return the Kraus channel describing the noise element.
- class TwoQubitDepolarisingNoise(prob: float)[source]¶
Bases:
NoiseTwo-qubits depolarising noise with probabibity
prob.- __init__(prob: float) None[source]¶
Initialize two-qubit depolarizing noise.
- Parameters:
prob (float) – Probability parameter of the noise, between 0 and 1.
- prob¶
Descriptor for probability (between 0 and 1).
- to_krauschannel() KrausChannel[source]¶
Return the Kraus channel describing the noise element.