pub struct GeneralizedTableau<T: Config, IndexType = usize, SparseVectorType: SparseVector<Complex<T::Coeff>, IndexType> = Vec<(Complex64, IndexType)>> {
pub tableau: Tableau<T>,
pub coefficients: SparseVectorType,
pub qubit_status: Vec<QubitStatus>,
pub coefficient_threshold: T::Coeff,
pub measurement_record: Vec<Option<bool>>,
/* private fields */
}Expand description
A Tableau extended with sparse coefficient tracking to handle
non-Clifford gates.
Non-Clifford gates (T, rotations) split a single tableau into a sum
of weighted branches indexed by bitstrings. GeneralizedTableau
stores those weights in a SparseVector keyed by an
IndexType. Choose:
IndexType = usizefor up to 64 qubits,IndexType = u128for up to 128,IndexType = bnum::types::U256and friends for the very wide regime.
Per-qubit status (loss / leakage) is tracked in
qubit_status; gates skip any qubit that is
not QubitStatus::Live.
§Examples
Prepare a Bell pair and sample one shot. With a fixed seed the two measurements are perfectly correlated on every shot:
use ppvm_pauli_sum::config::fxhash::ByteF64;
use ppvm_traits::traits::{Clifford, LossyMeasure};
use ppvm_tableau::data::GeneralizedTableau;
let mut tab: GeneralizedTableau<ByteF64<1>> =
GeneralizedTableau::new_with_seed(2, 1e-12, 0);
tab.h(0);
tab.cnot(0, 1);
let r0 = LossyMeasure::measure(&mut tab, 0);
let r1 = LossyMeasure::measure(&mut tab, 1);
assert_eq!(r0, r1);Non-Clifford gates work through the same interface — apply a T gate
followed by T† and the state is unchanged:
use ppvm_pauli_sum::config::fxhash::ByteF64;
use ppvm_traits::traits::{Clifford, TGate};
use ppvm_tableau::data::GeneralizedTableau;
let mut tab: GeneralizedTableau<ByteF64<1>> =
GeneralizedTableau::new_with_seed(1, 1e-12, 0);
tab.h(0);
tab.t(0);
tab.t_dag(0);
// T followed by T† is the identity; the |+⟩ state is restored.Fields§
§tableau: Tableau<T>Underlying Clifford tableau.
coefficients: SparseVectorTypeSparse coefficient vector indexed by bitstrings.
qubit_status: Vec<QubitStatus>Per-qubit status relative to the computational subspace.
coefficient_threshold: T::CoeffCoefficient-magnitude threshold below which branches are dropped.
measurement_record: Vec<Option<bool>>Ordered log of every measurement performed (mirrors stim’s record).
Implementations§
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> GeneralizedTableau<T, I, C>
Sourcepub fn new(n_qubits: usize, coefficient_threshold: T::Coeff) -> Self
pub fn new(n_qubits: usize, coefficient_threshold: T::Coeff) -> Self
Construct a generalized tableau in the |0…0⟩ state.
Branches whose coefficient magnitude falls below
coefficient_threshold are dropped during gate application.
Sourcepub fn new_with_seed(
n_qubits: usize,
coefficient_threshold: T::Coeff,
seed: u64,
) -> Self
pub fn new_with_seed( n_qubits: usize, coefficient_threshold: T::Coeff, seed: u64, ) -> Self
Same as GeneralizedTableau::new, but seed the RNG deterministically.
pub fn reset_all(&mut self)
Sourcepub fn fork(&self, seed: Option<u64>) -> Self
pub fn fork(&self, seed: Option<u64>) -> Self
Clone the quantum state but reinitialize the RNG, producing an independent simulation
branch. If seed is Some, the new RNG is seeded deterministically; if None, it is
seeded from OS entropy.
Sourcepub fn current_measurement_record(&self) -> &[Option<bool>]
pub fn current_measurement_record(&self) -> &[Option<bool>]
All measurement outcomes recorded so far, in order.
Sourcepub fn append_measurement_record(&mut self, result: Option<bool>)
pub fn append_measurement_record(&mut self, result: Option<bool>)
Append an externally defined measurement result to the record.
Used by Stim instructions such as MPAD, which append measurement
record bits without measuring a qubit.
Sourcepub fn overwrite_last_measurement_record(&mut self, result: Option<bool>)
pub fn overwrite_last_measurement_record(&mut self, result: Option<bool>)
Replace the most recent measurement record entry.
Used by noisy measurement paths where the quantum state follows the true outcome but the public record should hold the reported bit.
Sourcepub fn cz_block_pairs(&mut self, base: usize, offset: usize, count: usize)
pub fn cz_block_pairs(&mut self, base: usize, offset: usize, count: usize)
Apply CZ to N pairs with constant offset: (base+i, base+offset+i) for i in 0..count.
Falls back to individual CZ calls if any qubit in the range is lost or leaked.
Overlap (offset < count) is owned by Tableau::cz_block_pairs.
Sourcepub fn cz_block_pairs_cross_word(
&mut self,
word_c: usize,
base_bit_c: usize,
word_t: usize,
base_bit_t: usize,
count: usize,
)
pub fn cz_block_pairs_cross_word( &mut self, word_c: usize, base_bit_c: usize, word_t: usize, base_bit_t: usize, count: usize, )
Apply CZ to N cross-word pairs. Controls at word_c, targets at word_t. Falls back to individual CZ calls if any qubit is lost or leaked.
Sourcepub fn cz_block(
&mut self,
control_base: usize,
target_base: usize,
count: usize,
)
pub fn cz_block( &mut self, control_base: usize, target_base: usize, count: usize, )
Apply CZ to count pairs with a constant offset, given in qubit-index
terms: (control_base + i, target_base + i) for i in 0..count.
This is the high-level entry point for a fused block of CZs: it splits
the run at storage-word boundaries internally and dispatches each
segment to Self::cz_block_pairs (control and target in the same
word) or Self::cz_block_pairs_cross_word (straddling two words), so
callers never need to reason about the u64 packing. CZ is symmetric,
so the two bases may be passed in either order.
Overlapping pairs — |target_base - control_base| < count, of which
adjacent-pair brickwork cz_block(0, 1, n) is the extreme case — are
handled: the same-word segments route through Self::cz_block_pairs
into Tableau::cz_block_pairs, which falls back to the per-pair
loop. A cross-word segment is always disjoint (its run never exceeds
the offset), so the fused kernel stays live there.
Sourcepub fn compute_decomposition(&self, addr0: usize, pauli: Pauli) -> (u8, I, I)
pub fn compute_decomposition(&self, addr0: usize, pauli: Pauli) -> (u8, I, I)
Compute the decomposition of a pauli into stabilizer destabilizer products Any Pauli can be written as P_addr0 = phase * prod(d_k ^ gamma_k) * prod(s_l ^ lambda_l) where: gamma_k == 1 iff {P_addr0, s_k} = 0 lambda_l == 1 iff {P_addr0, d_l} = 0 Lemma 5. from T. J. Yoder (2012) NOTE: this is O(n^2)
The function returns (phase, stab_anticomm_bits, destab_anticomm_bits), where
stab_anticomm_bits[k] = 1 iff P_addr0 anticommutes with stabilizer s_k, and
destab_anticomm_bits[l] = 1 iff P_addr0 anticommutes with destabilizer d_l.
Note that stab_anticomm_bits is equal to the shift of the index when branching
(beta in Eq(4) of the SOFT paper).
Sourcepub fn odd_phase_destabilizer_mask(&self) -> I
pub fn odd_phase_destabilizer_mask(&self) -> I
Build a bitmask where bit i is set if destabilizer i has odd phase (phase % 2 != 0).
Source§impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Sourcepub fn expectation<W: PauliWordTrait>(&self, word: &W) -> f64
pub fn expectation<W: PauliWordTrait>(&self, word: &W) -> f64
⟨ψ|word|ψ⟩ for the multi-qubit Pauli word.
Conjugates word through the Clifford tableau (giving a Pauli on the
canonical basis: an X-mask, Z-mask, and i^φ phase), then sums
⟨α|P_conj|β⟩ c_α* c_β over the sparse coefficient vector. Always
returns a real number (Hermitian operator on a normalized state).
Sourcepub fn trace(&self, pattern: &PauliPattern) -> f64
pub fn trace(&self, pattern: &PauliPattern) -> f64
Σ_{P matches pattern} ⟨ψ|P|ψ⟩.
Enumerates every PauliWord accepted by pattern via
PauliPattern::enumerate_matches and sums their expectations.
Star quantifiers (X*) panic — the pattern must be bounded; use
counted repetition (Z?{n}) or positional anchors instead.
Source§impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
pub fn project_case_a( &mut self, outcome: bool, scratch: &mut MeasureScratch<I, T::Coeff>, phase_decomp: u8, stab_anticomm_bits: I, destab_anticomm_bits: I, addr0: usize, )
Source§impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Sourcepub fn measure_noisy(&mut self, addr0: usize, flip_prob: f64) -> Option<bool>
pub fn measure_noisy(&mut self, addr0: usize, flip_prob: f64) -> Option<bool>
Measure qubit addr0 in Z basis with optional readout noise.
Behaves like measure, then with probability
flip_prob flips the recorded bit. The qubit’s quantum state stays
consistent with the true outcome — only the returned value flips.
flip_prob = 0.0 is equivalent to measure.
If the qubit is lost, returns None regardless of flip_prob.
Sourcepub fn bernoulli(&mut self, p: f64) -> bool
pub fn bernoulli(&mut self, p: f64) -> bool
Sample a Bernoulli(p) outcome using the tableau’s internal RNG.
Used by Stim measurement-noise dispatch in ppvm-stim.
Sourcepub fn flip_with_prob(&mut self, bit: bool, p: f64) -> bool
pub fn flip_with_prob(&mut self, bit: bool, p: f64) -> bool
Flip bit with probability p. Used by Stim MR/MPad readout-noise
dispatch in ppvm-stim. Returns bit unchanged when p <= 0.0.
Source§impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Measurement overlap helper functions, with optional rayon parallelism.
impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Measurement overlap helper functions, with optional rayon parallelism.
Sourcepub fn z_expectation(&self, addr0: usize) -> f64
pub fn z_expectation(&self, addr0: usize) -> f64
⟨Z⟩ on qubit addr0, computed non-destructively (the state is not
collapsed). Reuses the measurement overlap machinery; cost scales with
the number of coefficients (and n²).
Sourcepub fn compute_overlap_case_b(
entries: &[(Complex<T::Coeff>, I)],
phase_decomp: u8,
destab_anticomm_bits: I,
) -> f64
pub fn compute_overlap_case_b( entries: &[(Complex<T::Coeff>, I)], phase_decomp: u8, destab_anticomm_bits: I, ) -> f64
Case_b overlap: self-pairing (branch_index = idx), so overlap = ±|c|^2. Only even phases contribute to the real part. Divided by ⟨ψ|ψ⟩, since gate-time truncation leaves the state unnormalized.
Sourcepub fn compute_overlap_case_a(
coeff_map: &HashMap<I, Complex<T::Coeff>>,
phase_decomp: u8,
destab_anticomm_bits: I,
stab_anticomm_bits: I,
odd_phase_mask: I,
) -> f64
pub fn compute_overlap_case_a( coeff_map: &HashMap<I, Complex<T::Coeff>>, phase_decomp: u8, destab_anticomm_bits: I, stab_anticomm_bits: I, odd_phase_mask: I, ) -> f64
Case_a overlap: cross-index pairing via HashMap lookup. Accumulates only the real part of z_overlap. Divided by ⟨ψ|ψ⟩, since gate-time truncation leaves the state unnormalized.
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> GeneralizedTableau<T, I, C>
Source§impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
impl<T, I, C> GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Sourcepub fn measure_all_with_scratch(
&mut self,
scratch: &mut MeasureScratch<I, T::Coeff>,
) -> Vec<Option<bool>>
pub fn measure_all_with_scratch( &mut self, scratch: &mut MeasureScratch<I, T::Coeff>, ) -> Vec<Option<bool>>
Same as LossyMeasureAll::measure_all, but the caller supplies a
MeasureScratch that’s reused across the n per-qubit measurements
(and, if the caller chooses, across many invocations / shots).
This is the entry point samplers should use when running many shots: initialize one scratch alongside the sampler and thread it through every shot to amortize the case-a HashMap and b_entries allocations.
Sourcepub fn measure_many_with_scratch(
&mut self,
indices: &[usize],
scratch: &mut MeasureScratch<I, T::Coeff>,
) -> Vec<Option<bool>>
pub fn measure_many_with_scratch( &mut self, indices: &[usize], scratch: &mut MeasureScratch<I, T::Coeff>, ) -> Vec<Option<bool>>
Measure the given qubit indices in order, reusing a caller-supplied
MeasureScratch across the per-index measurements (and, if the caller
chooses, across many invocations / shots) — the explicit-index analogue
of measure_all_with_scratch. This is
the scratch-reusing engine behind the tableau’s LossyMeasure::measure_many
override (in measure.rs), which the Stim executor and the Python
measure_many binding both go through.
Trait Implementations§
Source§impl<T: Config, I, C> AsymmetricLossChannel<T> for GeneralizedTableau<T, I, C>where
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: Debug + SparseVector<Complex<T::Coeff>, I>,
T::Coeff: PartialOrd<f64> + One + Zero + Clone + Num + ToPrimitive + Debug + Send + Sync,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: Debug + TableauIndex + Send + Sync,
impl<T: Config, I, C> AsymmetricLossChannel<T> for GeneralizedTableau<T, I, C>where
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: Debug + SparseVector<Complex<T::Coeff>, I>,
T::Coeff: PartialOrd<f64> + One + Zero + Clone + Num + ToPrimitive + Debug + Send + Sync,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: Debug + TableauIndex + Send + Sync,
Source§fn asymmetric_loss_channel(&mut self, addr0: usize, p0: T::Coeff, p1: T::Coeff)
fn asymmetric_loss_channel(&mut self, addr0: usize, p0: T::Coeff, p1: T::Coeff)
State-dependent single-qubit loss (“asymmetric loss”).
Models a three-level atom whose |0⟩ and |1⟩ levels leak into a loss
state |L⟩ at different rates: the qubit is lost from |0⟩ with
probability p0 and from |1⟩ with p1. The total loss probability is
state-dependent,
p_tot = p0 * (1 + ⟨Z⟩)/2 + p1 * (1 - ⟨Z⟩)/2,with ⟨Z⟩ the current Z-expectation of addr0. With probability p_tot
the qubit is collapsed, reset to |0⟩, and marked lost (as in
LossChannel::loss_channel); otherwise it is left unchanged.
§Approximation
This is the trajectory approximation of the true loss channel. It
reproduces the loss statistics (which qubits are flagged lost, and how
often) and is exact in the symmetric limit p0 == p1, where it reduces
to LossChannel::loss_channel. It does NOT apply the survival
back-action K0 = sqrt(1-p0)|0⟩⟨0| + sqrt(1-p1)|1⟩⟨1|: for p0 != p1
the faithful channel reshapes the surviving qubit (population tilts
toward the less-leaky level, coherences are damped), and this
implementation skips that reshaping. The back-action is non-Clifford (it
branches the coefficient vector like an rz), so it is omitted to keep
the channel cheap enough to apply after every gate. See issue #39.
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> Clifford for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> Clifford for GeneralizedTableau<T, I, C>
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> CliffordBatch for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> CliffordBatch for GeneralizedTableau<T, I, C>
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> CliffordExtensions for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> CliffordExtensions for GeneralizedTableau<T, I, C>
Source§fn sqrt_x_dag(&mut self, index: usize)
fn sqrt_x_dag(&mut self, index: usize)
(√X)† to one qubit.Source§fn sqrt_y_dag(&mut self, index: usize)
fn sqrt_y_dag(&mut self, index: usize)
(√Y)† to one qubit.Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> CliffordExtensionsBatch for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> CliffordExtensionsBatch for GeneralizedTableau<T, I, C>
Source§fn s_dag_many(&mut self, indices: &[usize])
fn s_dag_many(&mut self, indices: &[usize])
S† to every qubit in indices.Source§fn sqrt_x_many(&mut self, indices: &[usize])
fn sqrt_x_many(&mut self, indices: &[usize])
√X to every qubit in indices.Source§fn sqrt_x_dag_many(&mut self, indices: &[usize])
fn sqrt_x_dag_many(&mut self, indices: &[usize])
(√X)† to every qubit in indices.Source§fn sqrt_y_many(&mut self, indices: &[usize])
fn sqrt_y_many(&mut self, indices: &[usize])
√Y to every qubit in indices.Source§fn sqrt_y_dag_many(&mut self, indices: &[usize])
fn sqrt_y_dag_many(&mut self, indices: &[usize])
(√Y)† to every qubit in indices.Source§impl<T: Clone + Config, IndexType: Clone, SparseVectorType: Clone + SparseVector<Complex<T::Coeff>, IndexType>> Clone for GeneralizedTableau<T, IndexType, SparseVectorType>
impl<T: Clone + Config, IndexType: Clone, SparseVectorType: Clone + SparseVector<Complex<T::Coeff>, IndexType>> Clone for GeneralizedTableau<T, IndexType, SparseVectorType>
Apply a correlated loss channel to qubits at addr0 and addr1.
The three probabilities are:
p[0]: The probability of losing both qubits simultaneously when both of them are in the qubit subspace.p[1]: The probability of losing a named one of the two qubits when both of them are in the qubit subspace, so the probability of losing exactly one is2·p[1]and the both-present survivor keeps1 − 2·p[1] − p[0](which qubit is lost is 50/50). Seeppvm_traits::traits::CorrelatedLossChannelfor the normative statement.p[2]: The probability of losing one qubit when the other one has already been lost prior to the channel.
Source§impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> Depolarizing2<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> Depolarizing2<T> for GeneralizedTableau<T, I, C>
Source§impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> Depolarizing<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> Depolarizing<T> for GeneralizedTableau<T, I, C>
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> Display for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> Display for GeneralizedTableau<T, I, C>
Source§impl<T: Config, I, C> LeakageChannel<T> for GeneralizedTableau<T, I, C>where
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: Debug + SparseVector<Complex<T::Coeff>, I>,
T::Coeff: PartialOrd + PartialOrd<f64> + One + Zero + Clone + Num + ToPrimitive + Debug,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: Debug + TableauIndex,
impl<T: Config, I, C> LeakageChannel<T> for GeneralizedTableau<T, I, C>where
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: Debug + SparseVector<Complex<T::Coeff>, I>,
T::Coeff: PartialOrd + PartialOrd<f64> + One + Zero + Clone + Num + ToPrimitive + Debug,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: Debug + TableauIndex,
Source§impl<T: Config, I, C> LossChannel<T> for GeneralizedTableau<T, I, C>where
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: Debug + SparseVector<Complex<T::Coeff>, I>,
T::Coeff: PartialOrd<f64> + One + Zero + Clone + Num + ToPrimitive + Debug + Send + Sync,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: Debug + TableauIndex + Send + Sync,
impl<T: Config, I, C> LossChannel<T> for GeneralizedTableau<T, I, C>where
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: Debug + SparseVector<Complex<T::Coeff>, I>,
T::Coeff: PartialOrd<f64> + One + Zero + Clone + Num + ToPrimitive + Debug + Send + Sync,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: Debug + TableauIndex + Send + Sync,
Source§impl<T, I, C> LossyMeasure for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
impl<T, I, C> LossyMeasure for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Source§fn measure_many(&mut self, targets: &[usize]) -> Vec<Option<bool>>
fn measure_many(&mut self, targets: &[usize]) -> Vec<Option<bool>>
Override the trait default (a per-target measure loop, which allocates
a fresh MeasureScratch on every call) with a single scratch reused
across the whole batch, amortizing the case-a HashMap / b_entries
allocations and the cached odd-phase-destabilizer mask. Outcomes, the
measurement record, and the RNG-draw order are identical to measuring
each target individually — only the internal allocation pattern changes.
Source§impl<T, I, C> LossyMeasureAll for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
impl<T, I, C> LossyMeasureAll for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
I: TableauIndex + Debug,
Source§impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> PauliError<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> PauliError<T> for GeneralizedTableau<T, I, C>
Source§fn pauli_error(&mut self, addr0: usize, p: [T::Coeff; 3])
fn pauli_error(&mut self, addr0: usize, p: [T::Coeff; 3])
[p_x, p_y, p_z] to one qubit.Source§fn x_error(&mut self, addr0: usize, p: <T as Config>::Coeff)
fn x_error(&mut self, addr0: usize, p: <T as Config>::Coeff)
X_ERROR(p) — apply X with probability p to one qubit.Source§fn y_error(&mut self, addr0: usize, p: <T as Config>::Coeff)
fn y_error(&mut self, addr0: usize, p: <T as Config>::Coeff)
Y_ERROR(p) — apply Y with probability p to one qubit.Source§fn z_error(&mut self, addr0: usize, p: <T as Config>::Coeff)
fn z_error(&mut self, addr0: usize, p: <T as Config>::Coeff)
Z_ERROR(p) — apply Z with probability p to one qubit.Source§fn pauli_error_many(&mut self, targets: &[usize], p: [<T as Config>::Coeff; 3])
fn pauli_error_many(&mut self, targets: &[usize], p: [<T as Config>::Coeff; 3])
Source§fn x_error_many(&mut self, targets: &[usize], p: <T as Config>::Coeff)
fn x_error_many(&mut self, targets: &[usize], p: <T as Config>::Coeff)
X_ERROR(p).Source§impl<T, I, C> Reset for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
I: TableauIndex + Debug,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
impl<T, I, C> Reset for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
I: TableauIndex + Debug,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
Source§fn reset_many(&mut self, targets: &[usize])
fn reset_many(&mut self, targets: &[usize])
|0⟩.Source§fn reset_z_many(&mut self, targets: &[usize])
fn reset_z_many(&mut self, targets: &[usize])
RZ alias.Source§fn reset_x_many(&mut self, targets: &[usize])
fn reset_x_many(&mut self, targets: &[usize])
RX.Source§fn reset_y_many(&mut self, targets: &[usize])
fn reset_y_many(&mut self, targets: &[usize])
RY.Source§impl<T, I, C> ResetLeakageChannel<T> for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
I: TableauIndex + Debug,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
impl<T, I, C> ResetLeakageChannel<T> for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
I: TableauIndex + Debug,
C: SparseVector<Complex<T::Coeff>, I> + Debug,
T::Coeff: One + Zero + Clone + Num + ToPrimitive + Debug + Mul<f64> + PartialOrd<f64>,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + From<Complex64> + MulAssign + AddAssign + One + ComplexFloat + Copy,
Source§fn reset_leakage_channel(&mut self, addr0: usize)
fn reset_leakage_channel(&mut self, addr0: usize)
Source§impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> ResetLossChannel<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> ResetLossChannel<T> for GeneralizedTableau<T, I, C>
Source§fn reset_loss_channel(&mut self, addr0: usize)
fn reset_loss_channel(&mut self, addr0: usize)
addr0.Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> RotXY<T> for GeneralizedTableau<T, I, C>where
GeneralizedTableau<T, I, C>: RotationOne<T>,
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> RotXY<T> for GeneralizedTableau<T, I, C>where
GeneralizedTableau<T, I, C>: RotationOne<T>,
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> RotationOne<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> RotationOne<T> for GeneralizedTableau<T, I, C>
Source§fn rotate_1(&mut self, axis: Pauli, addr0: usize, theta: <T as Config>::Coeff)
fn rotate_1(&mut self, axis: Pauli, addr0: usize, theta: <T as Config>::Coeff)
axis (one of X, Y, Z) by angle theta.Source§fn rx_many(&mut self, targets: &[usize], theta: impl Into<<T as Config>::Coeff>)
fn rx_many(&mut self, targets: &[usize], theta: impl Into<<T as Config>::Coeff>)
RX(θ).Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> RotationTwo<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> RotationTwo<T> for GeneralizedTableau<T, I, C>
Source§fn rotate_2(
&mut self,
axis_a: [u8; 2],
axis_b: [u8; 2],
a: usize,
b: usize,
theta: <T as Config>::Coeff,
)
fn rotate_2( &mut self, axis_a: [u8; 2], axis_b: [u8; 2], a: usize, b: usize, theta: <T as Config>::Coeff, )
exp(-i * theta/2 * P_a ⊗ P_b). Read moreSource§fn rxx(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn rxx(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · X_a X_b).Source§fn rxx_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn rxx_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
rxx].Source§fn rxy(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn rxy(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · X_a Y_b).Source§fn rxy_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn rxy_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
rxy].Source§fn rxz(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn rxz(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · X_a Z_b).Source§fn rxz_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn rxz_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
rxz].Source§fn ryx(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn ryx(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · Y_a X_b).Source§fn ryx_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn ryx_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
ryx].Source§fn ryy(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn ryy(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · Y_a Y_b).Source§fn ryy_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn ryy_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
ryy].Source§fn ryz(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn ryz(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · Y_a Z_b).Source§fn ryz_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn ryz_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
ryz].Source§fn rzx(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn rzx(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · Z_a X_b).Source§fn rzx_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn rzx_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
rzx].Source§fn rzy(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
fn rzy(&mut self, a: usize, b: usize, theta: impl Into<<T as Config>::Coeff>)
exp(-i θ/2 · Z_a Y_b).Source§fn rzy_many(
&mut self,
pairs: &[(usize, usize)],
theta: impl Into<<T as Config>::Coeff>,
)
fn rzy_many( &mut self, pairs: &[(usize, usize)], theta: impl Into<<T as Config>::Coeff>, )
rzy].Source§impl<T, I, C> TGate<T> for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I>,
T::Coeff: One + Zero + Clone + Send + Sync + Num + PartialOrd,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + AddAssign + From<Complex64> + ComplexFloat + Copy,
I: TableauIndex + Send + Sync,
<I as BitAnd<<I as Shl<usize>>::Output>>::Output: PartialEq<I>,
impl<T, I, C> TGate<T> for GeneralizedTableau<T, I, C>where
T: Config,
<<T as Config>::Storage as BitView>::Store: PrimInt,
C: SparseVector<Complex<T::Coeff>, I>,
T::Coeff: One + Zero + Clone + Send + Sync + Num + PartialOrd,
Complex<T::Coeff>: Mul<Output = Complex<T::Coeff>> + AddAssign + From<Complex64> + ComplexFloat + Copy,
I: TableauIndex + Send + Sync,
<I as BitAnd<<I as Shl<usize>>::Output>>::Output: PartialEq<I>,
Source§impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> TableauLike for GeneralizedTableau<T, I, C>
impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> TableauLike for GeneralizedTableau<T, I, C>
Source§fn is_qubit_lost(&self, addr: usize) -> bool
fn is_qubit_lost(&self, addr: usize) -> bool
addr is inactive (lost or leaked), so the
Pauli noise channels skip it. Default: never inactive.Source§fn depolarize_impl(&mut self, addr0: usize, p: Self::Coeff)
fn depolarize_impl(&mut self, addr0: usize, p: Self::Coeff)
Source§fn pauli_error_impl(&mut self, addr0: usize, p: [Self::Coeff; 3])
fn pauli_error_impl(&mut self, addr0: usize, p: [Self::Coeff; 3])
Source§impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> TwoQubitPauliError<T> for GeneralizedTableau<T, I, C>
impl<T: Config, I: TableauIndex, C: SparseVector<Complex<T::Coeff>, I>> TwoQubitPauliError<T> for GeneralizedTableau<T, I, C>
Source§impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> U3Gate<T> for GeneralizedTableau<T, I, C>where
GeneralizedTableau<T, I, C>: RotationOne<T>,
impl<T: Config, I, C: SparseVector<Complex<T::Coeff>, I>> U3Gate<T> for GeneralizedTableau<T, I, C>where
GeneralizedTableau<T, I, C>: RotationOne<T>,
Auto Trait Implementations§
impl<T, IndexType, SparseVectorType> Freeze for GeneralizedTableau<T, IndexType, SparseVectorType>
impl<T, IndexType, SparseVectorType> RefUnwindSafe for GeneralizedTableau<T, IndexType, SparseVectorType>where
Tableau<T>: RefUnwindSafe,
SparseVectorType: RefUnwindSafe,
<T as Config>::Coeff: RefUnwindSafe,
PhantomData<IndexType>: RefUnwindSafe,
impl<T, IndexType, SparseVectorType> Send for GeneralizedTableau<T, IndexType, SparseVectorType>
impl<T, IndexType, SparseVectorType> Sync for GeneralizedTableau<T, IndexType, SparseVectorType>
impl<T, IndexType, SparseVectorType> Unpin for GeneralizedTableau<T, IndexType, SparseVectorType>
impl<T, IndexType, SparseVectorType> UnsafeUnpin for GeneralizedTableau<T, IndexType, SparseVectorType>where
Tableau<T>: UnsafeUnpin,
SparseVectorType: UnsafeUnpin,
<T as Config>::Coeff: UnsafeUnpin,
PhantomData<IndexType>: UnsafeUnpin,
impl<T, IndexType, SparseVectorType> UnwindSafe for GeneralizedTableau<T, IndexType, SparseVectorType>where
Tableau<T>: UnwindSafe,
SparseVectorType: UnwindSafe,
<T as Config>::Coeff: UnwindSafe,
PhantomData<IndexType>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.