pub struct SpectralDecomposition<const P: usize, const Q: usize, const R: usize> { /* private fields */ }Expand description
Spectral decomposition of a self-adjoint operator.
For a self-adjoint operator T, the spectral decomposition is: T = Σᵢ λᵢ Pᵢ
where λᵢ are eigenvalues and Pᵢ are orthogonal projections onto the corresponding eigenspaces.
Implementations§
Source§impl<const P: usize, const Q: usize, const R: usize> SpectralDecomposition<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> SpectralDecomposition<P, Q, R>
Sourcepub fn new(eigenpairs: Vec<Eigenpair<Multivector<P, Q, R>>>) -> Self
pub fn new(eigenpairs: Vec<Eigenpair<Multivector<P, Q, R>>>) -> Self
Create a new spectral decomposition from eigenpairs.
Sourcepub fn eigenpairs(&self) -> &[Eigenpair<Multivector<P, Q, R>>]
pub fn eigenpairs(&self) -> &[Eigenpair<Multivector<P, Q, R>>]
Get the eigenpairs.
Sourcepub fn eigenvalues(&self) -> Vec<Eigenvalue>
pub fn eigenvalues(&self) -> Vec<Eigenvalue>
Get the eigenvalues.
Sourcepub fn eigenvectors(&self) -> Vec<&Multivector<P, Q, R>>
pub fn eigenvectors(&self) -> Vec<&Multivector<P, Q, R>>
Get the eigenvectors.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the decomposition is complete.
Sourcepub fn apply(&self, x: &Multivector<P, Q, R>) -> Multivector<P, Q, R>
pub fn apply(&self, x: &Multivector<P, Q, R>) -> Multivector<P, Q, R>
Apply the operator T = Σᵢ λᵢ |vᵢ⟩⟨vᵢ| to a vector.
Computes Tx = Σᵢ λᵢ ⟨vᵢ, x⟩ vᵢ
Sourcepub fn apply_function<F>(
&self,
f: F,
x: &Multivector<P, Q, R>,
) -> Multivector<P, Q, R>
pub fn apply_function<F>( &self, f: F, x: &Multivector<P, Q, R>, ) -> Multivector<P, Q, R>
Apply a function f to the operator: f(T) = Σᵢ f(λᵢ) |vᵢ⟩⟨vᵢ|.
This is the functional calculus for self-adjoint operators.
Sourcepub fn spectral_radius(&self) -> f64
pub fn spectral_radius(&self) -> f64
Compute the spectral radius: max|λᵢ|.
Sourcepub fn condition_number(&self) -> Option<f64>
pub fn condition_number(&self) -> Option<f64>
Compute the condition number (ratio of largest to smallest eigenvalue magnitudes).
Sourcepub fn is_positive_definite(&self) -> bool
pub fn is_positive_definite(&self) -> bool
Check if the operator is positive definite.
Sourcepub fn is_positive_semidefinite(&self) -> bool
pub fn is_positive_semidefinite(&self) -> bool
Check if the operator is positive semi-definite.
Trait Implementations§
Source§impl<const P: usize, const Q: usize, const R: usize> Clone for SpectralDecomposition<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> Clone for SpectralDecomposition<P, Q, R>
Source§fn clone(&self) -> SpectralDecomposition<P, Q, R>
fn clone(&self) -> SpectralDecomposition<P, Q, R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more