code: def get_projection_on_elements(self, structure):
          
          dico = {}
          for spin in self.data.keys():
              dico[spin] = [[defaultdict(float)
                             for i in range(self.nkpoints)]
                            for j in range(self.nbands)]
  
          for iat in range(self.nions):
              name = structure.species[iat].symbol
              for spin, d in self.data.items():
                  for k, b in itertools.product(range(self.nkpoints),
                                                range(self.nbands)):
                      dico[spin][b][k][name] = np.sum(d[k, b, iat, :])
  
          return dico
docs: Method returning a dictionary of projections on elements.
  
          Args:
              structure (Structure): Input structure.
  
          Returns:
              a dictionary in the {Spin.up:[k index][b index][{Element:values}]]