40 out <<
"Local space [orbital_set]:\n";
41 auto out1 = triqs::utility::indented_ostream(out, 2);
42 auto out2 = triqs::utility::indented_ostream(out, 4);
43 auto out3 = triqs::utility::indented_ostream(out, 6);
44 out1 << fmt::format(
"Total dimension [M]: {}\n", x.
dim());
45 out1 << fmt::format(
"Number of correlated atoms: {}\n", x.
atomic_shells().size());
51 [&](
auto i) { return x.first_shell_of_its_equiv_cls(i) == i; });
52 out1 << fmt::format(
"Number of inequivalent correlated atoms = {}\n", ineq);
54 out1 <<
"Atomic decomposition:\n";
55 auto pr_vec = [](
auto const &V) {
56 return fmt::format(
"{}\n", fmt::join(V | stdv::transform([](
auto x) {
return fmt::format(
"{:>3}", x); }),
" "));
59 out2 <<
" dim_a: " << pr_vec(dec);
60 out2 <<
" a: " << pr_vec(range(dec.size()));
62 out2 <<
"irreps: " << fmt::format(
"{}\n", fmt::join(sub,
" "));
105 std::ostringstream out;
106 auto out1 = utility::indented_ostream(out, 2);
107 auto out2 = utility::indented_ostream(out, 4);
108 auto out3 = utility::indented_ostream(out, 6);
111 auto unconnected_imps = std::vector<long>{};
112 auto is_unconnected = std::vector<bool>(
n_impurities(),
true);
114 is_unconnected[n] = stdr::all_of(reverse_psi[n], [](
auto const &v) {
return v.empty(); });
115 if (is_unconnected[n]) unconnected_imps.push_back(n);
118 auto fmt_vec = [](
auto const &V) {
return fmt::join(V | stdv::transform([](
auto x) {
return fmt::format(
"{:>3}", x); }),
" "); };
119 auto pr_vec = [&](
auto const &V) {
return fmt::format(
"{}\n", fmt_vec(V)); };
122 out <<
"Embedding: ";
123 out << fmt::format(
"{} impurities\n", this->
n_impurities());
124 out1 <<
"Σ_embed block decomposition:\n";
125 out2 <<
"dim_α: " << pr_vec(this->sigma_embed_decomp);
126 out2 <<
" α: " << pr_vec(range(this->sigma_embed_decomp.size()));
127 out1 <<
"\nImpurities\n";
128 out2 <<
"Block dimensions, dim_γ for all γ:\n";
129 for (
auto &&[n, dec] : enumerate(this->imp_decomps)) {
130 auto head = fmt::format(
"[n_imp = {}]", n);
131 auto tag = is_unconnected[n] ?
" \033[31m(not connected)\033[0m" :
"";
132 out3 << fmt::format(
"{} dim_γ = {}{}\n", head, fmt_vec(dec), tag);
133 out3 << fmt::format(
"{:>{}} γ = {}",
" ", head.size(), pr_vec(range(dec.size())));
135 if (!unconnected_imps.empty()) out << fmt::format(
"\nImpurities not connected to any alpha block: {}\n", unconnected_imps);
139 out <<
"Embedding:\n";
140 out1 << fmt::format(
"Spin index (σ/τ) names: {}\n\n", this->
sigma_names());
141 out1 <<
"Σ_embed block decomposition:\n";
142 out2 <<
"dim_α: " << pr_vec(this->sigma_embed_decomp);
143 out2 <<
" α: " << pr_vec(range(this->sigma_embed_decomp.size()));
144 out1 <<
"\nImpurities\n";
145 out2 <<
"Block dimensions, dim_γ for all γ:\n";
146 for (
auto &&[n, dec] : enumerate(this->imp_decomps)) {
147 auto head = fmt::format(
"[n_imp = {}]", n);
148 auto tag = is_unconnected[n] ?
" \033[31m(not connected)\033[0m" :
"";
149 out3 << fmt::format(
"{} dim_γ = {}{}\n", head, fmt_vec(dec), tag);
150 out3 << fmt::format(
"{:>{}} γ = {}",
" ", head.size(), pr_vec(range(dec.size())));
152 out2 <<
"Gf Block structures for solvers as names, [dim]:\n";
153 for (
auto &&[n, ish] : enumerate(impurities_shape_list)) {
154 auto formatted_vec = ish | stdv::transform([](
auto &&p) {
return fmt::format(
"{} [{}]", p.first, p.second); }) | tl::to<std::vector>();
155 out3 << fmt::format(
"[imp_idx = {}] {}\n", n, fmt::join(formatted_vec,
", "));
157 out1 <<
"\nMapping ψ(α,σ) = (imp_idx, γ, τ) \n";
158 auto row_labels = range(this->
n_alpha()) | stdv::transform([](
auto x) {
return fmt::format(
"α = {}", x); }) | tl::to<std::vector>();
159 auto col_labels = range(this->
n_sigma()) | stdv::transform([&](
auto i) {
return fmt::format(
"σ = {} / {}", i, this->
sigma_names()[i]); })
160 | tl::to<std::vector>();
162 if (!unconnected_imps.empty()) out << fmt::format(
"\nImpurities not connected to any alpha block: {}\n", unconnected_imps);
embedding(std::vector< long > sigma_embed_decomposition, std::vector< std::vector< long > > imp_decompositions, nda::array< imp_block_t, 2 > psi, std::vector< std::string > sigma_names)
Construct an embedding object.
void format_as_table(std::ostream &out, nda::Matrix auto const &mat, auto const &row_labels, auto const &col_labels)
Format the matrix mat as a table, with row/col_labels.
A one-body elements struct where all of the underlying data exists on a fixed momentum grid.
std::optional< ibz_symmetry_ops > ibz_symm_ops
IBZ symmetrizer after a k-sum.