triqs.mesh.meshes.MeshReTime

class triqs.mesh.meshes.MeshReTime

Bases: object

Real time mesh type.

A real time mesh is defined by its size \(N \geq 0\) and a time interval \([t_{\mathrm{min}}, t_{\mathrm{max}}]\). It contains \(N\) equally spaced mesh points on the interval \([t_{\mathrm{min}}, t_{\mathrm{max}}]\) such that the distance between two consecutive mesh points (step size) is constant.

A real time mesh has the following properties:

  • Each mesh point is identified by a unique index \(n \in \{0, 1, \ldots, N-1\}\).

  • An index \(n\) is mapped to the corresponding data index \(d\) by the identity function \(d(n) = n\) and vice versa.

  • An index \(n\) is mapped to the corresponding value \(t\) by the linear function \(t(n) = t_{\mathrm{min}} + n \cdot \Delta\) such that \(t(0) = t_{\mathrm{min}}\) and \(t(N - 1) = t_{\mathrm{max}}\). The step size of the mesh is \(\Delta = \frac{t_{\mathrm{max}} - t_{\mathrm{min}}}{N - 1}\) for \(N > 1\), otherwise it is undefined. For implementation purposes, we set \(\Delta = 0\) and \(\Delta^{-1} = 0\) for \(N = 0\) and \(\Delta = 0\) and \(\Delta^{-1} = \infty\) for \(N = 1\).

  • An arbitrary value \(t \in [t_{\mathrm{min}}, t_{\mathrm{max}}]\) is mapped to the closest mesh point with index \(n\) by the function \(n(t) = \left\lfloor \frac{t - t_{\mathrm{min}}}{\Delta} + 0.5 \right\rfloor\).

Green’s function containers that are based on a real time mesh store the function values at the discrete time points \(t(n)\), i.e. \(f_n = f(t(n))\), and use linear interpolation to evaluate the function at an arbitrary time \(t \in [t_{\mathrm{min}}, t_{\mathrm{max}}]\).


Dispatched C++ constructor(s).

[1] (t_min: float = 0, t_max: float = 0, n_t: int = 0)

[2] (window: tuple[float, float], n_t: int)

Construct a real time mesh on the interval \([t_{\mathrm{min}}, t_{\mathrm{max}}]\) with \(N \geq 0\) equally spaced mesh points.

Parameters:
t_minfloat

Lower bound \(t_{\mathrm{min}}\) of the time interval.

t_maxfloat

Upper bound \(t_{\mathrm{max}}\) of the time interval.

n_tint, int

Size of the mesh.

windowtuple[float, float]

Pair containing the lower and upper bounds of the time interval.

Attributes

delta

Get the step size \(\Delta\) of the mesh, i.e. the distance between two consecutive mesh points.

delta_inv

Get the inverse of the step size of the mesh, i.e. \(1 / \Delta\).

first_index

Get the first index of the mesh, i.e. \(0\).

last_index

Get the last index of the mesh, i.e. \(N - 1\).

mesh_hash

Get the hash value of the mesh.

t_max

Get the upper bound of the interval \(t_{\mathrm{max}}\), i.e. the value of the last mesh point.

t_min

Get the lower bound of the interval \(t_{\mathrm{min}}\), i.e. the value of the first mesh point.

Methods

__call__(*args, **kwargs)

Call self as a function.

copy

Get a copy of a mesh (for Python bindings).

copy_from

Copy one mesh into another (for Python bindings).

is_index_valid

Check if an index \(n\) is valid.

to_data_index

Map an index \(n \in \{0, 1, \ldots, N-1\}\) to its corresponding data index \(d(n)\).

to_index

Map a data index \(d \in \{0, 1, \ldots, N-1\}\) to the corresponding index \(n(d)\).

to_value

Map an index \(n \in \{0, 1, \ldots, N-1\}\) to its corresponding value \(m(n)\).

values

Get the values of all mesh points in a mesh.