pub struct SpectralMeasure {
pub eigenvalues: Vec<f64>,
pub projector_vectors: Vec<Vec<f64>>,
pub dim: usize,
}Expand description
A simplified spectral measure (discrete version for finite matrices).
Fields§
§eigenvalues: Vec<f64>Eigenvalues (the support of the spectral measure).
projector_vectors: Vec<Vec<f64>>Spectral projections as rank-1 projectors (encoded as outer products of eigenvectors).
dim: usizeDimension of the space.
Implementations§
Source§impl SpectralMeasure
impl SpectralMeasure
Sourcepub fn diagonal(eigenvalues: Vec<f64>) -> Self
pub fn diagonal(eigenvalues: Vec<f64>) -> Self
Creates a spectral measure from eigenvalues (diagonal matrix case).
Sourcepub fn apply_function<F: Fn(f64) -> f64>(&self, f: F) -> Vec<f64>
pub fn apply_function<F: Fn(f64) -> f64>(&self, f: F) -> Vec<f64>
Applies a Borel function f to the operator via functional calculus. Returns the eigenvalues of f(A).
Sourcepub fn trace_of_function<F: Fn(f64) -> f64>(&self, f: F) -> f64
pub fn trace_of_function<F: Fn(f64) -> f64>(&self, f: F) -> f64
Computes trace(f(A)) = sum f(λ_i).
Sourcepub fn spectral_radius(&self) -> f64
pub fn spectral_radius(&self) -> f64
Computes the spectral radius.
Sourcepub fn operator_norm(&self) -> f64
pub fn operator_norm(&self) -> f64
Computes the operator norm (largest |λ|).
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Checks if the operator is positive (all eigenvalues >= 0).
Sourcepub fn is_positive_definite(&self) -> bool
pub fn is_positive_definite(&self) -> bool
Checks if the operator is positive definite (all eigenvalues > 0).
Sourcepub fn sqrt_eigenvalues(&self) -> Option<Vec<f64>>
pub fn sqrt_eigenvalues(&self) -> Option<Vec<f64>>
Computes the square root of a positive operator.
Sourcepub fn exp_eigenvalues(&self) -> Vec<f64>
pub fn exp_eigenvalues(&self) -> Vec<f64>
Computes the exponential exp(A) eigenvalues.
Sourcepub fn log_eigenvalues(&self) -> Option<Vec<f64>>
pub fn log_eigenvalues(&self) -> Option<Vec<f64>>
Computes the logarithm log(A) for positive definite A.
Trait Implementations§
Source§impl Clone for SpectralMeasure
impl Clone for SpectralMeasure
Source§fn clone(&self) -> SpectralMeasure
fn clone(&self) -> SpectralMeasure
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more