24#include <triqs/gfs.hpp>
25#include <triqs/mesh.hpp>
27using namespace triqs::gfs;
28using namespace triqs::mesh;
36 template <Channel_t C> std::array<int, 6> channel_stride_order;
55 template <>
inline constexpr std::array<int, 6> channel_stride_order<Channel_t::PH> = {0, 2, 3, 1, 5, 4};
64 template <>
inline constexpr std::array<int, 6> channel_stride_order<Channel_t::PH_bar> = {0, 2, 5, 1, 4, 3};
72 template <>
inline constexpr std::array<int, 6> channel_stride_order<Channel_t::PP> = {0, 2, 4, 1, 3, 5};
80 template <Channel_t C>
using channel_memory_layout = contiguous_layout_with_stride_order<encode(channel_stride_order<C>)>;
82 template <Channel_t C>
83 inline nda::matrix_view<g2_iw_t::scalar_t> channel_matrix_view(array_contiguous_view<g2_iw_t::scalar_t, 6, channel_memory_layout<C>> arr) {
84 constexpr std::array<int, 6> str_ord = channel_stride_order<C>;
85 return group_indices_view(arr, idx_group<str_ord[0], str_ord[1], str_ord[2]>, idx_group<str_ord[3], str_ord[4], str_ord[5]>);