DynamicalDecoupling

Struct DynamicalDecoupling 

Source
pub struct DynamicalDecoupling {
    pub min_idle_time: f64,
    pub sequence_type: DecouplingSequence,
    /* private fields */
}
Expand description

Optimization pass that inserts dynamical decoupling sequences

Fields§

§min_idle_time: f64

Minimum idle time to insert decoupling (nanoseconds)

§sequence_type: DecouplingSequence

Decoupling sequence type

Implementations§

Source§

impl DynamicalDecoupling

Source

pub fn new(noise_model: NoiseModel) -> Self

Create a new dynamical decoupling pass

Examples found in repository?
examples/noise_optimization_demo.rs (line 174)
145fn demo_noise_optimization_passes(
146    circuit: &Circuit<4>,
147) -> quantrs2_core::error::QuantRS2Result<()> {
148    println!("--- Individual Optimization Passes ---");
149
150    let noise_model = NoiseModel::ibm_like(4);
151    let coupling_map = CouplingMap::linear(4);
152
153    // Test coherence optimization
154    let coherence_opt = CoherenceOptimization::new(noise_model.clone());
155    let cost_model = NoiseAwareCostModel::new(noise_model.clone());
156
157    if coherence_opt.should_apply() {
158        let coherence_result = coherence_opt.apply(circuit, &cost_model)?;
159        println!("✓ Coherence optimization applied");
160        println!("  Original gates: {}", circuit.num_gates());
161        println!("  After coherence opt: {}", coherence_result.num_gates());
162    }
163
164    // Test noise-aware mapping
165    let mapping_opt = NoiseAwareMapping::new(noise_model.clone(), coupling_map.clone());
166    if mapping_opt.should_apply() {
167        let mapping_result = mapping_opt.apply(circuit, &cost_model)?;
168        println!("✓ Noise-aware mapping applied");
169        println!("  Original gates: {}", circuit.num_gates());
170        println!("  After mapping opt: {}", mapping_result.num_gates());
171    }
172
173    // Test dynamical decoupling
174    let dd_opt = DynamicalDecoupling::new(noise_model.clone());
175    if dd_opt.should_apply() {
176        let dd_result = dd_opt.apply(circuit, &cost_model)?;
177        println!("✓ Dynamical decoupling applied");
178        println!("  Original gates: {}", circuit.num_gates());
179        println!("  After DD insertion: {}", dd_result.num_gates());
180    }
181
182    println!();
183    Ok(())
184}

Trait Implementations§

Source§

impl Clone for DynamicalDecoupling

Source§

fn clone(&self) -> DynamicalDecoupling

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DynamicalDecoupling

Source§

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

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

impl OptimizationPass for DynamicalDecoupling

Source§

fn name(&self) -> &str

Name of the optimization pass
Source§

fn apply_to_gates( &self, gates: Vec<Box<dyn GateOp>>, _cost_model: &dyn CostModel, ) -> QuantRS2Result<Vec<Box<dyn GateOp>>>

Apply the optimization pass to a gate list
Source§

fn should_apply(&self) -> bool

Check if this pass should be applied

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, const N: usize> OptimizationPassExt<N> for T
where T: OptimizationPass + ?Sized,

Source§

fn apply( &self, circuit: &Circuit<N>, cost_model: &dyn CostModel, ) -> Result<Circuit<N>, QuantRS2Error>

Source§

fn should_apply_to_circuit(&self, _circuit: &Circuit<N>) -> bool

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> Ungil for T
where T: Send,