| Crates.io | sparse-ir |
| lib.rs | sparse-ir |
| version | 0.8.0 |
| created_at | 2025-11-27 04:37:09.24101+00 |
| updated_at | 2025-12-29 23:25:29.949469+00 |
| description | Rust implementation of SparseIR functionality |
| homepage | |
| repository | https://github.com/SpM-lab/sparse-ir-rs |
| max_upload_size | |
| id | 1953053 |
| size | 961,097 |
A high-performance Rust implementation of the SparseIR (Sparse Intermediate Representation) library, providing analytical continuation and sparse representation functionality for quantum many-body physics calculations.
Add to your Cargo.toml:
[dependencies]
sparse-ir = "0.1.0"
By default, sparse-ir uses Faer (pure Rust) for matrix operations in fit and evaluate routines. To use system BLAS instead (e.g., OpenBLAS, Intel MKL) for better performance, enable the system-blas feature:
[dependencies]
sparse-ir = { version = "0.1.0", features = ["system-blas"] }
Note: When system-blas is enabled, fit and evaluate operations will use BLAS. When not linked, Faer is used as the fallback.
use sparse_ir::*;
// Create a finite temperature basis
let beta = 10.0;
let lambda = 10.0; // beta * omega_max
let kernel = LogisticKernel::new(lambda);
let basis = FermionicBasis::new(kernel, beta, None, None);
// Generate sampling points
let sampling = TauSampling::new(&basis);
// Use the basis for calculations
let tau_points = sampling.sampling_points();
println!("Generated {} sampling points", tau_points.len());
use sparse_ir::*;
// Create a kernel for analytical continuation
let kernel = LogisticKernel::new(1.0);
// Compute SVE
let sve_result = compute_sve(kernel, 1e-12, None, Some(100), TworkType::Auto);
println!("SVE computed with {} singular values", sve_result.s.len());
The complete API documentation is available at docs.rs/sparse-ir.
This implementation is optimized for high performance:
This crate is dual-licensed under the terms of the MIT license and the Apache License (Version 2.0).
The col_piv_qr module is based on code from the nalgebra library, which is licensed under the Apache License 2.0:
nalgebra/src/linalg/col_piv_qr.rsModifications and additions to the nalgebra code (including early termination support) are available under the same dual license as this crate (MIT OR Apache-2.0).
Contributions are welcome! Please see our Contributing Guide for details.