Skip to content

Commit

Permalink
Allow different kernels in finite_temp_bases
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBadr committed Sep 22, 2023
1 parent d691097 commit 2b92926
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
8 changes: 5 additions & 3 deletions src/basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ function rescale(basis::FiniteTempBasis, new_β)
end

"""
finite_temp_bases(β, ωmax, ε, sve_result=SVEResult(LogisticKernel(β * ωmax); ε))
finite_temp_bases(β::Real, ωmax::Real, ε=nothing;
kernel=LogisticKernel(β * ωmax), sve_result=SVEResult(kernel; ε))
Construct `FiniteTempBasis` objects for fermion and bosons using the same
`LogisticKernel` instance.
"""
function finite_temp_bases::Real, ωmax::Real, ε=nothing,
sve_result=SVEResult(LogisticKernel* ωmax); ε))
function finite_temp_bases::Real, ωmax::Real, ε=nothing;
kernel=LogisticKernel* ωmax),
sve_result=SVEResult(kernel; ε))
basis_f = FiniteTempBasis{Fermionic}(β, ωmax, ε; sve_result)
basis_b = FiniteTempBasis{Bosonic}(β, ωmax, ε; sve_result)
return basis_f, basis_b
Expand Down
2 changes: 1 addition & 1 deletion test/basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ isdefined(Main, :sve_logistic) || include("_conftest.jl")
ε = 1e-5

sve_result = sve_logistic[β * ωmax]
basis_f, basis_b = SparseIR.finite_temp_bases(β, ωmax, ε, sve_result)
basis_f, basis_b = SparseIR.finite_temp_bases(β, ωmax, ε; sve_result)
smpl_τ_f = TauSampling(basis_f)
smpl_τ_b = TauSampling(basis_b)
smpl_wn_f = MatsubaraSampling(basis_f)
Expand Down
4 changes: 2 additions & 2 deletions test/freq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ using SparseIR

@test Int(MatsubaraFreq(Int32(4))) == 4

@test_throws ErrorException FermionicFreq(4)
@test_throws ErrorException BosonicFreq(-7)
@test_throws DomainError FermionicFreq(4)
@test_throws DomainError BosonicFreq(-7)

@test FermionicFreq(5) < BosonicFreq(6)
@test BosonicFreq(6) >= BosonicFreq(6)
Expand Down
30 changes: 14 additions & 16 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ include("_conftest.jl")

Aqua.test_all(SparseIR; ambiguities=false, piracy=false)

@testset verbose=true "SparseIR.jl" begin
include("freq.jl")
include("gauss.jl")
include("kernel.jl")
include("poly.jl")
include("sve.jl")
include("svd.jl")
include("basis.jl")
include("sampling.jl")
include("augment.jl")
include("dlr.jl")
include("_linalg.jl")
include("_roots.jl")
include("_specfuncs.jl")
include("_multifloat_funcs.jl")
end
include("freq.jl")
include("gauss.jl")
include("kernel.jl")
include("poly.jl")
include("sve.jl")
include("svd.jl")
include("basis.jl")
include("sampling.jl")
include("augment.jl")
include("dlr.jl")
include("_linalg.jl")
include("_roots.jl")
include("_specfuncs.jl")
include("_multifloat_funcs.jl")

nothing # without this we get messy output from the testset printed in the REPL

0 comments on commit 2b92926

Please sign in to comment.