Skip to main content

BasisProjector

Struct BasisProjector 

Source
pub struct BasisProjector { /* private fields */ }
Expand description

Sparse isometric lift from a symmetry-reduced basis to its parent basis.

Implementations§

Source§

impl BasisProjector

Source

pub fn from_operator( projector: &(impl LinearOperator + ?Sized), tolerance: f64, ) -> Result<Self>

Convert any explicit rectangular isometry into a reusable basis projector.

This is the narrow waist for reduced spaces whose columns are not representable by a one-dimensional orbit character, including higher-dimensional finite-group representations.

Source

pub fn from_embedding<Reduced, Parent>( reduced: &Reduced, parent: &Parent, ) -> Result<Self>
where Reduced: Basis, Parent: Basis<State = Reduced::State>,

One-hot embedding of a selected basis into a compatible parent basis.

Source

pub fn between<Reduced, Parent>( reduced: &Reduced, parent: &Parent, ) -> Result<Self>
where Reduced: Basis, Parent: Basis<State = Reduced::State>,

Isometric lift from any basis into an explicitly selected parent basis.

The reduced basis owns the symmetry-reduction convention through Basis::reduction_image. Iterating the explicit parent states makes this equally useful for built-in and runtime symmetry sectors, fixed particle subspaces, and unrestricted parent spaces.

Source

pub fn from_general<Parent>(basis: &GeneralBasis<Parent>) -> Result<Self>
where Parent: Basis, Parent::State: Hash + Ord + 'static,

Source

pub const fn source_dimension(&self) -> usize

Source

pub const fn reduced_dimension(&self) -> usize

Source

pub fn project( &self, parent: &[Complex64], reduced: &mut [Complex64], ) -> Result<()>

Apply the adjoint projector to a parent-space vector.

Source

pub fn lifted(&self, reduced: &[Complex64]) -> Result<Vec<Complex64>>

Source

pub fn projected(&self, parent: &[Complex64]) -> Result<Vec<Complex64>>

Source

pub fn lift_batch( &self, reduced: &[Vec<Complex64>], ) -> Result<Vec<Vec<Complex64>>>

Source

pub fn project_batch( &self, parent: &[Vec<Complex64>], ) -> Result<Vec<Vec<Complex64>>>

Source

pub fn lift_density(&self, reduced: &[Complex64]) -> Result<Vec<Complex64>>

Lift a row-major reduced density matrix as P ρ P†.

Source

pub fn symmetry_leakage_norm( &self, operator: &(impl LinearOperator + ?Sized), ) -> Result<f64>

Frobenius norm of (I - P P†) A P, evaluated one reduced column at a time. Zero means the parent-space operator preserves this symmetry sector; no parent-space square projector is formed.

Source

pub fn preserves_operator_symmetry( &self, operator: &(impl LinearOperator + ?Sized), tolerance: f64, ) -> Result<bool>

Trait Implementations§

Source§

impl Clone for BasisProjector

Source§

fn clone(&self) -> BasisProjector

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 Debug for BasisProjector

Source§

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

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

impl LinearOperator for BasisProjector

Source§

fn shape(&self) -> (usize, usize)

Return (rows, columns).
Source§

fn format(&self) -> MatrixFormat

Report the public materialization format.
Source§

fn apply(&self, input: &[Complex64], output: &mut [Complex64]) -> Result<()>

Compute output = A * input. Read more
Source§

fn stored_triplets(&self) -> Result<Option<Vec<(usize, usize, Complex64)>>>

Return canonical stored nonzeros when the representation already owns them.
Source§

fn is_real(&self) -> bool

Whether this operator preserves real vectors exactly. Read more
Source§

fn apply_real(&self, input: &[f64], output: &mut [f64]) -> Result<()>

Apply this operator to a real vector. Read more
Source§

fn apply_transpose( &self, input: &[Complex64], output: &mut [Complex64], ) -> Result<()>

Apply the algebraic transpose without conjugating either operand. Read more
Source§

fn apply_adjoint( &self, input: &[Complex64], output: &mut [Complex64], ) -> Result<()>

Apply the conjugate transpose.
Source§

fn shifted_solver( &self, _shift: f64, ) -> Result<Option<Box<dyn ShiftedLinearSolver>>>

Prepare a reusable solver for (A - shift I) x = b, when supported.

Auto Trait Implementations§

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<O> RuntimeAdjointLinearOperator<CpuRuntime> for O
where O: LinearOperator + ?Sized,

Source§

fn apply_adjoint_on( &self, _runtime: &CpuRuntime, input: &CpuBuffer, output: &mut CpuBuffer, ) -> Result<(), QmbedError>

Compute output = A† * input in runtime-owned storage.
Source§

impl<O> RuntimeLinearOperator<CpuRuntime> for O
where O: LinearOperator + ?Sized,

Source§

fn runtime_shape(&self) -> (usize, usize)

Return (rows, columns) in runtime coordinates.
Source§

fn apply_on( &self, _runtime: &CpuRuntime, input: &CpuBuffer, output: &mut CpuBuffer, ) -> Result<(), QmbedError>

Apply this map to backend-owned buffers.
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,