ppvm_tableau::tableau_like
tableau_like¶
ppvm_tableau::tableau_like
[`TableauLike`](tableau_like::TableauLike) — shared trait for stabilizer-tableau backends. [`TableauLike`](crate::tableau_like::TableauLike) trait: shared interface for stabilizer-tableau backends.
Any type implementing TableauLike gets default implementations of single- and two-qubit Pauli noise channels (Depolarizing, PauliError, Depolarizing2, TwoQubitPauliError). New tableau backends only need to provide TableauLike::rng_mut and (optionally) override TableauLike::is_qubit_lost.
classTableauLike¶source
ppvm_tableau::tableau_like::TableauLike
Rust trait. A stabilizer-tableau-like backend that supports Clifford gates and an RNG.
pub trait TableauLike: CliffordAssociated items
| Name | Type | Description |
|---|---|---|
Coeff | type Coeff: Coefficient + PartialOrd<f64> | associated type. Coefficient type used for probabilities. |
Rng | type Rng: Rng + RngExt | associated type. RNG type backing the stochastic channels. |
Implementing this trait grants default implementations of the Pauli noise channels via TableauLike::depolarize_impl and friends. The associated `Rng` type lets each backend choose its own RNG; nothing in this trait depends on `SmallRng`.
sourcemethoddepolarize2_impl¶source
ppvm_tableau::tableau_like::TableauLike::depolarize2_impl
Signature
fn depolarize2_impl(&mut self, addr0: usize, addr1: usize, p: <Self as >::Coeff)Parameters
| Name | Type | Description |
|---|---|---|
addr0 | usize | |
addr1 | usize | |
p | <Self as >::Coeff |
Two-qubit depolarizing channel: spreads `p` over the 15 non-identity two-qubit Pauli errors.
sourcemethoddepolarize_impl¶source
ppvm_tableau::tableau_like::TableauLike::depolarize_impl
fn depolarize_impl(&mut self, addr0: usize, p: <Self as >::Coeff)Parameters
| Name | Type | Description |
|---|---|---|
addr0 | usize | |
p | <Self as >::Coeff |
Single-qubit depolarizing channel.
RNG is consumed unconditionally; the selected Clifford gate is expected to no-op on lost qubits. This preserves seeded RNG sequences across loss events.
sourcemethodis_qubit_lost¶source
ppvm_tableau::tableau_like::TableauLike::is_qubit_lost
fn is_qubit_lost(&self, _addr: usize) -> boolParameters
| Name | Type | Description |
|---|---|---|
_addr | usize |
Returns
bool
Whether the qubit at `addr` is lost. Default: never lost.
sourcemethodpauli_error_impl¶source
ppvm_tableau::tableau_like::TableauLike::pauli_error_impl
fn pauli_error_impl(&mut self, addr0: usize, p: [<Self as >::Coeff; 3])Parameters
| Name | Type | Description |
|---|---|---|
addr0 | usize | |
p | [<Self as >::Coeff; 3] |
Single-qubit Pauli-error channel (X, Y, Z with given probabilities).
RNG is consumed unconditionally; the selected Clifford gate is expected to no-op on lost qubits. This preserves seeded RNG sequences across loss events.
sourcemethodrng_mut¶source
ppvm_tableau::tableau_like::TableauLike::rng_mut
fn rng_mut(&mut self) -> &mut <Self as >::RngReturns
&mut <Self as >::Rng
Mutable access to the backend’s RNG.
sourcemethodtwo_qubit_pauli_error_impl¶source
ppvm_tableau::tableau_like::TableauLike::two_qubit_pauli_error_impl
Signature
fn two_qubit_pauli_error_impl(&mut self, addr0: usize, addr1: usize, p: [<Self as >::Coeff; 15])Parameters
| Name | Type | Description |
|---|---|---|
addr0 | usize | |
addr1 | usize | |
p | [<Self as >::Coeff; 15] |
Two-qubit Pauli-error channel (15 non-identity Pauli combinations).
source