pub struct SparseMatrix {
pub shape: (usize, usize),
pub inner: SciRSSparseMatrix<Complex64>,
pub format: SparseFormat,
pub simd_ops: Option<Arc<SimdOperations>>,
pub metrics: SparseMatrixMetrics,
pub buffer_pool: Arc<BufferPool<Complex64>>,
}Expand description
High-performance sparse matrix with SciRS2 integration
Fields§
§shape: (usize, usize)Matrix dimensions (rows, cols)
inner: SciRSSparseMatrix<Complex64>SciRS2 native sparse matrix backend
format: SparseFormatStorage format optimized for quantum operations
simd_ops: Option<Arc<SimdOperations>>SIMD operations handler
metrics: SparseMatrixMetricsPerformance metrics
buffer_pool: Arc<BufferPool<Complex64>>Memory buffer pool for operations
Implementations§
Source§impl SparseMatrix
impl SparseMatrix
Sourcepub fn new(rows: usize, cols: usize, format: SparseFormat) -> Self
pub fn new(rows: usize, cols: usize, format: SparseFormat) -> Self
Create a new sparse matrix with SciRS2 backend
Sourcepub fn insert(&mut self, row: usize, col: usize, value: Complex64)
pub fn insert(&mut self, row: usize, col: usize, value: Complex64)
Add non-zero entry with SciRS2 optimization
Sourcepub fn to_format(&self, new_format: SparseFormat) -> Self
pub fn to_format(&self, new_format: SparseFormat) -> Self
Convert to different sparse format with SciRS2 optimization
Sourcepub fn matmul(&self, other: &Self) -> QuantRS2Result<Self>
pub fn matmul(&self, other: &Self) -> QuantRS2Result<Self>
High-performance matrix multiplication using SciRS2
Sourcepub fn kron(&self, other: &Self) -> Self
pub fn kron(&self, other: &Self) -> Self
High-performance tensor product using SciRS2 parallel operations
Sourcepub fn is_unitary(&self, tolerance: f64) -> bool
pub fn is_unitary(&self, tolerance: f64) -> bool
Check if matrix is unitary using SciRS2’s numerical analysis
Sourcepub fn analyze_structure(&self) -> MatrixStructureAnalysis
pub fn analyze_structure(&self) -> MatrixStructureAnalysis
Advanced matrix analysis using SciRS2 numerical routines
Sourcepub fn compress(&mut self, level: CompressionLevel) -> QuantRS2Result<f64>
pub fn compress(&mut self, level: CompressionLevel) -> QuantRS2Result<f64>
Apply advanced compression using SciRS2
Sourcepub fn matrix_exp(&self, scale_factor: f64) -> QuantRS2Result<Self>
pub fn matrix_exp(&self, scale_factor: f64) -> QuantRS2Result<Self>
Matrix exponentiation using SciRS2’s advanced algorithms
Sourcepub const fn optimize_for_gpu(&mut self)
pub const fn optimize_for_gpu(&mut self)
Optimize matrix for GPU computation
Sourcepub const fn optimize_for_simd(&mut self, simd_width: usize)
pub const fn optimize_for_simd(&mut self, simd_width: usize)
Optimize matrix for SIMD operations
Trait Implementations§
Source§impl Clone for SparseMatrix
impl Clone for SparseMatrix
Source§fn clone(&self) -> SparseMatrix
fn clone(&self) -> SparseMatrix
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SparseMatrix
impl RefUnwindSafe for SparseMatrix
impl Send for SparseMatrix
impl Sync for SparseMatrix
impl Unpin for SparseMatrix
impl UnwindSafe for SparseMatrix
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.