TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
retime.hpp
Go to the documentation of this file.
1// Copyright (c) 2014-2017 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
2// Copyright (c) 2014-2017 Centre national de la recherche scientifique (CNRS)
3// Copyright (c) 2019-2023 Simons Foundation
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You may obtain a copy of the License at
16// https://www.gnu.org/licenses/gpl-3.0.txt
17//
18// Authors: Philipp Dumitrescu, Olivier Parcollet, Nils Wentzell
19
24
25#pragma once
26
27#include "./bases/linear.hpp"
28#include "../utility/macros.hpp"
29
30#include <fmt/format.h>
31#include <h5/h5.hpp>
32
33#include <iostream>
34#include <string>
35#include <utility>
36
37namespace triqs::mesh {
38
43
70 class C2PY_RENAME(MeshReTime) retime : public detail::linear<retime, double> {
71 public:
74
83 C2PY_DEPRECATED_PARAMETER_NAME(n_max : n_t)
84 retime(double t_min = 0.0, double t_max = 0.0, long n_t = 0) : linear(t_min, t_max, n_t) {}
85
93 retime(std::pair<double, double> window, int n_t) : retime(window.first, window.second, n_t) {}
94
96 [[nodiscard]] C2PY_PROPERTY_GET(t_min) double t_min() const noexcept { return a_; }
97
99 [[nodiscard]] C2PY_PROPERTY_GET(t_max) double t_max() const noexcept { return b_; }
100
102 [[nodiscard]] static std::string hdf5_format() { return "MeshReTime"; }
103
111 friend void h5_write(h5::group g, std::string const &name, retime const &m) { m.h5_write_impl(g, name, "MeshReTime"); }
112
120 friend void h5_read(h5::group g, std::string const &name, retime &m) { m.h5_read_impl(g, name, "MeshReTime"); }
121
129 friend std::ostream &operator<<(std::ostream &sout, retime const &m) {
130 return sout << fmt::format("Real time mesh with t_min = {}, t_max = {}, N = {}", m.a_, m.b_, m.N_);
131 }
132 };
133
145 auto evaluate(retime const &m, auto const &f, double t) { return m.evaluate(f, t); }
146
148
149} // namespace triqs::mesh
retime(double t_min=0.0, double t_max=0.0, long n_t=0)
Construct a real time mesh on the interval with equally spaced mesh points.
Definition retime.hpp:84
Mesh point of a triqs::mesh::detail::linear mesh.
Definition linear.hpp:94
auto evaluate(auto const &f, double x) const
Linear interpolation of a function defined on a triqs::mesh::detail::linear mesh at a value .
Definition linear.hpp:364
void h5_write_impl(h5::group g, std::string const &name, const char *format) const
Write the mesh to HDF5.
Definition linear.hpp:323
void h5_read_impl(h5::group g, std::string const &name, const char *exp_format)
Read the mesh from HDF5.
Definition linear.hpp:338
Real time mesh type.
Definition retime.hpp:70
retime(std::pair< double, double > window, int n_t)
Construct a real time mesh on the interval with equally spaced mesh points.
Definition retime.hpp:93
double t_min() const noexcept
Get the lower bound of the interval , i.e. the value of the first mesh point.
Definition retime.hpp:96
friend std::ostream & operator<<(std::ostream &sout, retime const &m)
Write a triqs::mesh::retime mesh to a std::ostream.
Definition retime.hpp:129
friend void h5_write(h5::group g, std::string const &name, retime const &m)
Write a triqs::mesh::retime mesh to HDF5.
Definition retime.hpp:111
retime(double t_min=0.0, double t_max=0.0, long n_t=0)
Construct a real time mesh on the interval with equally spaced mesh points.
Definition retime.hpp:84
static std::string hdf5_format()
Get the HDF5 format tag.
Definition retime.hpp:102
detail::linear< retime, double >::mesh_point_t mesh_point_t
Mesh point type of a triqs::mesh::retime mesh (see triqs::mesh::detail::linear::mesh_point_t).
Definition retime.hpp:73
double t_max() const noexcept
Get the upper bound of the interval , i.e. the value of the last mesh point.
Definition retime.hpp:99
friend void h5_read(h5::group g, std::string const &name, retime &m)
Read a triqs::mesh::retime mesh from HDF5.
Definition retime.hpp:120
Provides a linear mesh type with equally spaced mesh points on an interval.
Common macros used in TRIQS.