15 _irreps_decomp_per_atom{std::move(irreps_decomp_per_atom)},
20 _dim_C = stdr::fold_left(_atomic_shells | stdv::transform([](
auto const &s) {
return s.dim; }), 0, std::plus<>());
23 _atom_names = range(_atomic_shells.size()) | stdv::transform([](
auto i) {
return std::to_string(i); }) | tl::to<std::vector>();
27 auto cls_idx = _atomic_shells[idx].cls_idx;
28 for (
auto const &[iatom, sh] : enumerate(_atomic_shells)) {
29 if (cls_idx == sh.cls_idx)
return iatom;
31 throw std::runtime_error(
"Can not find the atom in first_shell_of_its_equiv_cls");
36 auto matrix_out = nda::array<nda::matrix<dcomplex>, 2>{
n_atoms(),
n_sigma()};
37 for (
auto sigma : range(
n_sigma()))
39 matrix_out(atom, sigma) = nda::matrix<dcomplex>{matrix_C(0, sigma)(r_atom, r_atom)};
45 auto res = nda::zeros<long>(1,
n_sigma());
47 return {.names = {{
"0"s},
sigma_names()}, .dims = std::move(res)};
spin_kind_e spin_kind() const
Spin kind of index.
nda::array< nda::matrix< dcomplex >, 1 > const & rotation_from_spherical_to_dft_basis() const
Array of rotation matrices from spherical harmonics to dft specific orbital basis.
block2_gf< Mesh > atomic_view(block2_gf< Mesh > const &G_C)
Views a 2-dim block GF according to the atomic decomposition.
long n_sigma() const
Dimension of the index.
nda::array< nda::matrix< dcomplex >, 2 > const & rotation_from_dft_to_local_basis() const
2-dim array of all local rotation matices that rotate the data.
local_space(spin_kind_e spin_kind, std::vector< atomic_orbs > atomic_shells, nda::array< std::vector< long >, 2 > irreps_decomp_per_atom, nda::array< nda::matrix< dcomplex >, 2 > rotation_from_dft_to_local_basis, nda::array< nda::matrix< dcomplex >, 1 > rotation_from_spherical_to_dft_basis)
Construct a new local space object.
long dim() const
Dimension of the correlated space.
std::vector< atomic_orbs > const & atomic_shells() const
List of all atomic shells spanning the space.
long n_atoms() const
The number of atoms.
std::vector< std::string > sigma_names() const
Names of spin indices for naming blocks in block GFs.
C2PY_IGNORE gf_struct2_t Gc_block_shape() const
Shape of the Green function in the correlated space, without block decomposition.
std::vector< long > atomic_decomposition() const
Dimensions of each atomic shell, in order.
long first_shell_of_its_equiv_cls(long idx) const
Given the index of an atomic shell, return the index of the first atomic shell of its equivalence cla...
spin_kind_e
Kind of σ index.
static constexpr auto r_all
generator< std::pair< long, nda::range > > enumerated_sub_slices(auto sub_div)