TRIQS/triqs_cthyb 4.0.0
A TRIQS application
Loading...
Searching...
No Matches
global.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 <triqs/mc_tools.hpp>
23#include "../qmc_data.hpp"
24
25#include <vector>
26#include <map>
27#include <set>
28#include <numeric>
29#include <algorithm>
30#include <memory>
31
32namespace triqs_cthyb {
33
34 class move_global {
35
36 std::string name;
37
38 qmc_data &data;
39 configuration &config;
40 mc_tools::random_generator &rng;
41
42 // Substitutions as mappings (old linear index) -> (new op_desc)
43 std::vector<op_desc> substitute_c, substitute_c_dag;
44
45 // Indices of blocks potentially affected by this move
46 std::set<int> affected_blocks;
47
48 // Operators to be updated
49 configuration::oplist_t updated_ops;
50
51 // Proposed arguments of the dets
52 std::vector<std::vector<det_type::x_type>> x;
53 std::vector<std::vector<det_type::y_type>> y;
54
55 h_scalar_t new_atomic_weight; // Proposed value of the trace or norm
56 h_scalar_t new_atomic_reweighting; // Proposed value of the reweighting
57
58 public:
59 move_global(std::string const &name, indices_map_t const &substitution_map, qmc_data &data, mc_tools::random_generator &rng);
60
61 mc_weight_t attempt();
62 mc_weight_t accept();
63 void reject();
64 };
65}