PhenomenologicalRotatedCode

Struct PhenomenologicalRotatedCode 

Source
pub struct PhenomenologicalRotatedCode {
    pub vertices: Vec<CodeVertex>,
    pub edges: Vec<CodeEdge>,
}
Expand description

CSS surface code (the rotated one) with X-type stabilizers

Fields§

§vertices: Vec<CodeVertex>

vertices in the code

§edges: Vec<CodeEdge>

nearest-neighbor edges in the decoding graph

Implementations§

Source§

impl PhenomenologicalRotatedCode

Source

pub fn new( d: VertexNum, noisy_measurements: VertexNum, p: f64, max_half_weight: Weight, ) -> Self

Source

pub fn create_code(d: VertexNum, noisy_measurements: VertexNum) -> Self

Trait Implementations§

Source§

impl Clone for PhenomenologicalRotatedCode

Source§

fn clone(&self) -> PhenomenologicalRotatedCode

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PhenomenologicalRotatedCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ExampleCode for PhenomenologicalRotatedCode

Source§

fn vertices_edges(&mut self) -> (&mut Vec<CodeVertex>, &mut Vec<CodeEdge>)

get mutable references to vertices and edges
Source§

fn immutable_vertices_edges(&self) -> (&Vec<CodeVertex>, &Vec<CodeEdge>)

Source§

fn vertex_num(&self) -> VertexNum

get the number of vertices
Source§

fn compute_weights(&mut self, max_half_weight: Weight)

generic method that automatically computes integer weights from probabilities, scales such that the maximum integer weight is 10000 and the minimum is 1
Source§

fn sanity_check(&self) -> Result<(), String>

sanity check to avoid duplicate edges that are hard to debug
Source§

fn set_probability(&mut self, p: f64)

set probability of all edges; user can set individual probabilities
Source§

fn set_erasure_probability(&mut self, pe: f64)

set erasure probability of all edges; user can set individual probabilities
Source§

fn fill_vertices(&mut self, vertex_num: VertexNum)

automatically create vertices given edges
Source§

fn get_positions(&self) -> Vec<VisualizePosition>

gather all positions of vertices
Source§

fn get_initializer(&self) -> SolverInitializer

generate standard interface to instantiate Fusion blossom solver
Source§

fn set_defect_vertices(&mut self, defect_vertices: &[VertexIndex])

set defect vertices (non-trivial measurement result in case of single round of measurement, or different result from the previous round in case of multiple rounds of measurement)
Source§

fn set_erasures(&mut self, erasures: &[EdgeIndex])

set erasure edges
Source§

fn set_syndrome(&mut self, syndrome_pattern: &SyndromePattern)

set syndrome
Source§

fn get_defect_vertices(&self) -> Vec<VertexIndex>

get current defect vertices
Source§

fn get_erasures(&self) -> Vec<EdgeIndex>

get current erasure edges
Source§

fn get_syndrome(&self) -> SyndromePattern

get current syndrome
Source§

fn generate_random_errors(&mut self, seed: u64) -> SyndromePattern

generate random errors based on the edge probabilities and a seed for pseudo number generator
Source§

fn generate_errors(&mut self, edge_indices: &[EdgeIndex]) -> SyndromePattern

Source§

fn clear_errors(&mut self)

Source§

fn is_virtual(&self, vertex_idx: usize) -> bool

Source§

fn is_defect(&self, vertex_idx: usize) -> bool

Source§

fn reorder_vertices(&mut self, sequential_vertices: &[VertexIndex])

reorder the vertices such that new vertices (the indices of the old order) is sequential

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FusionVisualizer for T
where T: ExampleCode,

Source§

fn snapshot(&self, abbrev: bool) -> Value

take a snapshot, set abbrev to true to save space
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V