API
hankel_correlation_cleanerhankel_correlation_cleaner!jackknife_hankel_correlation_cleanerjackknife_hankel_correlation_cleaner!bootstrap_hankel_correlation_cleanerbootstrap_hankel_correlation_cleaner!
SmoQyHankelCorrCleaner.hankel_correlation_cleaner — Functionhankel_correlation_cleaner(
noisy_correlations::AbstractVector{T};
# KEYWORD ARGUMENTS
maxiter::Int,
tol::T,
positive_curvature::Bool = true,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
verbose::Bool = false
) where {T<:AbstractFloat}Denoise imaginary-time correlation data using the Hankel projection method. Returns the tuple (clean_correlations iter, err) where clean_correlation::Vector{T} is a vector of the cleaned correlations, iter::Int is the number of iterations and err::T is the final error.
Arguments
noisy_correlations::AbstractVector{T}: Vector of imaginary time correlation data to be cleaned.
Keyword Arguments
maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.verbose::Bool = false: Whether to print statements tracking the convergence of the denoising process.
SmoQyHankelCorrCleaner.hankel_correlation_cleaner! — Methodhankel_correlation_cleaner!(
correlations::AbstractVector{T};
# KEYWORD ARGUMENTS
maxiter::Int,
tol::T,
positive_curvature::Bool = true,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
verbose::Bool = false
) where {T<:AbstractFloat}Denoise imaginary-time correlation data using the Hankel projection method. Also return the tuple (iter, err) where iter::Int is the number of iterations and err::T is the final error.
Arguments
correlations::AbstractVector{T}: Vector of imaginary time correlation data to be cleaned.
Keyword Arguments
maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.verbose::Bool = false: Whether to print statements tracking the convergence of the denoising process.
SmoQyHankelCorrCleaner.hankel_correlation_cleaner! — Methodhankel_correlation_cleaner!(
clean_correlations::AbstractVector{T},
noisy_correlations::AbstractVector{T};
# KEYWORD ARGUMENTS
maxiter::Int,
tol::T,
positive_curvature::Bool = true,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
verbose::Bool = false
) where {T<:AbstractFloat}Denoise imaginary-time correlation data using the Hankel projection method. Also return the tuple (iter, err) where iter::Int is the number of iterations and err::T is the final error.
Arguments
clean_correlations::AbstractVector{T}: Vector to contain cleaned/denoised imaginary-time correlation data.noisy_correlations::AbstractVector{T}: Noisy imaginary-time correlation data.
Keyword Arguments
maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.verbose::Bool = false: Whether to print statements tracking the convergence of the denoising process.
SmoQyHankelCorrCleaner.jackknife_hankel_correlation_cleaner — Functionjackknife_hankel_correlation_cleaner(;
# KEYWORD ARGUMENTS
correlation_bins::AbstractMatrix{T},
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)),
maxiter::Int = 1000,
tol::T = 1e-4,
positive_curvature::Bool = false,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
covariance::Bool = false
) where {T<:AbstractFloat}Denoise binned imaginary-time correlation data, propagating the error using the jackknife algorithm. Returns the mean and error of the denoised imaginary-time correlation data.
Arguments
clean_correlations_mean::AbstractVector{T}: Vector to contain denoised imaginary-time correlations.clean_correlations_error::AbstractVector{T}: Vector to contain error associated with denoised imaginary-time correlations.correlation_bins::AbstractMatrix{T}: Binned imaginary-time correlations where the columns correspond to the bins and the rows to the imaginary time slices.
Keyword Arguments
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)): For data generated via a quantum Monte Carlo simulation with a sign problem, the average sign associated with each bin.maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.covariance::Bool = false: If true, this method also returns the covariance matrix.
SmoQyHankelCorrCleaner.jackknife_hankel_correlation_cleaner! — Functionjackknife_hankel_correlation_cleaner!(
clean_correlations_mean::AbstractVector{T},
clean_correlations_error::AbstractVector{T},
correlation_bins::AbstractMatrix{T};
# KEYWORD ARGUMENTS
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)),
maxiter::Int = 1000,
tol::T = 1e-4,
positive_curvature::Bool = false,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
covariance::Bool = false
) where {T<:AbstractFloat}Denoise binned imaginary-time correlation data, propagating the error using the jackknife algorithm.
Arguments
clean_correlations_mean::AbstractVector{T}: Vector to contain denoised imaginary time correlations.clean_correlations_error::AbstractVector{T}: Vector to contain error associated with denoised imaginary time correlations.correlation_bins::AbstractMatrix{T}: Binned imaginary time correlations where the columns correspond to the bins and the rows to the imaginary time slices.
Keyword Arguments
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)): For data generated via a quantum Monte Carlo simulation with a sign problem, the average sign associated with each bin.maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.covariance::Bool = false: If true, this method also returns the covariance matrix.
SmoQyHankelCorrCleaner.bootstrap_hankel_correlation_cleaner — Functionbootstrap_hankel_correlation_cleaner(;
# KEYWORD ARGUMENTS
correlation_bins::AbstractMatrix{T},
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)),
N_bootstrap::Int = 100,
maxiter::Int = 1000,
tol::T = 1e-4,
positive_curvature::Bool = false,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
covariance::Bool = false
) where {T<:AbstractFloat}Denoise binned imaginary-time correlation data, propagating the error via bootstrapping.
Arguments
correlation_bins::AbstractMatrix{T}: Binned imaginary time correlations where the columns correspond to the bins and the rows to the imaginary time slices.
Keyword Arguments
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)): For data generated via a quantum Monte Carlo simulation with a sign problem, the average sign associated with each bin.N_bootstrap::Int = 100: Number of bootstrap samples used to calculate the error.maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.covariance::Bool = false: If true, this method also returns the covariance matrix.
SmoQyHankelCorrCleaner.bootstrap_hankel_correlation_cleaner! — Functionbootstrap_hankel_correlation_cleaner!(;
# KEYWORD ARGUMENTS
clean_correlations_mean::AbstractVector{T},
clean_correlations_error::AbstractVector{T},
correlation_bins::AbstractMatrix{T},
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)),
N_bootstrap::Int = 100,
maxiter::Int = 1000,
tol::T = 1e-4,
positive_curvature::Bool = false,
fixed_endpoints::Bool = true,
symmetric::Bool = false,
covariance::Bool = false
) where {T<:AbstractFloat}Denoise binned imaginary-time correlation data, propagating the error via bootstrapping.
Arguments
clean_correlations_mean::AbstractVector{T}: Vector to contain denoised imaginary time correlations.clean_correlations_error::AbstractVector{T}: Vector to contain error associated with denoised imaginary time correlations.correlation_bins::AbstractMatrix{T}: Binned imaginary time correlations where the columns correspond to the bins and the rows to the imaginary time slices.
Keyword Arguments
sign_bins::AbstractVector{T} = ones(eltype(correlation_bins), size(correlation_bins, 2)): For data generated via a quantum Monte Carlo simulation with a sign problem, the average sign associated with each bin.N_bootstrap::Int = 100: Number of bootstrap samples used to calculate the error.maxiter::T: Maximum number of iteration used in Dykstra's algorithm.tol::T: Tolerance threshold used in Dykstra's algorithm.positive_curvature::Bool = false: Whether to project onto a matrix with average anti-diagonals that have strictly positive curvature.fixed_endpoints::Bool = true: Whether to fix the correlation values at $\tau = 0$ and $\tau = \beta$.symmetric::Bool = false: Whether the imaginary-time correlation data is symmetric about $\tau = \beta/2$.covariance::Bool = false: If true, this method also returns the covariance matrix.
Developer API
SmoQyHankelCorrCleaner.dykstra! — Functiondykstra!(;
# KEYWORD ARGUMENTS
H::AbstractArray{T},
projections!::Vector{Function},
tol::T,
maxiter::Int,
H0::AbstractArray{T} = zero(H),
P0::AbstractArray{T} = zero(H),
Ps::AbstractArray{T} = zeros(eltype(H), size(H)..., length(projections!)),
verbose::Bool = false,
projection_names::Vectors{String} = String[]
) where {T<:AbstractFloat}Perform Dykstra's algorithm on an input array H given a vector projections! for projection functions that modify H in place. This method is based on the implementation found in the Dykstra python package.
SmoQyHankelCorrCleaner.project_psd! — Functionproject_psd!(
H::AbstractMatrix{T},
A::AbstractMatrix{T} = similar(H)
) where {T<:AbstractFloat}Modifying H in-place, project it onto the nears positive semidefinite matrix by setting all the negative eigenvalues to zero.
SmoQyHankelCorrCleaner.project_hankel! — Functionproject_hankel!(
H::AbstractMattrix{T},
endpoints::Tuple{T,T} = (NaN, NaN)
) where {T<:AbstractFloat}Modifying the matrix H in-place, project it onto the closest Hankel matrix as defined by the Frobenius norm, by replacing each anti-diagonal by its average value. If finite endpoints are passed, then the values of H[1,1] and H[end,end] are fixed to those values respectively.
SmoQyHankelCorrCleaner.project_positive_curvature! — Functionproject_positive_curvature!(
H::AbstractMatrix{T},
endpoints::Tuple{T,T} = (NaN, NaN)
) where {T<:AbstractFloat}Project the matrix H onto the nearest matrix, as measured by the Frobenius norm, that has anti-diagonal average values that have strictly positive curvature i.e. if you take the second finite difference of anti-diagonal average values the result values are strictly positive. If the endpoints are real numbers, then the H[1,1] and H[end:end] set set equal to the passed values.
SmoQyHankelCorrCleaner.init_hankel_matrix — Functioninit_hankel_matrix(
correlations::AbstractVector{T}
) where {T<:AbstractFloat}Allocate, initialize and return the Hankel matrix based on the vector of correlations.
SmoQyHankelCorrCleaner.init_hankel_matrix! — Function" inithankelmatrix!( H::AbstractMatrix{T}, correaltions::AbstractVector{T} ) where {T<:AbstractFloat}
Initialize the Hankel matrix H in-place based on the vector of correlations.