pub enum PackedBasis {
Spin(SpinBasis1D),
Boson(BosonBasis1D),
SpinlessFermion(SpinlessFermionBasis1D),
SpinfulFermion(SpinfulFermionBasis1D),
GeneralSpin(SpinBasisGeneral),
GeneralBoson(BosonBasisGeneral),
GeneralSpinlessFermion(SpinlessFermionBasisGeneral),
GeneralSpinfulFermion(SpinfulFermionBasisGeneral),
Tensor(Box<PackedTensorBasis>),
Photon(Box<PackedPhotonBasis>),
User(Box<UserBasisGeneral>),
Reversed(Box<PackedBasis>),
}Variants§
Spin(SpinBasis1D)
Boson(BosonBasis1D)
SpinlessFermion(SpinlessFermionBasis1D)
SpinfulFermion(SpinfulFermionBasis1D)
GeneralSpin(SpinBasisGeneral)
GeneralBoson(BosonBasisGeneral)
GeneralSpinlessFermion(SpinlessFermionBasisGeneral)
GeneralSpinfulFermion(SpinfulFermionBasisGeneral)
Tensor(Box<PackedTensorBasis>)
Photon(Box<PackedPhotonBasis>)
User(Box<UserBasisGeneral>)
Reversed(Box<PackedBasis>)
Implementations§
Source§impl PackedBasis
impl PackedBasis
Sourcepub fn reversed(self) -> Self
pub fn reversed(self) -> Self
Reverse the public basis-vector order without changing physical states.
This is a general permutation view: state, index, transition row
lookup, and universal operator assembly all observe the same order.
Sourcepub fn additive_quantum_number(&self, state: u128) -> Result<usize>
pub fn additive_quantum_number(&self, state: u128) -> Result<usize>
Additive occupation/excitation quantum number of a concrete state.
This is the runtime-selected counterpart of the typed sector metadata
used by concrete bases. Composite bases sum their factor quantum
numbers, so consumers such as PackedPhotonBasis do not need to
special-case spin, boson, or fermion encodings.
Trait Implementations§
Source§impl Basis for PackedBasis
impl Basis for PackedBasis
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 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§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§impl Clone for PackedBasis
impl Clone for PackedBasis
Source§fn clone(&self) -> PackedBasis
fn clone(&self) -> PackedBasis
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 Debug for PackedBasis
impl Debug for PackedBasis
Source§impl From<BosonBasis1D> for PackedBasis
impl From<BosonBasis1D> for PackedBasis
Source§fn from(basis: BosonBasis1D) -> Self
fn from(basis: BosonBasis1D) -> Self
Converts to this type from the input type.
Source§impl From<GeneralBasis<BosonBasis1D>> for PackedBasis
impl From<GeneralBasis<BosonBasis1D>> for PackedBasis
Source§fn from(basis: BosonBasisGeneral) -> Self
fn from(basis: BosonBasisGeneral) -> Self
Converts to this type from the input type.
Source§impl From<GeneralBasis<SpinBasis1D>> for PackedBasis
impl From<GeneralBasis<SpinBasis1D>> for PackedBasis
Source§fn from(basis: SpinBasisGeneral) -> Self
fn from(basis: SpinBasisGeneral) -> Self
Converts to this type from the input type.
Source§impl From<GeneralBasis<SpinfulFermionBasis1D>> for PackedBasis
impl From<GeneralBasis<SpinfulFermionBasis1D>> for PackedBasis
Source§fn from(basis: SpinfulFermionBasisGeneral) -> Self
fn from(basis: SpinfulFermionBasisGeneral) -> Self
Converts to this type from the input type.
Source§impl From<GeneralBasis<SpinlessFermionBasis1D>> for PackedBasis
impl From<GeneralBasis<SpinlessFermionBasis1D>> for PackedBasis
Source§fn from(basis: SpinlessFermionBasisGeneral) -> Self
fn from(basis: SpinlessFermionBasisGeneral) -> Self
Converts to this type from the input type.
Source§impl From<GeneralBasis<UserBasis<u128>>> for PackedBasis
impl From<GeneralBasis<UserBasis<u128>>> for PackedBasis
Source§fn from(basis: UserBasisGeneral) -> Self
fn from(basis: UserBasisGeneral) -> Self
Converts to this type from the input type.
Source§impl From<PackedPhotonBasis> for PackedBasis
impl From<PackedPhotonBasis> for PackedBasis
Source§fn from(basis: PackedPhotonBasis) -> Self
fn from(basis: PackedPhotonBasis) -> Self
Converts to this type from the input type.
Source§impl From<PackedTensorBasis> for PackedBasis
impl From<PackedTensorBasis> for PackedBasis
Source§fn from(basis: PackedTensorBasis) -> Self
fn from(basis: PackedTensorBasis) -> Self
Converts to this type from the input type.
Source§impl From<SpinBasis1D> for PackedBasis
impl From<SpinBasis1D> for PackedBasis
Source§fn from(basis: SpinBasis1D) -> Self
fn from(basis: SpinBasis1D) -> Self
Converts to this type from the input type.
Source§impl From<SpinfulFermionBasis1D> for PackedBasis
impl From<SpinfulFermionBasis1D> for PackedBasis
Source§fn from(basis: SpinfulFermionBasis1D) -> Self
fn from(basis: SpinfulFermionBasis1D) -> Self
Converts to this type from the input type.
Source§impl From<SpinlessFermionBasis1D> for PackedBasis
impl From<SpinlessFermionBasis1D> for PackedBasis
Source§fn from(basis: SpinlessFermionBasis1D) -> Self
fn from(basis: SpinlessFermionBasis1D) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PackedBasis
impl !RefUnwindSafe for PackedBasis
impl Send for PackedBasis
impl Sync for PackedBasis
impl Unpin for PackedBasis
impl UnsafeUnpin for PackedBasis
impl !UnwindSafe for PackedBasis
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.