TRIQS/triqs_cthyb 4.0.0
A TRIQS application
Loading...
Searching...
No Matches
config.hpp
1/*******************************************************************************
2 *
3 * TRIQS: a Toolbox for Research in Interacting Quantum Systems
4 *
5 * Copyright (C) 2014, P. Seth, I. Krivenko, M. Ferrero and O. Parcollet
6 *
7 * TRIQS is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later
10 * version.
11 *
12 * TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * TRIQS. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ******************************************************************************/
21#pragma once
22#include <nda/nda.hpp>
23#include <triqs/gfs.hpp>
24#include <triqs/mesh.hpp>
25#include <string>
26#include <vector>
27#include <map>
28#include <triqs/operators/many_body_operator.hpp>
29#include <triqs/hilbert_space/state.hpp>
30#include <triqs/hilbert_space/imperative_operator.hpp>
31//#include "./array_suppl.hpp"
32
33#include <h5/h5.hpp>
34
35namespace triqs_cthyb {
36
37using namespace nda;
38using namespace triqs::gfs;
39using namespace triqs::mesh;
40using namespace triqs::hilbert_space;
41namespace operators = triqs::operators;
42
43using std::isfinite;
44inline bool isfinite(dcomplex const &x) { return std::isfinite(real(x)) && std::isfinite(imag(x)); }
45
46inline double real(double x) { return x; }
47inline double imag(double) { return 0; }
48
49// FIXME when moved into the lib, we have to template of h_scalar_t = double and complex
50// consider moving this into the class, under the template
51
52#ifdef HYBRIDISATION_IS_COMPLEX
53using det_scalar_t = dcomplex;
54using delta_target_t = matrix_valued;
55#else
56using det_scalar_t = double;
57using delta_target_t = matrix_real_valued;
58#endif
59
60#ifdef LOCAL_HAMILTONIAN_IS_COMPLEX
61using h_scalar_t = dcomplex; // type of scalar for H_loc: double or complex.
62static constexpr bool is_h_scalar_complex = true;
63#else
64using h_scalar_t = double; // type of scalar for H_loc: double or complex.
65static constexpr bool is_h_scalar_complex = false;
66#endif
67
68using mc_weight_t = decltype(h_scalar_t{} * det_scalar_t{}); // complex iif either is complex
69using many_body_op_t = triqs::operators::many_body_operator_generic<h_scalar_t>; // Operator with real or complex value
70using matrix_t = matrix<h_scalar_t>;
71using G_target_t = std::conditional_t<triqs::is_complex<mc_weight_t>::value, matrix_valued, matrix_real_valued>;
72
73}