pub struct WideSpinBasis<const WORDS: usize> { /* private fields */ }Expand description
Spin-half basis backed by a fixed-width state, including sites above 127.
Implementations§
Source§impl<const WORDS: usize> WideSpinBasis<WORDS>
impl<const WORDS: usize> WideSpinBasis<WORDS>
pub fn new(sites: usize, particles: Option<usize>, pauli: bool) -> Result<Self>
Sourcepub fn from_particle_sectors(
sites: usize,
sectors: impl IntoIterator<Item = usize>,
pauli: bool,
) -> Result<Self>
pub fn from_particle_sectors( sites: usize, sectors: impl IntoIterator<Item = usize>, pauli: bool, ) -> Result<Self>
Construct a wide basis from a nonempty union of fixed-particle sectors.
pub fn with_normalization( sites: usize, particles: Option<usize>, normalization: SpinNormalization, ) -> Result<Self>
pub fn from_particle_sectors_with_normalization( sites: usize, sectors: impl IntoIterator<Item = usize>, normalization: SpinNormalization, ) -> Result<Self>
Sourcepub fn from_explicit_states_with_normalization(
sites: usize,
states: impl IntoIterator<Item = WideState<WORDS>>,
normalization: SpinNormalization,
) -> Result<Self>
pub fn from_explicit_states_with_normalization( sites: usize, states: impl IntoIterator<Item = WideState<WORDS>>, normalization: SpinNormalization, ) -> Result<Self>
Construct the same spin algebra on an explicitly selected physical state set.
This is useful for finite-group orbit completions whose physical span
is enumerable even when the unrestricted 2^sites parent is not. The
selected states remain an ordinary basis: local actions leaving the set
are rejected by assembly in exactly the same way as any sector basis.
pub const fn sites(&self) -> usize
pub fn particles(&self) -> Option<usize>
pub fn particle_sectors(&self) -> Option<&[usize]>
pub const fn normalization(&self) -> SpinNormalization
Trait Implementations§
Source§impl<const WORDS: usize> Basis for WideSpinBasis<WORDS>
impl<const WORDS: usize> Basis for WideSpinBasis<WORDS>
Source§fn state(&self, index: usize) -> Result<Self::State>
fn state(&self, index: usize) -> Result<Self::State>
Return the encoded state at a basis index. Read more
Source§fn apply_local(
&self,
state: Self::State,
operator: &str,
sites: &[usize],
) -> Result<Option<(Self::State, Complex64)>>
fn apply_local( &self, state: Self::State, operator: &str, sites: &[usize], ) -> Result<Option<(Self::State, Complex64)>>
Apply one local operator string to one encoded state. Read more
Source§fn operator_preserves_particle_sector(&self, operator: &str) -> Result<bool>
fn operator_preserves_particle_sector(&self, operator: &str) -> Result<bool>
Whether a local operator string preserves the particle-sector
constraints represented by this basis. Unconstrained and custom bases
accept every syntactically valid string by default.
Source§fn apply_local_transitions(
&self,
state: Self::State,
operator: &str,
sites: &[usize],
) -> Result<LocalTransitions<Self::State>>
fn apply_local_transitions( &self, state: Self::State, operator: &str, sites: &[usize], ) -> Result<LocalTransitions<Self::State>>
Applies a local operator and returns every nonzero destination. Read more
Source§fn apply_local_unreduced_transitions(
&self,
state: Self::State,
operator: &str,
sites: &[usize],
) -> Result<LocalTransitions<Self::State>>
fn apply_local_unreduced_transitions( &self, state: Self::State, operator: &str, sites: &[usize], ) -> Result<LocalTransitions<Self::State>>
Local action before symmetry-sector reduction. Cross-sector builders
use this path and let the target basis perform the reduction.
Source§fn visit_local_unreduced_transitions<F>(
&self,
state: Self::State,
operator: &str,
sites: &[usize],
visit: F,
) -> Result<()>
fn visit_local_unreduced_transitions<F>( &self, state: Self::State, operator: &str, sites: &[usize], visit: F, ) -> Result<()>
Streams unreduced destinations directly to a consumer. Read more
Source§fn transition_orbit_size(&self, _state: Self::State) -> Result<usize>
fn transition_orbit_size(&self, _state: Self::State) -> Result<usize>
Orbit size of a canonical source state used in projector normalization.
Source§fn reduction_image(
&self,
state: Self::State,
) -> Result<Option<ReductionImage<Self::State>>>
fn reduction_image( &self, state: Self::State, ) -> Result<Option<ReductionImage<Self::State>>>
Return the canonical reduction metadata for a physical state. Read more
Source§fn reduce_transition(
&self,
state: Self::State,
source_orbit_size: usize,
) -> Result<Option<(Self::State, Complex64)>>
fn reduce_transition( &self, state: Self::State, source_orbit_size: usize, ) -> Result<Option<(Self::State, Complex64)>>
Map an unreduced physical target state into this basis.
Source§fn index_transition(
&self,
state: Self::State,
source_orbit_size: usize,
) -> Result<Option<(usize, Complex64)>>
fn index_transition( &self, state: Self::State, source_orbit_size: usize, ) -> Result<Option<(usize, Complex64)>>
Reduces a physical target and locates its row in one operation. Read more
Source§impl<const WORDS: usize> Clone for WideSpinBasis<WORDS>
impl<const WORDS: usize> Clone for WideSpinBasis<WORDS>
Source§fn clone(&self) -> WideSpinBasis<WORDS>
fn clone(&self) -> WideSpinBasis<WORDS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const WORDS: usize> Debug for WideSpinBasis<WORDS>
impl<const WORDS: usize> Debug for WideSpinBasis<WORDS>
Source§impl From<WideSpinBasis<16>> for WidePackedBasis
impl From<WideSpinBasis<16>> for WidePackedBasis
Source§fn from(basis: WideSpinBasis1024) -> Self
fn from(basis: WideSpinBasis1024) -> Self
Converts to this type from the input type.
Source§impl From<WideSpinBasis<256>> for WidePackedBasis
impl From<WideSpinBasis<256>> for WidePackedBasis
Source§fn from(basis: WideSpinBasis16384) -> Self
fn from(basis: WideSpinBasis16384) -> Self
Converts to this type from the input type.
Source§impl From<WideSpinBasis<4>> for WidePackedBasis
impl From<WideSpinBasis<4>> for WidePackedBasis
Source§fn from(basis: WideSpinBasis256) -> Self
fn from(basis: WideSpinBasis256) -> Self
Converts to this type from the input type.
Source§impl From<WideSpinBasis<64>> for WidePackedBasis
impl From<WideSpinBasis<64>> for WidePackedBasis
Source§fn from(basis: WideSpinBasis4096) -> Self
fn from(basis: WideSpinBasis4096) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<const WORDS: usize> Freeze for WideSpinBasis<WORDS>
impl<const WORDS: usize> RefUnwindSafe for WideSpinBasis<WORDS>
impl<const WORDS: usize> Send for WideSpinBasis<WORDS>
impl<const WORDS: usize> Sync for WideSpinBasis<WORDS>
impl<const WORDS: usize> Unpin for WideSpinBasis<WORDS>
impl<const WORDS: usize> UnsafeUnpin for WideSpinBasis<WORDS>
impl<const WORDS: usize> UnwindSafe for WideSpinBasis<WORDS>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.