<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mean_field(self):
 """Calculates mean field"""

        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)