pub struct GraphBuilder { /* private fields */ }Expand description
Builder for constructing detector graphs
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn from_surface_code(distance: usize) -> Self
pub fn from_surface_code(distance: usize) -> Self
Create a builder for a surface code of given distance
Sourcepub fn with_syndrome(self, syndrome: &[bool]) -> Result<Self>
pub fn with_syndrome(self, syndrome: &[bool]) -> Result<Self>
Set the syndrome bitmap
Sourcepub fn with_node_pattern(self, pattern: NodeTypePattern) -> Self
pub fn with_node_pattern(self, pattern: NodeTypePattern) -> Self
Set the node type pattern
Sourcepub fn with_error_rate(self, rate: f64) -> Self
pub fn with_error_rate(self, rate: f64) -> Self
Set the error rate (for edge weights)
Sourcepub fn build(self) -> Result<DetectorGraph>
pub fn build(self) -> Result<DetectorGraph>
Build the detector graph
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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
Mutably borrows from an owned value. Read more
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>
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 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>
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