pub struct ScheduledSwapStep<V, Id>{
pub transport_path: Vec<V>,
pub node_a: V,
pub node_b: V,
pub a_side_sites: HashSet<Id>,
pub b_side_sites: HashSet<Id>,
}Expand description
A single two-site update step in a pre-computed swap schedule.
Use this to inspect exactly which edge is updated, whether the canonical center must be transported first, and which site indices must end up on each side of the edge after the local factorization.
Related types:
SwapSchedulestores the full ordered sequence of these steps.SwapOptionscontrols truncation only during execution, not schedule construction.
§Examples
use std::collections::HashSet;
use tensor4all_treetn::ScheduledSwapStep;
let step = ScheduledSwapStep {
transport_path: vec!["L0".to_string(), "C".to_string()],
node_a: "C".to_string(),
node_b: "L1".to_string(),
a_side_sites: HashSet::from(["s1".to_string()]),
b_side_sites: HashSet::from(["s0".to_string()]),
};
assert_eq!(step.transport_path, vec!["L0".to_string(), "C".to_string()]);
assert!(step.a_side_sites.contains("s1"));
assert!(step.b_side_sites.contains("s0"));Fields§
§transport_path: Vec<V>Path to transport the canonical center before the swap.
Empty when the center is already at node_a or node_b.
Otherwise this is [current_center, ..., node_a].
node_a: VThe first node in the directed sweep edge.
node_b: VThe second node in the directed sweep edge.
a_side_sites: HashSet<Id>Site index IDs that should live on node_a’s side after this step.
b_side_sites: HashSet<Id>Site index IDs that should live on node_b’s side after this step.
Trait Implementations§
Source§impl<V: Clone, Id> Clone for ScheduledSwapStep<V, Id>
impl<V: Clone, Id> Clone for ScheduledSwapStep<V, Id>
Source§fn clone(&self) -> ScheduledSwapStep<V, Id>
fn clone(&self) -> ScheduledSwapStep<V, Id>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug, Id> Debug for ScheduledSwapStep<V, Id>
impl<V: Debug, Id> Debug for ScheduledSwapStep<V, Id>
Source§impl<V: PartialEq, Id> PartialEq for ScheduledSwapStep<V, Id>
impl<V: PartialEq, Id> PartialEq for ScheduledSwapStep<V, Id>
impl<V: Eq, Id> Eq for ScheduledSwapStep<V, Id>
impl<V, Id> StructuralPartialEq for ScheduledSwapStep<V, Id>
Auto Trait Implementations§
impl<V, Id> Freeze for ScheduledSwapStep<V, Id>where
V: Freeze,
impl<V, Id> RefUnwindSafe for ScheduledSwapStep<V, Id>where
V: RefUnwindSafe,
Id: RefUnwindSafe,
impl<V, Id> Send for ScheduledSwapStep<V, Id>
impl<V, Id> Sync for ScheduledSwapStep<V, Id>
impl<V, Id> Unpin for ScheduledSwapStep<V, Id>
impl<V, Id> UnsafeUnpin for ScheduledSwapStep<V, Id>where
V: UnsafeUnpin,
impl<V, Id> UnwindSafe for ScheduledSwapStep<V, Id>where
V: UnwindSafe,
Id: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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