GithubHelp home page GithubHelp logo

numericaleft / lehmann.jl Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 1.0 5.87 MB

Compact Spectral Representation for Imaginary-time/Matsubara-frequency Green's Functions

Home Page: https://numericalEFT.github.io/Lehmann.jl/dev

License: MIT License

Julia 100.00%
many-body-physics quantum-statistics julia greens-functions feynman-diagrams

lehmann.jl's People

Contributors

dcerkoney avatar fsxbhyy avatar github-actions[bot] avatar iintsjds avatar kunyuan avatar littlebug avatar quantumstatistics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gharib85

lehmann.jl's Issues

Use Val{}() to improve the type stability

kernel\Omage could return complex or float depending on isFermi and symmetry arguments. Replace the argument with ::Val{isFermi} and ::Val{symmetry} to allow multiple dispatch to improve the type stability

Fixing Docstrings?

Hi, I really like this package you have designed! It offers some really cool functionality that is useful in a wide variety of contexts!
However, looking at the docs, many of the doc strings are not formatted correctly and are rendering improperly.
It is very challenging to read the package API as things stand right now.
Would it be possible to have them fixed?

Int32 could be too small when running on x86

Polarization: wrapped: Error During Test at /home/runner/work/ElectronGas.jl/ElectronGas.jl/test/polarization.jl:83
Got exception outside of a @test
InexactError: Int32(1.0e10)
Stacktrace:
[1] Int32
@ ./float.jl:702 [inlined]
[2] (::Lehmann.var"#filename#8"{Symbol})(lambda::Float64, errpower::Int32)
@ Lehmann ~/.julia/packages/Lehmann/uKJiS/src/dlr.jl:102
[3] Lehmann.DLRGrid(Euv::Float64, β::Float64, rtol::Float64, isFermi::Bool, symmetry::Symbol; rebuild::Bool, folder::Nothing, algorithm::Symbol, verbose::Bool)
@ Lehmann ~/.julia/packages/Lehmann/uKJiS/src/dlr.jl:142

dlr operation with sumrule needs proper warning when input is multidimensional object

When doing fourier transform of objects with dimension D > 1, sumrule needs to be an array with dimension D-1.
When incorrectly using sumrule = 1.0 for an 2D object, the code pops out with:

ERROR: LoadError: MethodError: no method matching reshape(::Float64, ::Int64)
Stacktrace:
[1] tau2dlr(dlrGrid::DLRGrid, green::Matrix{ComplexF64}, τGrid::Vector{Float64}; error::Nothing, axis::Int64, sumrule::Float64, verbose::Bool)
@ Lehmann ~/Julia_manybody3/Lehmann.jl/src/operation.jl:219
[2] tau2matfreq(dlrGrid::DLRGrid, green::Matrix{ComplexF64}, nNewGrid::Vector{Int64}, τGrid::Vector{Float64}; error::Nothing, axis::Int64, sumrule::Float64, verbose::Bool)
@ Lehmann ~/Julia_manybody3/Lehmann.jl/src/operation.jl:390

DLRGrid throws ArgumentError in the high temperature limit

Dear Kun,

Thank you for the nice Julia implementation of DLR. I am trying to use Lehmann.jl in a project but have stumbled on an issue when calling the DLRGrid builder at high temperatures.

Here is an example code that breaks throwing an ArgumentError

using Lehmann: DLRGrid

for n in range(1, 10)
    β = 1000.0/2^n
    dlr = DLRGrid(Euv=1., β=β, isFermi=true, rtol=1e-9, rebuild=true, verbose=false)
    @show β, n, length(dlr.τ)
end

For the output please see below.

Do you think it would be possible to "harden" the behaviour of the grid builder so that it performs ok also for high temperatures?

Cheers, Hugo

(β, n, length(dlr.τ)) = (500.0, 1, 41)
(β, n, length(dlr.τ)) = (250.0, 2, 37)
(β, n, length(dlr.τ)) = (125.0, 3, 31)
(β, n, length(dlr.τ)) = (62.5, 4, 25)
(β, n, length(dlr.τ)) = (31.25, 5, 20)
(β, n, length(dlr.τ)) = (15.625, 6, 16)
(β, n, length(dlr.τ)) = (7.8125, 7, 13)
ArgumentError: reducing over an empty collection is not allowed

Stacktrace:
  [1] _empty_reduce_error()
    @ Base ./reduce.jl:301
  [2] reduce_empty(op::Function, #unused#::Type{Float64})
    @ Base ./reduce.jl:311
  [3] mapreduce_empty(#unused#::typeof(identity), op::Function, T::Type)
    @ Base ./reduce.jl:345
  [4] reduce_empty(op::Base.MappingRF{typeof(identity), typeof(max)}, #unused#::Type{Float64})
    @ Base ./reduce.jl:331
  [5] reduce_empty_iter
    @ ./reduce.jl:357 [inlined]
  [6] mapreduce_empty_iter(f::Function, op::Function, itr::Vector{Float64}, ItrEltype::Base.HasEltype)
    @ Base ./reduce.jl:353
  [7] _mapreduce(f::typeof(identity), op::typeof(max), #unused#::IndexLinear, A::Vector{Float64})
    @ Base ./reduce.jl:402
  [8] _mapreduce_dim
    @ ./reducedim.jl:330 [inlined]
  [9] #mapreduce#725
    @ ./reducedim.jl:322 [inlined]
 [10] mapreduce
    @ ./reducedim.jl:322 [inlined]
 [11] #_maximum#743
    @ ./reducedim.jl:894 [inlined]
 [12] _maximum
    @ ./reducedim.jl:894 [inlined]
 [13] #_maximum#742
    @ ./reducedim.jl:893 [inlined]
 [14] _maximum
    @ ./reducedim.jl:893 [inlined]
 [15] #maximum#740
    @ ./reducedim.jl:889 [inlined]
 [16] maximum
    @ ./reducedim.jl:889 [inlined]
 [17] testInterpolation(dlrGrid::DLRGrid{Float64, :none}, τ::Lehmann.Discrete.CompositeChebyshevGrid, ω::Lehmann.Discrete.CompositeChebyshevGrid, kernel::Matrix{Float64}, print::Bool)
    @ Lehmann.Discrete ~/.julia/packages/Lehmann/v7X4o/src/discrete/kernel.jl:137
 [18] build(dlrGrid::DLRGrid{Float64, :none}, print::Bool)
    @ Lehmann.Discrete ~/.julia/packages/Lehmann/v7X4o/src/discrete/builder.jl:119
 [19] _build!(dlrGrid::DLRGrid{Float64, :none}, folder::Nothing, filename::String, algorithm::Symbol, verbose::Bool)
    @ Lehmann ~/.julia/packages/Lehmann/v7X4o/src/dlr.jl:338
 [20] DLRGrid(Euv::Float64, β::Float64, rtol::Float64, isFermi::Bool, symmetry::Symbol; rebuild::Bool, folder::Nothing, algorithm::Symbol, verbose::Bool, dtype::Type)
    @ Lehmann ~/.julia/packages/Lehmann/v7X4o/src/dlr.jl:172
 [21] #DLRGrid#7
    @ ~/.julia/packages/Lehmann/v7X4o/src/dlr.jl:189 [inlined]
 [22] top-level scope
    @ ./In[20]:5

Add dlr type in DLRGrids

so that user don't need to call fourier transform like tau2dlr(:fermi, fdlr, ... ), instead just tau2dlr( fdlr, ...)

Allow non-Int grid as the aim of dlr2matfreq and tau2matfreq

In the current implementation dlr2matfreq and tau2matfreq only accept n grid of Int type as the aim grid.
It's more convenient to allow grid of Real number for the purpose of interpolation between different temperatures and perform calculation on an interpolated continuous frequency grid.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.