Skip to content

Commit

Permalink
Merge pull request #24 from numericalEFT/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
fsxbhyy authored Jan 26, 2022
2 parents 341a7d4 + 3a415bb commit 6b596f6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
CompositeGrids = "0.0.3"
CompositeGrids = "0.0"
FileIO = "1"
JLD2 = "0.4"
Lehmann = "0.2"
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@
[![Build Status](https://github.com/numericalEFT/GreenFunc.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/numericalEFT/GreenFunc.jl/actions/workflows/CI.yml?query=branch%3Amaster)
[![Coverage](https://codecov.io/gh/numericalEFT/GreenFunc.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/numericalEFT/GreenFunc.jl)

This library includes the general structure of different types of Green's function. Here we give a introduction of these Green's function.
This library provides structures of different types of Green's function. Here we give a introduction of these Green's function.
## Features

##
We provide the following containers to save different Green's functions:

The GreenFunc.Greenfunc model provides structures for different types of Green's functions.
-One body Green's function that has a built-in discrete Lehamnn representation (DLR), which is a generic and compact representation of Green's functions proposed in the Ref. [1].

For all Green's functions we provide the following manipulations:

- Fast and accurate Fourier transform between the imaginary-time domain and the Matsubara-frequency domain.

- Fast and accurate Green's function interpolation.

## Installation
This package has been registered. So, simply type `import Pkg; Pkg.add("GreenFunc")` in the Julia REPL to install.

## Basic Usage

```julia
using AbstractTrees, StaticArrays, ExpressionTree
Expand Down
11 changes: 11 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
CompositeGrids = "b5136c89-beeb-4521-9139-60d2cac8be56"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Lehmann = "95bf888a-8996-4655-9f35-1c0506bdfefe"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using GreenFunc
using Test, StaticArrays, LinearAlgebra, Printf, Statistics, Lehmann, CompositeGrids
using JLD2, FileIO
using CodecZlib

if isempty(ARGS)
include("test_Green.jl")
Expand Down
13 changes: 7 additions & 6 deletions test/test_Green.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SemiCircle(dlr, grid, type) = Sample.SemiCircle(dlr.Euv, dlr.β, dlr.isFermi, gr
isFermi = true
Euv = 1000.0

green_freq = Green2DLR{ComplexF64}(:green, GreenFunc.IMFREQ ,β, isFermi, Euv, sgrid)
green_freq = Green2DLR{ComplexF64}(:green, GreenFunc.IMFREQ, β, isFermi, Euv, sgrid)
rtol = green_freq.dlrGrid.rtol
println(green_freq.timeType)
= SemiCircle(green_freq.dlrGrid, green_freq.dlrGrid.τ, )
Expand Down Expand Up @@ -55,6 +55,7 @@ SemiCircle(dlr, grid, type) = Sample.SemiCircle(dlr.Euv, dlr.β, dlr.isFermi, gr
d = load("example.jld2")
green_read = d["green"]
@test green_read.dynamic == green_freq.dynamic
#deeptest(green_read, green_freq)
rm("example.jld2")
end

Expand All @@ -65,7 +66,7 @@ SemiCircle(dlr, grid, type) = Sample.SemiCircle(dlr.Euv, dlr.β, dlr.isFermi, gr
isFermi = true
Euv = 1000.0

green_linear = Green2DLR{Float64}(:green, GreenFunc.IMTIME,β, isFermi, Euv, sgrid)
green_linear = Green2DLR{Float64}(:green, GreenFunc.IMTIME, β, isFermi, Euv, sgrid)
rtol = green_linear.dlrGrid.rtol
green_dum = zeros(Float64, (green_linear.color, green_linear.color, green_linear.spaceGrid.size, green_linear.timeGrid.size))
for (ti, t) in enumerate(green_linear.timeGrid)
Expand All @@ -92,13 +93,13 @@ SemiCircle(dlr, grid, type) = Sample.SemiCircle(dlr.Euv, dlr.β, dlr.isFermi, gr

τ = 0.5
x = 0.3
interp_dym = dynamic(green_linear, τ, x, 1,1)
interp_dym = dynamic(green_linear, τ, x, 1, 1)
@test interp_dym - τ * x < 1e-8
interp_ins = instant(green_linear, x,1,1)
interp_ins = instant(green_linear, x, 1, 1)
@test interp_ins - x < 1e-8
interp_ins = dynamic(green_linear, τ, x,1,1,GreenFunc.DEFAULTINTERP,GreenFunc.DEFAULTINTERP)
interp_ins = dynamic(green_linear, τ, x, 1, 1, GreenFunc.DEFAULTINTERP, GreenFunc.DEFAULTINTERP)
@test interp_ins - x < 1e-8
interp_ins = dynamic(green_linear, τ, x,1,1,GreenFunc.DLRINTERP,GreenFunc.DEFAULTINTERP)
interp_ins = dynamic(green_linear, τ, x, 1, 1, GreenFunc.DLRINTERP, GreenFunc.DEFAULTINTERP)
@test interp_ins - x < 1e-8
end
end
Expand Down

2 comments on commit 6b596f6

@fsxbhyy
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: "Tag with name v0.1.0 already exists and points to a different commit"

Please sign in to comment.