mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 05:43:40 +01:00
kronecker function and overload for matsubara_freq
Used in solver codes.
This commit is contained in:
parent
9911b18363
commit
1e220d24c7
@ -21,6 +21,7 @@
|
||||
#pragma once
|
||||
#include "../tools.hpp"
|
||||
#include <triqs/utility/arithmetic_ops_by_cast.hpp>
|
||||
#include <triqs/utility/kronecker.hpp>
|
||||
|
||||
namespace triqs {
|
||||
namespace gfs {
|
||||
@ -103,6 +104,11 @@ namespace gfs {
|
||||
|
||||
using matsubara_freq_domain = matsubara_domain<true>;
|
||||
using matsubara_time_domain = matsubara_domain<false>;
|
||||
|
||||
|
||||
// ----- 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; }
|
||||
}
|
||||
}
|
||||
|
||||
|
30
triqs/utility/kronecker.hpp
Normal file
30
triqs/utility/kronecker.hpp
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
#include <triqs/clef.hpp>
|
||||
|
||||
inline bool kronecker(int i, int j) { return i == j; }
|
||||
|
||||
namespace triqs {
|
||||
namespace clef {
|
||||
TRIQS_CLEF_MAKE_FNT_LAZY(kronecker);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user