Skip to main content

GeneralBasis

Struct GeneralBasis 

Source
pub struct GeneralBasis<Parent>
where Parent: Basis, Parent::State: Hash + Ord,
{ /* private fields */ }

Implementations§

Source§

impl<Parent> GeneralBasis<Parent>
where Parent: Basis, Parent::State: Hash + Ord,

Source

pub fn new( parent: Parent, sector: SymmetryReducer<Parent::State>, ) -> Result<Self>

Source

pub fn from_reducer( parent: Parent, reducer: SymmetryReducer<Parent::State>, ) -> Result<Self>

Materialize a reduced basis from an independently reusable reducer.

Source

pub fn from_reducer_with_ordering( parent: Parent, reducer: SymmetryReducer<Parent::State>, ordering: RepresentativeOrdering, ) -> Result<Self>

Materialize a reduced basis with an explicit canonical representative convention. The native default is the minimum state; compatibility frontends with descending basis order may select the maximum state without changing the physical symmetry subspace.

Source

pub fn from_orbit_seeds( parent: Parent, reducer: SymmetryReducer<Parent::State>, ) -> Result<Self>

Materialize symmetry vectors whose seed states come from parent.

Unlike GeneralBasis::from_reducer, the finite symmetry orbit may contain states outside the parent’s enumerated constraint. The parent still supplies the local operator algebra, while its state list selects which physical orbits enter the reduced space. This is the natural construction for particle-hole or species-exchange symmetries acting on a fixed additive sector: one seed sector selects an orbit, and the normalized reduced vector contains the complete symmetry orbit.

The parent’s local action must therefore be defined for every state generated by the reducer. Built-in packed bases and callback bases satisfy this contract because local actions operate on the encoded state rather than its row index.

Source

pub fn from_orbit_seeds_with_ordering( parent: Parent, reducer: SymmetryReducer<Parent::State>, ordering: RepresentativeOrdering, ) -> Result<Self>

Source

pub fn parent(&self) -> &Parent

Source

pub const fn reducer(&self) -> &SymmetryReducer<Parent::State>

Source

pub fn representative(&self, state: Parent::State) -> Result<Parent::State>

Source

pub fn orbit_size(&self, state: Parent::State) -> Result<usize>

Source

pub fn symmetry_amplitude(&self, state: Parent::State) -> Result<Complex64>

Normalized coefficient of a parent state in its reduced representative.

Trait Implementations§

Source§

impl<Parent> Basis for GeneralBasis<Parent>
where Parent: Basis, Parent::State: Hash + Ord + 'static,

Source§

type State = <Parent as Basis>::State

Integer-like state representation used by this basis.
Source§

fn len(&self) -> usize

Return the number of vectors in the basis.
Source§

fn state(&self, index: usize) -> Result<Self::State>

Return the encoded state at a basis index. Read more
Source§

fn index(&self, state: Self::State) -> Result<usize>

Locate an encoded state in the basis.
Source§

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>>

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>>

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<()>
where F: FnMut(Self::State, Complex64) -> Result<()>,

Streams unreduced destinations directly to a consumer. Read more
Source§

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>>>

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)>>

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)>>

Reduces a physical target and locates its row in one operation. Read more
Source§

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 operator_preserves_particle_sector_on_sites( &self, operator: &str, sites: &[usize], ) -> Result<bool>

Site-aware particle-sector check for bases whose local labels encode species as well as position. Read more
Source§

fn is_empty(&self) -> bool

Return whether the basis contains no vectors.
Source§

impl<Parent> Clone for GeneralBasis<Parent>
where Parent: Basis + Clone, Parent::State: Hash + Ord + Clone,

Source§

fn clone(&self) -> GeneralBasis<Parent>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Parent> Debug for GeneralBasis<Parent>
where Parent: Basis + Debug, Parent::State: Hash + Ord + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<GeneralBasis<BosonBasis1D>> for PackedBasis

Source§

fn from(basis: BosonBasisGeneral) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<SpinBasis1D>> for PackedBasis

Source§

fn from(basis: SpinBasisGeneral) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<SpinfulFermionBasis1D>> for PackedBasis

Source§

fn from(basis: SpinfulFermionBasisGeneral) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<SpinlessFermionBasis1D>> for PackedBasis

Source§

fn from(basis: SpinlessFermionBasisGeneral) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<UserBasis<u128>>> for PackedBasis

Source§

fn from(basis: UserBasisGeneral) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<WideSpinBasis<16>>> for WidePackedBasis

Source§

fn from(basis: WideSpinBasisGeneral1024) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<WideSpinBasis<256>>> for WidePackedBasis

Source§

fn from(basis: WideSpinBasisGeneral16384) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<WideSpinBasis<4>>> for WidePackedBasis

Source§

fn from(basis: WideSpinBasisGeneral256) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralBasis<WideSpinBasis<64>>> for WidePackedBasis

Source§

fn from(basis: WideSpinBasisGeneral4096) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<Parent> Freeze for GeneralBasis<Parent>
where Parent: Freeze,

§

impl<Parent> !RefUnwindSafe for GeneralBasis<Parent>

§

impl<Parent> Send for GeneralBasis<Parent>

§

impl<Parent> Sync for GeneralBasis<Parent>

§

impl<Parent> Unpin for GeneralBasis<Parent>
where Parent: Unpin, <Parent as Basis>::State: Unpin,

§

impl<Parent> UnsafeUnpin for GeneralBasis<Parent>
where Parent: UnsafeUnpin,

§

impl<Parent> !UnwindSafe for GeneralBasis<Parent>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,