From 16b5e78e8e2e9e8fe8fb6d9a05df1a50cf02d814 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Tue, 28 Oct 2014 16:03:03 +0100 Subject: [PATCH] Fix reinterpret_scalar_valued_gf_as_matrix_valued - Was not correct (bubble_scalar) because of missing start_shift for multivar gf. --- triqs/gfs/gf.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/triqs/gfs/gf.hpp b/triqs/gfs/gf.hpp index fd84b36b..d9765ce0 100644 --- a/triqs/gfs/gf.hpp +++ b/triqs/gfs/gf.hpp @@ -712,7 +712,10 @@ namespace gfs { gf_view reinterpret_scalar_valued_gf_as_matrix_valued(gf_view g) { using a_t = typename gf_view::data_view_t; - auto a = a_t{typename a_t::indexmap_type(join(g.data().shape(), make_shape(1, 1))), g.data().storage()}; + auto & imap = g.data().indexmap(); + typename a_t::indexmap_type index_map(join(imap.lengths(), make_shape(1, 1)), join(imap.strides(), make_shape(1, 1)), + imap.start_shift()); + auto a = a_t{index_map, g.data().storage()}; return {g.mesh(), a, g.singularity(), g.symmetry(), {}, g.name}; }