pub struct SimulatorNode {
pub qubit_type: QubitType,
pub gate_type: GateType,
pub gate_peer: Option<Arc<Position>>,
pub error: ErrorType,
pub has_erasure: bool,
pub propagated: ErrorType,
pub is_virtual: bool,
pub is_peer_virtual: bool,
pub miscellaneous: Option<Arc<Value>>,
}Expand description
each node represents a location [i][j] at a specific time point [t], this location has some probability of having Pauli error or erasure error.
we could have single-qubit or two-qubit gate in a node, and errors are added after applying this gate (e.g. if the gate is measurement, then
errors at this node will have no impact on the measurement because errors are applied after the measurement).
we also maintain “virtual nodes” at the boundary of a code, these virtual nodes are missing stabilizers at the boundary of a open-boundary surface code.
Fields§
§qubit_type: QubitType§gate_type: GateTypesingle-qubit or two-qubit gate applied
gate_peer: Option<Arc<Position>>§error: ErrorTypesimulation data
has_erasure: bool§propagated: ErrorType§is_virtual: boolVirtual qubit doesn’t physically exist, which means they will never have errors themselves. Real qubit errors can propagate to virtual qubits, but errors will never propagate to real qubits. Virtual qubits can be understood as perfect stabilizers that only absorb propagated errors and never propagate them. They’re useful in tailored surface code decoding, and also to represent virtual boundaries
is_peer_virtual: bool§miscellaneous: Option<Arc<Value>>miscellaneous information, should be static, e.g. decoding assistance information
Implementations§
Source§impl SimulatorNode
impl SimulatorNode
Sourcepub fn new(
qubit_type: QubitType,
gate_type: GateType,
gate_peer: Option<Position>,
) -> Self
pub fn new( qubit_type: QubitType, gate_type: GateType, gate_peer: Option<Position>, ) -> Self
create a new simulator node
pub fn set_gate_peer(&mut self, pos: Position)
pub fn get_gate_peer(&self) -> Position
pub fn set_error_temp(&mut self, error: &ErrorType)
Source§impl SimulatorNode
impl SimulatorNode
Sourcepub fn set_virtual(self, is_virtual: bool, is_peer_virtual: bool) -> Self
pub fn set_virtual(self, is_virtual: bool, is_peer_virtual: bool) -> Self
quick initialization function to set virtual bits (if there is any)
Sourcepub fn with_miscellaneous(self, miscellaneous: Option<Value>) -> Self
pub fn with_miscellaneous(self, miscellaneous: Option<Value>) -> Self
quick initialization to set miscellaneous information
Trait Implementations§
Source§impl Clone for SimulatorNode
impl Clone for SimulatorNode
Source§fn clone(&self) -> SimulatorNode
fn clone(&self) -> SimulatorNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SimulatorNode
impl Debug for SimulatorNode
Source§impl Display for SimulatorNode
impl Display for SimulatorNode
Auto Trait Implementations§
impl Freeze for SimulatorNode
impl RefUnwindSafe for SimulatorNode
impl Send for SimulatorNode
impl Sync for SimulatorNode
impl Unpin for SimulatorNode
impl UnwindSafe for SimulatorNode
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 more