code: def mean_field(self):
          
          mean_field = []
          for sp_oper in [self.oper['O'], self.oper['O_d']]:
              avgO = np.array([self.expected(op) for op in sp_oper])
              avgO[abs(avgO) < 1e-10] = 0.
              mean_field.append(avgO*self.param['ekin'])
  
          return np.array(mean_field)
docs: Calculates mean field