Skip to main content

sparse_ir_basis/
lib.rs

1//! # sparse-ir-basis
2//!
3//! The intermediate representation (IR) basis: kernels, the singular value
4//! expansion in extended precision, piecewise Legendre polynomials and their
5//! Fourier transforms, and [`FiniteTempBasis`]. Also the DLR built from an IR
6//! basis ([`DlrFromIr`]) and the IR <-> DLR transform.
7//!
8//! Most users depend on the `sparse-ir` crate, which re-exports this crate.
9
10#[macro_use]
11extern crate sparse_ir_core;
12
13// Modules and items of the core and the DLR, under the paths the code uses
14#[allow(unused_imports)]
15use sparse_ir_core::{
16    ArrayRole, Matrix, MatsubaraFreq, StatisticsType, TypedTensor, basis_trait, error, fitters,
17    fpu_check, freq, matrix, matsubara_sampling, sampling, taufuncs, traits,
18};
19#[allow(unused_imports)]
20use sparse_ir_dlr::{dlr, fermionic_single_pole, giwn_single_pole, gtau_single_pole};
21// Names the tests of this crate use at the crate root
22#[cfg(test)]
23#[allow(unused_imports)]
24use sparse_ir_core::{
25    Basis, Bosonic, Error, Fermionic, MatsubaraSampling, MatsubaraSamplingPositiveOnly, Statistics,
26    TauSampling,
27};
28#[cfg(test)]
29#[allow(unused_imports)]
30use sparse_ir_dlr::{
31    DiscreteLehmannRepresentation, DlrBuilder, IrDlrTransform, bosonic_single_pole,
32};
33
34pub mod basis;
35pub(crate) mod col_piv_qr; // Column-pivoted QR decomposition using nalgebra
36pub mod gauss;
37pub(crate) mod interpolation1d;
38pub mod ir_dlr; // DLR built from an IR basis, and the IR <-> DLR transform
39pub mod kernel;
40pub mod kernelmatrix;
41pub mod numeric;
42pub mod poly;
43pub mod polyfourier;
44pub mod special_functions;
45pub mod sve;
46pub mod tsvd; // High-precision truncated SVD using nalgebra
47
48pub use basis::{BosonicBasis, FermionicBasis, FiniteTempBasis};
49pub use gauss::{Rule, legendre, legendre_custom, legendre_twofloat};
50pub use ir_dlr::{DlrFromIr, IrBasis};
51pub use kernel::{
52    AbstractKernel, CentrosymmKernel, KernelProperties, LogisticKernel, LogisticSVEHints,
53    RegularizedBoseKernel, RegularizedBoseSVEHints, SVEHints, SymmetryType,
54    compute_logistic_kernel,
55};
56pub use kernelmatrix::{
57    DiscretizedKernel, matrix_from_gauss, matrix_from_gauss_noncentrosymmetric,
58    matrix_from_gauss_with_segments,
59};
60pub use numeric::CustomNumeric;
61pub use poly::{PiecewiseLegendrePoly, PiecewiseLegendrePolyVector};
62pub use polyfourier::{
63    BosonicPiecewiseLegendreFT, BosonicPiecewiseLegendreFTVector, FermionicPiecewiseLegendreFT,
64    FermionicPiecewiseLegendreFTVector, PiecewiseLegendreFT, PiecewiseLegendreFTVector, PowerModel,
65};
66pub use sve::{
67    CentrosymmSVE, SVDStrategy, SVEResult, SVEStrategy, SamplingSVE, TworkType, compute_sve,
68};
69pub use tsvd::{
70    SVDResult, TSVDConfig, svd_decompose, tsvd, tsvd_df64, tsvd_df64_from_f64, tsvd_f64,
71};
72pub use xprec::Df64;
73
74// Test utilities (only available in test mode)
75#[cfg(test)]
76pub mod test_utils;
77
78// Tests of the core samplings, the Basis trait and the DLR on an IR basis
79#[cfg(test)]
80mod basis_trait_tests;
81#[cfg(test)]
82mod dlr_independent_tests;
83#[cfg(test)]
84mod dlr_tests;
85#[cfg(test)]
86mod matsubara_sampling_tests;
87#[cfg(test)]
88mod tau_sampling_tests;