pub struct TopologicalDevice {
pub system_type: TopologicalSystemType,
pub fusion_rules: FusionRuleSet,
pub anyons: HashMap<usize, Anyon>,
pub qubits: HashMap<usize, TopologicalQubit>,
pub capabilities: TopologicalCapabilities,
pub next_anyon_id: usize,
pub next_qubit_id: usize,
pub current_time: f64,
}Expand description
Topological quantum device implementation
Fields§
§system_type: TopologicalSystemTypeSystem configuration
fusion_rules: FusionRuleSetFusion rule set
anyons: HashMap<usize, Anyon>Current anyons in the system
qubits: HashMap<usize, TopologicalQubit>Current topological qubits
capabilities: TopologicalCapabilitiesSystem capabilities
next_anyon_id: usizeNext available IDs
next_qubit_id: usize§current_time: f64Current time (for worldline tracking)
Implementations§
Source§impl TopologicalDevice
impl TopologicalDevice
Sourcepub fn new(
system_type: TopologicalSystemType,
fusion_rules: FusionRuleSet,
capabilities: TopologicalCapabilities,
) -> Self
pub fn new( system_type: TopologicalSystemType, fusion_rules: FusionRuleSet, capabilities: TopologicalCapabilities, ) -> Self
Create a new topological quantum device
Sourcepub fn create_anyon_pair(
&mut self,
charge: TopologicalCharge,
positions: [(f64, f64); 2],
) -> TopologicalResult<(usize, usize)>
pub fn create_anyon_pair( &mut self, charge: TopologicalCharge, positions: [(f64, f64); 2], ) -> TopologicalResult<(usize, usize)>
Create a pair of anyons with opposite charges
Sourcepub fn create_topological_qubit(
&mut self,
anyon_ids: Vec<usize>,
) -> TopologicalResult<usize>
pub fn create_topological_qubit( &mut self, anyon_ids: Vec<usize>, ) -> TopologicalResult<usize>
Create a topological qubit from anyons
Sourcepub fn braid_anyons(
&mut self,
anyon1_id: usize,
anyon2_id: usize,
direction: BraidingDirection,
braid_count: usize,
) -> TopologicalResult<BraidingResult>
pub fn braid_anyons( &mut self, anyon1_id: usize, anyon2_id: usize, direction: BraidingDirection, braid_count: usize, ) -> TopologicalResult<BraidingResult>
Perform braiding operation between two anyons
Sourcepub fn fuse_anyons(
&mut self,
anyon1_id: usize,
anyon2_id: usize,
) -> TopologicalResult<Vec<String>>
pub fn fuse_anyons( &mut self, anyon1_id: usize, anyon2_id: usize, ) -> TopologicalResult<Vec<String>>
Fuse two anyons
Sourcepub fn measure_qubit(&mut self, qubit_id: usize) -> TopologicalResult<bool>
pub fn measure_qubit(&mut self, qubit_id: usize) -> TopologicalResult<bool>
Measure a topological qubit
Sourcepub fn get_system_status(&self) -> TopologicalSystemStatus
pub fn get_system_status(&self) -> TopologicalSystemStatus
Get system status
Sourcepub fn evolve(&mut self, time_step: f64) -> TopologicalResult<()>
pub fn evolve(&mut self, time_step: f64) -> TopologicalResult<()>
Simulate topological evolution
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TopologicalDevice
impl RefUnwindSafe for TopologicalDevice
impl Send for TopologicalDevice
impl Sync for TopologicalDevice
impl Unpin for TopologicalDevice
impl UnwindSafe for TopologicalDevice
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> 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.