diff --git a/triqs/gfs/domains/matsubara.hpp b/triqs/gfs/domains/matsubara.hpp index 5959a649..cc8fcb81 100644 --- a/triqs/gfs/domains/matsubara.hpp +++ b/triqs/gfs/domains/matsubara.hpp @@ -21,6 +21,7 @@ #pragma once #include "../tools.hpp" #include +#include namespace triqs { namespace gfs { @@ -103,6 +104,11 @@ namespace gfs { using matsubara_freq_domain = matsubara_domain; using matsubara_time_domain = matsubara_domain; + + + // ----- kronecker function : overload for matsubara_freq + inline bool kronecker(matsubara_freq const & freq) { return freq.n == 0; } + inline bool kronecker(matsubara_freq const & f1, matsubara_freq const &f2) { return f1.n == f2.n; } } } diff --git a/triqs/utility/kronecker.hpp b/triqs/utility/kronecker.hpp new file mode 100644 index 00000000..8cb87ea7 --- /dev/null +++ b/triqs/utility/kronecker.hpp @@ -0,0 +1,30 @@ +/******************************************************************************* + * + * TRIQS: a Toolbox for Research in Interacting Quantum Systems + * + * Copyright (C) 2014 by O. Parcollet + * + * TRIQS is free software: you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * TRIQS. If not, see . + * + ******************************************************************************/ +#pragma once +#include + +inline bool kronecker(int i, int j) { return i == j; } + +namespace triqs { +namespace clef { + TRIQS_CLEF_MAKE_FNT_LAZY(kronecker); +} +}