TRIQS/triqs_ctint 4.0.0
A TRIQS application
Loading...
Searching...
No Matches
vertex.hpp
1// Copyright (c) 2017--present, The Simons Foundation
2// This file is part of TRIQS/ctint and is licensed under the terms of GPLv3 or later.
3// SPDX-License-Identifier: GPL-3.0-or-later
4// See LICENSE in the root of this distribution for details.
5
6#pragma once
7#include "./types.hpp"
8#include <triqs/det_manip/det_manip.hpp>
9
10namespace triqs_ctint {
11
17 struct tau_t {
18
20 static constexpr uint32_t n_max = std::numeric_limits<uint32_t>::max();
21
23 static double beta;
24
26 uint32_t n = 0;
27
29 template <typename RNG> static tau_t get_random(RNG &rng) { return tau_t{rng(n_max)}; }
30
32 operator double() const { return beta * double(n) / n_max; }
33
34 // --- Comparison operators
35 bool operator==(const tau_t &tau) const { return n == tau.n; }
36 bool operator!=(const tau_t &tau) const { return n != tau.n; }
37 bool operator<(const tau_t &tau) const { return n < tau.n; }
38 bool operator>(const tau_t &tau) const { return n > tau.n; }
39 bool operator<=(const tau_t &tau) const { return n <= tau.n; }
40 bool operator>=(const tau_t &tau) const { return n >= tau.n; }
41
43 friend std::ostream &operator<<(std::ostream &out, tau_t const &tau) {
44 return out << double(tau) << " [tau_t : beta = " << tau.beta << " n = " << tau.n << "]";
45 }
46
48 static constexpr tau_t get_zero() { return tau_t{0}; }
49
51 static constexpr tau_t get_zero_plus() { return tau_t{1}; }
52
54 static constexpr tau_t get_zero_plus_plus() { return tau_t{2}; }
55
57 static constexpr tau_t get_beta() { return tau_t{n_max}; }
58
60 static constexpr tau_t get_beta_minus() { return tau_t{n_max - 1}; }
61
63 static constexpr tau_t get_beta_minus_minus() { return tau_t{n_max - 2}; }
64 };
65
68 std::pair<double, double> cyclic_difference(tau_t const &tau1, tau_t const &tau2);
69 std::pair<double, double> cyclic_difference(double tau1, double tau2);
70
71 // Generate a tau_t-object from a double
72 tau_t make_tau_t(double tau);
73
79 struct vertex_idx_t {
80
82 int b1, u1;
83
85 int b2, u2;
86
88 int b3, u3;
89
91 int b4, u4;
92 };
93
94 std::ostream &operator<<(std::ostream &os, vertex_idx_t const &v);
95
100 struct vertex_t {
101
104
106 tau_t tau1, tau2, tau3, tau4;
107
109 U_scalar_t amplitude;
110
113
116
118 int s = 0;
119 };
120
121 std::ostream &operator<<(std::ostream &os, vertex_t const &v);
122
123} // namespace triqs_ctint
static constexpr tau_t get_zero()
Return \tau = 0.
Definition vertex.hpp:48
static constexpr uint32_t n_max
Maximum value that can be stored inside a uint32_t.
Definition vertex.hpp:20
uint32_t n
$\tau$ value, represented as an integer on a very fine grid
Definition vertex.hpp:26
static constexpr tau_t get_beta()
Return \tau = \beta.
Definition vertex.hpp:57
friend std::ostream & operator<<(std::ostream &out, tau_t const &tau)
Operator allowing output to std::ostream.
Definition vertex.hpp:43
static tau_t get_random(RNG &rng)
Get a random point in $[0,\beta[$.
Definition vertex.hpp:29
static constexpr tau_t get_beta_minus_minus()
Return \tau = beta^{–} = \beta - 2*\delta.
Definition vertex.hpp:63
static constexpr tau_t get_beta_minus()
Return \tau = beta^{-} = \beta - \delta.
Definition vertex.hpp:60
static double beta
Inverse temperature associated with all $\tau$ points.
Definition vertex.hpp:23
static constexpr tau_t get_zero_plus()
Return \tau = 0^{+} = 0 + \delta.
Definition vertex.hpp:51
static constexpr tau_t get_zero_plus_plus()
Return \tau = 0^{++} = 0 + 2*\delta.
Definition vertex.hpp:54
int b2
Second operator of the vertex (ingoing, c): block index, non-block.
Definition vertex.hpp:85
int b4
Fourth operator of the vertex (ingoing, c): block index, non-block.
Definition vertex.hpp:91
int b1
First operator of the vertex (outgoing, c^\dagger): block index, non-block.
Definition vertex.hpp:82
int b3
Third operator of the vertex (outgoing, c^\dagger): block index, non-block.
Definition vertex.hpp:88
vertex_idx_t idx
Object containing discrete quantum numbers for external legs, i.e. block and non-block index.
Definition vertex.hpp:103
U_scalar_t amplitude
Amplitude of the vertex, i.e. U, U(tau1-tau2), etc...
Definition vertex.hpp:109
int s
Value of auxiliary spin.
Definition vertex.hpp:118
int vertex_label
The label of the vertex (position in h_int).
Definition vertex.hpp:115
tau_t tau1
Imaginary times for all four external legs (c^\dagger, c, c^\dagger, c).
Definition vertex.hpp:106
double proposition_proba
Probability of proposition for this vertex.
Definition vertex.hpp:112