Sparse sampling
Sparse sampling is a way to transition between the truncated IR representation of a propagator (useful for convergence analysis) and a sparse set of sampling points in imaginary time or Matsubara frequency. This is mediated by two classes:
sparse_ir.TauSampling: sparse sampling in imaginary time, useful for, e.g., constructing Feynman diagrams with a spontaneous interation term.
sparse_ir.MatsubaraSampling: sparse sampling in Matsubara frequencies, useful for, e.g., solving diagrammatic equations such as the Dyson equation.
All sampling classes contain sampling_points, which are the corresponding
sampling points in time or frequency, and a method evaluate(), which allows
one to go from coefficients to sampling points, and a method fit() to go
back:
________________ ___________________
| | evaluate() | |
| Basis |---------------->| Value on |
| coefficients |<----------------| sampling_points |
|________________| fit() |___________________|
Warning
When storing data in sparse time/frequency, always store the sampling points together with the data. The exact location of the sampling points may be different from between platforms and/or between releases.
Sparse sampling transformers
- class sparse_ir.TauSampling(basis, sampling_points=None, use_positive_taus=False)
Sparse sampling in imaginary time.
Allows the transformation between the IR basis and a set of sampling points in (scaled/unscaled) imaginary time.
- evaluate(al, axis=0)
Transform basis coefficients to sampling points.
Parameters:
- alarray_like
Basis coefficients
- axisint, optional
Axis along which to transform
Returns:
- ndarray
Values at sampling points
- fit(ax, axis=0)
Fit basis coefficients from sampling point values.
- property tau
Tau sampling points.
- class sparse_ir.MatsubaraSampling(basis, sampling_points=None, positive_only=False)
Sparse sampling in Matsubara frequencies.
Allows the transformation between the IR basis and a set of sampling points in (scaled/unscaled) imaginary frequencies.
By setting
positive_only=True, one assumes that functions to be fitted are symmetric in Matsubara frequency, i.e.:Ghat(iv) == Ghat(-iv).conj()
or equivalently, that they are purely real in imaginary time. In this case, sparse sampling is performed over non-negative frequencies only, cutting away half of the necessary sampling space.
- evaluate(al, axis=0)
Transform basis coefficients to sampling points.
Parameters:
- alarray_like
Basis coefficients
- axisint, optional
Axis along which to transform
Returns:
- ndarray
Values at Matsubara frequencies (complex)
- fit(ax, axis=0)
Fit basis coefficients from Matsubara frequency values.
- property wn
Matsubara frequency indices.
Base classes
Note
The base classes for sampling are currently being refactored. Please refer to the concrete sampling classes above for the current API.