<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def restriction(self, lam, mean_field):
 """Lagrange multiplier in lattice slave spin"""

        self.update_H(mean_field, lam)
        restric = np.array([self.expected(op) - n for op, n in zip(self.oper['Sz+1/2'], self.param['populations'])])
        return restric