Skip to main content

Problem

Struct Problem 

Source
pub struct Problem {
Show 27 fields pub n_qubits: usize, pub dim: usize, pub n_pulse: usize, pub dt: f64, pub duration: f64, pub times: Vec<f64>, pub qubits: Vec<QubitBasis>, pub modulation: CMat<f64>, pub control_ops: Vec<CMat<f64>>, pub channels: Vec<ControlChannel>, pub batch: Vec<BatchElement>, pub evolution: Evolution, pub space: Space, pub x0: Vec<f64>, pub seed: u64, pub target_fidelity: f64, pub max_iter: usize, pub algorithm: String, pub initial_states: Vec<CMat<f64>>, pub observables: Vec<[CMat<f64>; 3]>, pub model: Box<dyn HamiltonianModel>, pub rabi_max: Vec<f64>, pub delta: Vec<f64>, pub sw: Vec<f64>, pub coupling: Option<RMat<f64>>, pub n_snapshots: usize, pub n_rabi: usize,
}
Expand description

Everything an evaluation of the objective needs, derived from a Config.

Fields§

§n_qubits: usize

Number of qubits.

§dim: usize

Hilbert-space dimension of the model.

§n_pulse: usize

Number of time steps.

§dt: f64

Time step in seconds: duration / steps.

§duration: f64

Pulse duration in seconds.

§times: Vec<f64>

Waveform sample times in seconds: the middle of each step, (t + ½)·dt.

§qubits: Vec<QubitBasis>

Each qubit’s basis matrices.

§modulation: CMat<f64>

exp(i·offset_q·(t − T/2)), n_pulse × n_qubits.

§control_ops: Vec<CMat<f64>>

Control operators H_k.

§channels: Vec<ControlChannel>

How each control amplitude is made.

§batch: Vec<BatchElement>

The batch, ordered by initial state (or Pauli operator), then drift snapshot, then Rabi snapshot.

§evolution: Evolution

State evolution per step.

§space: Space

Effective state space.

§x0: Vec<f64>

Initial optimiser parameters.

§seed: u64

The seed every random quantity was drawn from.

§target_fidelity: f64

Target fidelity.

§max_iter: usize

Iteration limit.

§algorithm: String

Optimiser name.

§initial_states: Vec<CMat<f64>>

Initial states in the model’s space, one per configured initial state; the plots start from these.

§observables: Vec<[CMat<f64>; 3]>

Per qubit, the Pauli observables [σx, σy, σz] in the model’s space, zero outside the computational subspace.

§model: Box<dyn HamiltonianModel>

The Hamiltonian model.

§rabi_max: Vec<f64>

Maximum Rabi frequency per qubit in rad/s.

§delta: Vec<f64>

Offset per qubit in rad/s.

§sw: Vec<f64>

Sweep width per qubit in rad/s.

§coupling: Option<RMat<f64>>

Configured coupling (upper-triangular, rad/s, without noise); None for one qubit.

§n_snapshots: usize

Number of drift snapshots.

§n_rabi: usize

Number of Rabi snapshots.

Implementations§

Source§

impl Problem

Source

pub fn n_params(&self) -> usize

Number of optimiser parameters.

Source

pub fn build(cfg: &Config) -> Result<Problem>

Build the problem cfg describes, with its own seed or one from the clock.

Source

pub fn build_with_seed(cfg: &Config, seed: u64) -> Result<Problem>

Build the problem cfg describes, drawing every random quantity from seed.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SendAlias for T

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> SyncAlias for T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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