pub struct ProcessTomography;Expand description
Process tomography utilities
Implementations§
Source§impl ProcessTomography
impl ProcessTomography
Sourcepub fn reconstruct_channel(
input_states: &[Array2<Complex<f64>>],
output_states: &[Array2<Complex<f64>>],
) -> QuantRS2Result<QuantumChannel>
pub fn reconstruct_channel( input_states: &[Array2<Complex<f64>>], output_states: &[Array2<Complex<f64>>], ) -> QuantRS2Result<QuantumChannel>
Reconstruct a quantum channel from process tomography data via linear inversion / least-squares estimation of its Choi matrix.
Given input density matrices ρ_k and the measured outputs
ρ'_k = Λ(ρ_k), the channel is determined by its Choi matrix J. Using
the column-stacking Choi convention of this module (the same one used by
QuantumChannel::kraus_to_choi), the action of the channel is linear in
the entries of J:
Λ(ρ)[i, i'] = Σ_{j, j'} ρ[j, j'] · J[i + j·d_out, i' + j'·d_out]Each (ρ_k, ρ'_k) pair therefore contributes d_out² scalar linear
constraints A · vec(J) = b. Stacking all pairs and solving the
least-squares problem (via the Hermitian normal equations
AᴴA · vec(J) = Aᴴb, solved with a spectral pseudo-inverse) yields the
best-fit Choi matrix, from which the channel is rebuilt with
QuantumChannel::from_choi.
§Errors
Returns QuantRS2Error::InvalidInput if the input/output counts differ,
if any density matrix is not square / dimensions are inconsistent, or if
the supplied input states are not informationally complete (fewer than
d² linearly independent inputs, leaving the Choi matrix
under-determined). No identity / placeholder channel is fabricated.
Sourcepub fn generate_input_states(dim: usize) -> Vec<Array2<Complex<f64>>> ⓘ
pub fn generate_input_states(dim: usize) -> Vec<Array2<Complex<f64>>> ⓘ
Generate an informationally-complete set of input states for a
dim-dimensional system.
Process tomography of a dim × dim channel needs dim² linearly
independent input density matrices. This routine returns exactly such a
set:
- the
dimcomputational-basis populations|i⟩⟨i|, and - for every pair
i < j, the two superposition states|+_{ij}⟩ = (|i⟩ + |j⟩)/√2and|+i_{ij}⟩ = (|i⟩ + i|j⟩)/√2as density matrices|ψ⟩⟨ψ|.
The diagonal states fix the populations while each pair of off-diagonal
states fixes the real and imaginary parts of the corresponding coherence,
giving dim + 2 · C(dim, 2) = dim² linearly independent operators that
span the full space of Hermitian matrices.
Auto Trait Implementations§
impl Freeze for ProcessTomography
impl RefUnwindSafe for ProcessTomography
impl Send for ProcessTomography
impl Sync for ProcessTomography
impl Unpin for ProcessTomography
impl UnsafeUnpin for ProcessTomography
impl UnwindSafe for ProcessTomography
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.