TRIQS/triqs_ctseg 4.0.0
A TRIQS application
Loading...
Searching...
No Matches
work_data.hpp
1// Copyright (c) 2022--present, The Simons Foundation
2// Copyright (c) 2022--present, Max Planck Institute for Polymer Research, Mainz, Germany
3// This file is part of TRIQS/ctseg and is licensed under the terms of GPLv3 or later.
4// SPDX-License-Identifier: GPL-3.0-or-later
5// See LICENSE in the root of this distribution for details.
6
7#pragma once
8#include <mpi/mpi.hpp>
9#include <triqs/mc_tools/random_generator.hpp>
10#include <triqs/det_manip.hpp>
11
12#include "params.hpp"
13#include "inputs.hpp"
14#include "util.hpp"
15#include "dets.hpp"
16
17namespace triqs_ctseg {
18
19 struct work_data_t {
20
21 work_data_t(params_t const &p, inputs_t const &inputs, mpi::communicator c);
22
23 nda::matrix<double> U; // Density-density interaction: U_ab n_a n_b
24 gf_struct_t gf_struct; // gf_struct of the Green's function (input copied)
25 int n_color; // Number of colors
26 nda::vector<double> mu; // Chemical potential per color
27
28 bool has_Delta = false; // There is a non-zero hybridization term
29 bool has_Dt = false; // There is a non-zero dynamical nn interaction
30 bool has_Jperp = false; // There is a non-zero Jperp interaction
31 bool rot_inv = true; // The spin-spin interaction is rotationally invariant (matters for F(tau) measure)
32 bool minus_sign = false; // Has a move ever produced a negative sign?
33 bool offdiag_Delta = false; // Does Delta(tau) have blocks of size larger than 1?
34
35 // Dynamical and spin-spin interaction kernels
36 gf<imtime> D0t, K, Kprime, Jperp, Kprime_spin;
37
38 // Hybridization function
39 block_gf<imtime, matrix_real_valued> Delta;
40
41 // The determinants
42 // Vector of the det_manip objects, one per block of the input Delta(tau). See dets.hpp
43 std::vector<det_t> dets;
44
45 // Color to (block, idx) conversion tables
46 std::vector<long> block_number; // block numbers corresponding to colors
47 std::vector<long> index_in_block; // index in block of a given color
48
49 // Find color corresponding to (block, idx)
50 int block_to_color(int block, int idx) const;
51
52 // Find block of color
53 long find_block_number(int color) const;
54
55 // Find index of color in its block
56 long find_index_in_block(int color) const;
57 };
58
59 // Additional sign of the trace (computed from dets).
60 double trace_sign(work_data_t const &wdata);
61
62 // Functions for checking if a time is already in det.
63 bool c_in_det(tau_t const &tau, det_t const &D);
64
65 bool cdag_in_det(tau_t const &tau, det_t const &D);
66
67} // namespace triqs_ctseg