Struct NoiseModel

Source
pub struct NoiseModel {
    pub initial_state: State,
    pub i: Process,
    pub x: Process,
    pub y: Process,
    pub z: Process,
    pub h: Process,
    pub s: Process,
    pub s_adj: Process,
    pub t: Process,
    pub t_adj: Process,
    pub cnot: Process,
    pub z_meas: Instrument,
}
Expand description

A description of the noise that applies to the state of a quantum system as the result of applying operations.

Fields§

§initial_state: State

The initial state that freshly allocated qubits start off in.

§i: Process

The process that applies to the state of a simulator when the I operation is called.

§x: Process

The process that applies to the state of a simulator when the X operation is called.

§y: Process

The process that applies to the state of a simulator when the Y operation is called.

§z: Process

The process that applies to the state of a simulator when the Z operation is called.

§h: Process

The process that applies to the state of a simulator when the H operation is called.

§s: Process

The process that applies to the state of a simulator when the S operation is called.

§s_adj: Process

The process that applies to the state of a simulator when the Adjoint S operation is called.

§t: Process

The process that applies to the state of a simulator when the T operation is called.

§t_adj: Process

The process that applies to the state of a simulator when the Adjoint T operation is called.

§cnot: Process

The process that applies to the state of a simulator when the CNOT operation is called.

§z_meas: Instrument

The instrument that is used to the measure the state of a simulator in the $Z$-basis.

Implementations§

Source§

impl NoiseModel

Source

pub fn as_json(&self) -> String

Returns a serialization of this noise model as a JSON object.

Source

pub fn get_by_name(name: &str) -> Result<NoiseModel, String>

Given the name of a built-in noise model, returns either that noise model if it exists, or an Err variant if no such model exists.

Currently accepted noise model names:

  • "ideal": A full-state noise model in which all operations are ideal (that is, without errors).
  • "ideal_stabilizer": A noise model in which all operations except NoiseModel::t and NoiseModel::t_adj are ideal, and represented in a form compatible with stabilizer simulation.
§Example
let noise_model = NoiseModel::get_by_name("ideal");
Source

pub fn ideal() -> NoiseModel

Returns a copy of the ideal noise model; that is, a noise model describing the case in which no noise acts on the quantum system.

Source

pub fn ideal_stabilizer() -> NoiseModel

Returns a copy of the ideal noise model suitable for use with stabilizer simulation; that is, a noise model describing the case in which no noise acts on the quantum system, and in which all channels can be represented by CHP decompositions.

Trait Implementations§

Source§

impl Debug for NoiseModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NoiseModel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NoiseModel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,