pub struct GadgetType {Show 15 fields
pub gtype: u64,
pub name: String,
pub description: String,
pub measurements: Vec<Measurement>,
pub inputs: Vec<Port>,
pub outputs: Vec<Port>,
pub correction_propagation: Option<BitMatrix>,
pub readouts: Vec<Readout>,
pub readout_propagation: Option<BitMatrix>,
pub logical_correction: Option<BitMatrix>,
pub physical_correction: Option<BitMatrix>,
pub mesh: Vec<Mesh>,
pub realization: Option<Realization>,
pub is_free_hop: Option<bool>,
pub loss_model: Option<LossModel>,
}Fields§
§gtype: u64globally unique id of the gadget type
name: String§description: String§measurements: Vec<Measurement>§inputs: Vec<Port>§outputs: Vec<Port>§correction_propagation: Option<BitMatrix>mapping from input logical observable corrections to the output logical observable correction: size = |output_observables| rows x |input_observables|+1 columns (the last column is for the constant term) the constant term is usually zero, except for a gadget that applies a virtual logical Pauli gate (no physical gates but only change the correction propagation)
readouts: Vec<Readout>§readout_propagation: Option<BitMatrix>mapping from input logical observables to the logical readouts size = |readouts| rows x |input_observables|+1 columns (the last column is for the constant term)
logical_correction: Option<BitMatrix>mapping from logical readouts to output observables (feed-forward Pauli) size = |output_observables| rows x |readouts| columns formerly named “conditional_correction”
physical_correction: Option<BitMatrix>mapping from internal measurements to output observable corrections size = |output_observables| rows x |measurements| columns This encodes how physical measurement outcomes update the Pauli frame, capturing destabilizer contributions from preparation gadgets
mesh: Vec<Mesh>the mesh of the gadget object (not individual gate but the outline)
realization: Option<Realization>§is_free_hop: Option<bool>Whether this gadget type counts as a “free hop” for window decoding. Free-hop gadgets contribute 0 to the hop distance during window exploration. When not set, the value is determined by whether the gadget has physical measurements (is_free_hop = measurements is empty). When set explicitly, the user-provided value is used.
loss_model: Option<LossModel>Implementations§
Source§impl GadgetType
impl GadgetType
Sourcepub fn is_free_hop(&self) -> bool
pub fn is_free_hop(&self) -> bool
Returns the value of is_free_hop, or the default value if is_free_hop is unset.
Trait Implementations§
Source§impl Clone for GadgetType
impl Clone for GadgetType
Source§impl Debug for GadgetType
impl Debug for GadgetType
Source§impl Default for GadgetType
impl Default for GadgetType
Source§impl Message for GadgetType
impl Message for GadgetType
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for GadgetType
impl PartialEq for GadgetType
impl StructuralPartialEq for GadgetType
Auto Trait Implementations§
impl Forget for GadgetType
impl Freeze for GadgetType
impl Move for GadgetType
impl RefUnwindSafe for GadgetType
impl Send for GadgetType
impl Sync for GadgetType
impl Unpin for GadgetType
impl UnsafeUnpin for GadgetType
impl UnwindSafe for GadgetType
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request