7#include <triqs/gfs.hpp>
44 std::vector<atomic_orbs> _atomic_shells;
47 nda::array<std::vector<long>, 2> _irreps_decomp_per_atom;
51 nda::array<nda::matrix<dcomplex>, 2> _rotation_from_dft_to_local_basis;
54 nda::array<nda::matrix<dcomplex>, 1> _rotation_from_spherical_to_dft_basis;
60 std::vector<std::string> _atom_names = {};
92 [[nodiscard]]
long dim()
const {
return _dim_C; }
95 [[nodiscard]] std::vector<atomic_orbs>
const &
atomic_shells()
const {
return _atomic_shells; }
98 [[nodiscard]]
long n_atoms()
const {
return long(_atomic_shells.size()); }
109 return _rotation_from_spherical_to_dft_basis;
116 [[nodiscard]] std::vector<std::string>
atom_names()
const {
return _atom_names; }
120 return atomic_shells() | stdv::transform([](
auto const &s) {
return s.dim; });
137 template <
typename Mesh> block2_gf<Mesh>
atomic_view(block2_gf<Mesh>
const &G_C) {
141 for (
auto sigma : range(
n_sigma))
143 Gout(atom, sigma).data() = G_C(0, sigma).data()(
r_all, r_atom, r_atom);
156 nda::array<nda::matrix<dcomplex>, 2>
atomic_view(nda::array<nda::matrix<dcomplex>, 2>
const &matrix_C);
166 auto res = nda::zeros<long>(_atomic_shells.size(),
n_sigma());
167 for (
auto const &[alpha, shell] : enumerate(_atomic_shells)) res(alpha,
r_all) = shell.dim;
175 std::ostream &
operator<<(std::ostream &out, local_space
const &bd);
Describe the atomic orbitals within downfolded space.
spin_kind_e spin_kind() const
friend void h5_write(h5::group g, std::string const &name, local_space const &ls)
nda::array< nda::matrix< dcomplex >, 1 > const & rotation_from_spherical_to_dft_basis() const
List of rotation matrices from spherical harmonics to dft specific orbital basis.
block2_gf< Mesh > atomic_view(block2_gf< Mesh > const &G_C)
Views a block2gf 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
List of all (a, sigma) local rotation matices that rotate the data.
std::vector< std::string > atom_names() const
Names of the atoms in the orbital set.
nda::array< std::vector< long >, 2 > const & atoms_block_decomposition() const
List of all blocks spanning 𝓒 space -> atoms_block_decomposition.
auto atomic_decomposition() const
Generates [dimension of the atomic shell].
long dim() const
Dimension of the correlated space.
friend void h5_read(h5::group g, std::string const &name, local_space &ls)
h5 read/write
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_gf
C2PY_IGNORE gf_struct2_t Gc_block_shape() const
Shape of the Green function in the correlated space, without block decomposition.
C2PY_IGNORE gf_struct2_t Gatom_block_shape() const
Shape of the Green function in the correlated space, decomposed by atomic shells.
long first_shell_of_its_equiv_cls(long idx) const
Given the index idx of an atomic shell, return the index of the first atomic shell of its equivalence...
block2_gf< Mesh, matrix_valued > make_block2_gf(Mesh const &mesh, gf_struct2_t const &gf_s)
std::ostream & operator<<(std::ostream &out, one_body_elements_on_grid const &)
spin_kind_e
Kind of σ index.
static constexpr auto r_all
generator< std::pair< long, nda::range > > enumerated_sub_slices(auto sub_div)