3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 05:43:40 +01:00

Update tests related to Fourier transforms

This commit is contained in:
Michel Ferrero 2014-07-02 22:53:32 +02:00
parent cbfecdf623
commit 58659415ad
6 changed files with 22 additions and 12 deletions

View File

@ -10,7 +10,7 @@ int main() {
auto G = gf<imfreq> {{beta, Fermion}, {2,2}}; auto G = gf<imfreq> {{beta, Fermion}, {2,2}};
auto Gc = G; auto Gc = G;
auto G3 = G; auto G3 = G;
auto Gt = gf<imtime> {{beta, Fermion,100}, {2,2}}; auto Gt = gf<imtime> {{beta, Fermion, 3000}, {2,2}};
auto gt = make_gf_from_inverse_fourier(G); auto gt = make_gf_from_inverse_fourier(G);
auto gw = make_gf_from_fourier(gt); auto gw = make_gf_from_fourier(gt);

View File

@ -13,11 +13,11 @@ int main() {
// construct // construct
auto gw_n = gf<imfreq, matrix_valued, no_tail>{{beta, Fermion}, {2, 2}}; auto gw_n = gf<imfreq, matrix_valued, no_tail>{{beta, Fermion}, {2, 2}};
auto gt_n = gf<imtime, matrix_valued, no_tail>{{beta, Fermion, 100}, {2, 2}}; auto gt_n = gf<imtime, matrix_valued, no_tail>{{beta, Fermion, 10000}, {2, 2}};
// make a view from a g with a tail // make a view from a g with a tail
auto gw = gf<imfreq, matrix_valued>{{beta, Fermion}, {2, 2}}; auto gw = gf<imfreq, matrix_valued>{{beta, Fermion}, {2, 2}};
auto gt = gf<imtime, matrix_valued>{gf_mesh<imtime>{beta, Fermion, 100}, {2, 2}}; auto gt = gf<imtime, matrix_valued>{gf_mesh<imtime>{beta, Fermion, 10000}, {2, 2}};
auto vw = make_gf_view_without_tail(gw); auto vw = make_gf_view_without_tail(gw);
auto vt = make_gf_view_without_tail(gt); auto vt = make_gf_view_without_tail(gt);
@ -36,7 +36,7 @@ int main() {
// need to test all this.... // need to test all this....
//test antiperiodicity //test antiperiodicity
auto Gt = gf<imtime, scalar_valued, no_tail>{ { beta, Fermion, 1000 }, { } }; auto Gt = gf<imtime, scalar_valued, no_tail>{ { beta, Fermion, 10000 }, { } };
Gt(tau_) << exp(-tau_); Gt(tau_) << exp(-tau_);
TEST(Gt(0.01)); TEST(Gt(0.01));

View File

@ -6,9 +6,9 @@
(Gt(-.1)) ---> -0.40657 (Gt(-.1)) ---> -0.40657
(gt_with_full_tail(.5)) ---> ((0.5 * (gt_with_full_tail(.5)) ---> ((1 *
[[-0.44347,0] [[-0.443565,0]
[0,-0.44347]]) + (0.5 * [0,-0.443565]]) + (0 *
[[-0.443038,0] [[-0.443038,0]
[0,-0.443038]])) [0,-0.443038]]))
@ -44,9 +44,9 @@
[[(0,0),(0,0)] [[(0,0),(0,0)]
[(0,0),(0,0)]] [(0,0),(0,0)]]
(gt_tail_with_one_term(.5)) ---> ((0.5 * (gt_tail_with_one_term(.5)) ---> ((1 *
[[-0.443626,0] [[-0.443409,0]
[0,-0.443626]]) + (0.5 * [0,-0.443409]]) + (0 *
[[-0.443193,0] [[-0.443193,0]
[0,-0.443193]])) [0,-0.443193]]))

View File

@ -19,7 +19,7 @@ int main() {
Gw1(om_) << 1/(om_-E); Gw1(om_) << 1/(om_-E);
h5_write(file, "Gw1", Gw1); // the original lorentzian h5_write(file, "Gw1", Gw1); // the original lorentzian
auto Gt1 = gf<imtime> {{beta, Fermion, N}, {1,1}}; auto Gt1 = gf<imtime> {{beta, Fermion, 2*N}, {1,1}};
Gt1() = inverse_fourier(Gw1); Gt1() = inverse_fourier(Gw1);
h5_write(file, "Gt1", Gt1); // the lorentzian TF : lorentzian_inverse h5_write(file, "Gt1", Gt1); // the lorentzian TF : lorentzian_inverse

View File

@ -54,7 +54,7 @@ void test_1(){
double beta=10; double beta=10;
/* ----- Fourier ----- */ /* ----- Fourier ----- */
auto Gt = gf<imtime> {{beta, Fermion, 100,full_bins}, {1,1}}; auto Gt = gf<imtime> {{beta, Fermion, 201, full_bins}, {1,1}};
auto Gw = gf<imfreq> {{beta, Fermion, 100}, {1,1}}; auto Gw = gf<imfreq> {{beta, Fermion, 100}, {1,1}};
Gw.singularity()(1) = 1; Gw.singularity()(1) = 1;

File diff suppressed because one or more lines are too long