<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expand(self):
 """Expand each matrix element distributively. Returns: Matrix: Expanded matrix. """

        return self.element_wise(
            lambda o: o.expand() if isinstance(o, QuantumExpression) else o)