TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
flatten.hpp
#include "./gf.hpp"
#include "../../utility/macros.hpp"
#include <utility>

Detailed Description

Provides utilities to flatten the data of arrays and Green's functions into a two-dimensional form.

Definition in file flatten.hpp.

Go to the source code of this file.

Functions

template<int N = 0, nda::MemoryArray A>
auto triqs::gfs::flatten_2d (A const &v)
 Flatten an array into two dimensions, keeping one dimension and collapsing the rest.
template<int N = 0, MemoryGf G>
auto triqs::gfs::flatten_gf_2d (G const &g)
 Flatten a Green's function into a single-mesh, tensor-valued Green's function.
template<int N = 0>
void triqs::gfs::unflatten_2d (nda::MemoryArray auto &&out, nda::MemoryArray auto const &afl)
 Inverse of triqs::gfs::flatten_2d: scatter a two-dimensional array back into a higher-rank array.
template<int N = 0, MemoryGf Gfl>
void triqs::gfs::unflatten_gf_2d (MemoryGf auto &g, Gfl const &gfl)
 Inverse of triqs::gfs::flatten_gf_2d: scatter a flattened Green's function back into a higher-rank one.