Skip to main content

NoiseChannel

Trait NoiseChannel 

Source
pub trait NoiseChannel: Debug + Clone {
    // Required methods
    fn name(&self) -> &'static str;
    fn qubits(&self) -> Vec<QubitId>;
    fn apply_to_statevector(
        &self,
        state: &mut [Complex64],
    ) -> QuantRS2Result<()>;
    fn kraus_operators(&self) -> Vec<Vec<Complex64>>;
    fn probability(&self) -> f64;
}
Expand description

Trait for quantum noise channels

Required Methods§

Source

fn name(&self) -> &'static str

Return the name of the channel

Source

fn qubits(&self) -> Vec<QubitId>

Return the qubits this channel affects

Source

fn apply_to_statevector(&self, state: &mut [Complex64]) -> QuantRS2Result<()>

Apply the noise channel to a state vector

Source

fn kraus_operators(&self) -> Vec<Vec<Complex64>>

Return the Kraus operators for this channel

Source

fn probability(&self) -> f64

Probability of the noise occurring

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§